gtk.unixprint.Printer

gtk.unixprint.Printer — an object representing a print in Unix (new in PyGTK 2.10)

Synopsis

class gtk.unixprint.Printer(gobject.GObject):
    def get_name()
def get_state_message()
def get_description()
def get_location()
def get_icon_name()
def get_job_count()
def is_active()
def is_virtual()
def is_default()
def compare(b)

Ancestry

+-- gobject.GObject
  +-- gtk.unixprint.Printer

gtk.unixprint.Printer Properties

"accepts-pdf"Read-Write-Construct Onlyif TRUE this printer can accept PDF. Available in GTK+ 2.10.
"accepts-ps"Read-Write-Construct Onlyif TRUE this printer can accept PostScript. Available in GTK+ 2.10.
"backend"Read-Write-Construct OnlyThe backend for the printer. Not currently useful in PyGTK. Available in GTK+ 2.10.
"icon-name"ReadThe icon name to use for the printer. Default value: None. Available in GTK+ 2.10.
"is-virtual"Read-Writeif FALSE this represents a real hardware printer. Default value: FALSE. Available in GTK+ 2.10.
"job-count"ReadThe number of jobs queued in the printer. Allowed values: >= 0. Default value: 0. Available in GTK+ 2.10.
"location"ReadThe location of the printer. Default value: None. Available in GTK+ 2.10.
"name"Read-Write-Construct OnlyThe name of the printer. Default value: None. Available in GTK+ 2.10.
"state-message"ReadA string giving the current state of the printer. Default value: None. Available in GTK+ 2.10.

gtk.unixprint.Printer Signal Prototypes

gobject.GObject Signal Prototypes

"details-acquired" def callback(printer, success, user_param1, ...)

Description

Note

This class is available in PyGTK 2.10 and above.

A gtk.Printer object represents a printer. You only need to deal directly with printers if you use the non-portable gtk.PrintUnixDialog API.

A gtk.Printer allows you to get status information about the printer, such as its description, its location, the number of queued jobs, etc. Most importantly, a gtk.Printer object can be used to create a gtk.PrintJob object, that lets you print to the printer.

Methods

gtk.unixprint.Printer.get_name

    def get_name()
Returns :the name of the printer

Note

This method is available in PyGTK 2.10 and above.

The get_name() method returns the name of the printer.

gtk.unixprint.Printer.get_state_message

    def get_state_message()
Returns :the state message of the printer

Note

This method is available in PyGTK 2.10 and above.

The get_state_message() method returns the state message describing the current state of the printer.

gtk.unixprint.Printer.get_description

    def get_description()
Returns :the description of the printer

Note

This method is available in PyGTK 2.10 and above.

The get_description() method returns the description of the printer.

gtk.unixprint.Printer.get_location

    def get_location()
Returns :the location of the printer

Note

This method is available in PyGTK 2.10 and above.

The get_location() method returns a description of the location of the printer.

gtk.unixprint.Printer.get_icon_name

    def get_icon_name()
Returns :the icon name for the printer

Note

This method is available in PyGTK 2.10 and above.

The get_icon_name() method returns the name of the icon to use for the printer.

gtk.unixprint.Printer.get_job_count

    def get_job_count()
Returns :the number of jobs on the printer

Note

This method is available in PyGTK 2.10 and above.

The get_job_count() method returns the number of jobs currently queued on the printer.

gtk.unixprint.Printer.is_active

    def is_active()
Returns :TRUE if the printer is active

Note

This method is available in PyGTK 2.10 and above.

The is_active() method returns TRUE if the printer is currently active (i.e. accepts new jobs).

gtk.unixprint.Printer.is_virtual

    def is_virtual()
Returns :TRUE if the printer is virtual

Note

This method is available in PyGTK 2.10 and above.

The is_virtual() method returns TRUE if the printer is virtual (i.e. does not represent actual printer hardware, but something like a CUPS class).

gtk.unixprint.Printer.is_default

    def is_default()
Returns :TRUE if the printer is the default

Note

This method is available in PyGTK 2.10 and above.

The is_default() method returns TRUE if the printer is the default printer.

gtk.unixprint.Printer.compare

    def compare(b)
b :a gtk.Printer
Returns :an integer indicating the result of the comparison of the gtk.Printer names.

Note

This method is available in PyGTK 2.10 and above.

The compare() method compares the name of the printer to the name of the gtk.Printer specified by b and returns:

  • a negative integer if the name of the printer is less than the name of b.

  • a negative integer if the name of the printer is the same as the name of b.

  • a positive integer if the name of the printer is greater than the name of b.

Signals

The "details-acquired" Signal

    def callback(printer, success, user_param1, ...)
printer :the printer that received the signal
success :TRUE if the details were successfully acquired
user_param1 :the first user parameter (if any) specified with the connect() method
... :additional user parameters (if any)

Note

This signal is available in GTK+ 2.10 and above.

The "details-acquired" signal is emitted in response to a request for detailed information about a printer from the print backend. The success parameter indicates if the information was actually obtained.