| |
- builtins.Exception(builtins.BaseException)
-
- HTTPError
- IPPError
- builtins.object
-
- Attribute
- Connection
- Constraint
- Dest
- Group
- IPPAttribute
- IPPRequest
- Option
- PPD
class Attribute(builtins.object) |
|
PPD attribute
=============
A PPD attribute.
@type name: string
@ivar name: attribute name
@type spec: string
@ivar spec: specifier string (if any)
@type text: string
@ivar text: human-readable text (if any)
@type value: string
@ivar value: attribute value |
|
Methods defined here:
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
- __repr__(self, /)
- Return repr(self).
Static methods defined here:
- __new__(*args, **kwargs)
- Create and return a new object. See help(type) for accurate signature.
Data descriptors defined here:
- name
- name
- spec
- spec
- text
- text
- value
- value
|
class Connection(builtins.object) |
|
CUPS connection
===============
A connection to the CUPS server. Before it is created the
connection server and username should be set using
L{cups.setServer} and L{cups.setUser}; otherwise the defaults will
be used. When a Connection object is instantiated it results in a
call to the libcups function httpConnectEncrypt().
The constructor takes optional arguments host, port, and encryption,
which default to the values of L{cups.getServer}(),
L{cups.getPort}(), and L{cups.getEncryption}(). |
|
Methods defined here:
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
- __repr__(self, /)
- Return repr(self).
- acceptJobs(...)
- acceptJobs(name) -> None
Cause printer to accept jobs.
@type name: string
@param name: queue name
@raise IPPError: IPP problem
- addPrinter(...)
- addPrinter(name) -> None
Add or adjust a print queue. Several parameters can select which
PPD to use (filename, ppdname, and ppd) but only one may be
given.
@type filename: string
@keyword filename: local filename of PPD file
@type ppdname: string
@keyword ppdname: filename from L{getPPDs}
@type info: string
@keyword info: human-readable information about the printer
@type location: string
@keyword location: human-readable printer location
@type device: string
@keyword device: device URI string
@type ppd: L{cups.PPD} instance
@keyword ppd: PPD object
@raise IPPError: IPP problem
- addPrinterOptionDefault(...)
- addPrinterOptionDefault(name, option, value) -> None
Set a network default option. Jobs submitted to the named queue
will have the job option added if it is not already present in the
job. This works with CUPS servers of at least version 1.2.
@type name: string
@param name: queue name
@type option: string
@param option: option name, for example 'job-priority'
@type value: string
@param value: option value as a string
@raise IPPError: IPP problem
- addPrinterToClass(...)
- addPrinterToClass(name, class) -> None
Add a printer to a class. If the class does not yet exist,
it is created.
@type name: string
@param name: queue name
@type class: string
@param class: class name
@raise IPPError: IPP problem
- adminExportSamba(...)
- adminExportSamba(name, samba_server, samba_username,
samba_password) -> None
Export a printer to Samba.
@type name: string
@param name: queue name
@type samba_server: string
@param samba_server: samba server
@type samba_username: string
@param samba_username: samba username
@type samba_password: string
@param samba_password: samba password
@raise IPPError: IPP problem
- adminGetServerSettings(self, /)
- adminGetServerSettings() -> dict
Get server settings.
@return: dict representing server settings; keywords include
L{CUPS_SERVER_DEBUG_LOGGING}, L{CUPS_SERVER_REMOTE_ADMIN},
L{CUPS_SERVER_REMOTE_PRINTERS}, L{CUPS_SERVER_SHARE_PRINTERS},
L{CUPS_SERVER_USER_CANCEL_ANY}
@see: L{adminSetServerSettings}
@raise IPPError: IPP problem
- adminSetServerSettings(...)
- adminSetServerSettings(settings) -> None
Set server settings.
@type settings: dict
@param settings: dict of server settings
@see: L{adminGetServerSettings}
@raise IPPError: IPP problem
- authenticateJob(...)
- authenticateJob(jobid, auth_info=None) -> None
@type jobid: integer
@param jobid: job ID to authenticate
@type auth_info: optional string list
@param auth_info: authentication details
@raise IPPError: IPP problem
- cancelAllJobs(...)
- cancelAllJobs(name=None, uri=None, my_jobs=False, purge_jobs=True) -> None
@type name: string
@param name: queue name
@type uri: string
@param uri: printer URI
@type my_jobs: boolean
@param my_jobs: whether to restrict operation to jobs owned by
the current CUPS user (as set by L{cups.setUser}).
@type purge_jobs: boolean
@param purge_jobs: whether to remove data and control files
@raise IPPError: IPP problem
- cancelJob(...)
- cancelJob(jobid, purge_job=False) -> None
@type jobid: integer
@param jobid: job ID to cancel
@type purge_job: boolean
@param purge_job: whether to remove data and control files
@raise IPPError: IPP problem
- cancelSubscription(...)
- cancelSubscription(id) -> None
Cancel a subscription.
@type id: integer
@param id: subscription ID
@raise IPPError: IPP problem
- createJob(...)
- createJob(printer, title, options) -> integer
Create an empty job for streaming.
@type printer: string
@param printer: queue name
@type title: string
@param title: title of the print job
@type options: dict
@param options: dict of options
@return: job ID
@raise IPPError: IPP problem
- createSubscription(...)
- createSubscription(uri, events=[], job_id=-1, recipient_uri=,
lease_duration=-1, time_interval=-1,
user_data=) -> integer
Create a subscription.
@type uri: string
@param uri: URI for object
@type events: string list
@keyword events: events to receive notifications for
@type job_id: integer
@keyword job_id: job ID to receive notifications for
@type recipient_uri: string
@keyword recipient_uri: URI for notifications recipient
@type lease_duration: integer
@keyword lease_duration: lease duration in seconds
@type time_interval: integer
@keyword time_interval: time interval
@type user_data: string
@keyword user_data: user data to receive with notifications
@return: subscription ID
@raise IPPError: IPP problem
- deleteClass(...)
- deleteClass(class) -> None
Delete a class.
@type class: string
@param class: class name
@raise IPPError: IPP problem
- deletePrinter(...)
- deletePrinter(name) -> None
Delete a printer.
@type name: string
@param name: queue name
@raise IPPError: IPP problem
- deletePrinterFromClass(...)
- deletePrinterFromClass(name, class) -> None
Remove a printer from a class. If the class would be left empty,
it is removed.
@type name: string
@param name: queue name
@type class: string
@param class: class name
@raise IPPError: IPP problem
- deletePrinterOptionDefault(...)
- deletePrinterOptionDefault(name, option) -> None
Removes a network default option. See L{addPrinterOptionDefault}.
@type name: string
@param name: queue name
@type option: string
@param option: option name, for example 'job-priority'
@raise IPPError: IPP problem
- disablePrinter(...)
- disablePrinter(name) -> None
Disable printer. This prevents the printer from processing its
job queue.
@type name: string
@param name: queue name
@type reason: string
@keyword reason: optional human-readable reason for disabling the
printer
@raise IPPError: IPP problem
- enablePrinter(...)
- enablePrinter(name) -> None
Enable printer. This allows the printer to process its job queue.
@type name: string
@param name: queue name
@raise IPPError: IPP problem
- finishDocument(...)
- finishDocument(printer) -> integer
Finish sending a document.
@type printer: string
@param printer: queue name
@return: HTTP status
@raise IPPError: IPP problem
- getClasses(self, /)
- getClasses() -> dict
@return: a dict, indexed by name, of objects representing
classes. Each class object is either a string, in which case it
is for the remote class; or a list, in which case it is a list of
queue names.
@raise IPPError: IPP problem
- getDefault(self, /)
- getDefault() -> string or None
Get the system default printer.
@return: default printer name or None
- getDests(self, /)
- getDests() -> dict
@return: a dict representing available destinations. Each
dictionary key is a pair of (queue, instance) strings, and the
dictionary value is a L{cups.Dest} object. In addition to the
available destinations, a special dictionary key (None,None) is
provided for looking up the default destination; this destination
will also be available under its own key.
@raise IPPError: IPP problem
- getDevices(...)
- getDevices(limit=0, exclude_schemes=None, include_schemes=None) -> dict
@type limit: integer
@param limit: maximum number of devices to return
@type exclude_schemes: string list
@param exclude_schemes: URI schemes to exclude
@type include_schemes: string list
@param include_schemes: URI schemes to include
@return: a dict, indexed by device URI, of dicts representing
devices, indexed by attribute.
@raise IPPError: IPP problem
- getDocument(...)
- getDocument(printer_uri, job_id, document_number) -> dict
Fetches the job document and stores it in a temporary file.
@type printer_uri: string
@param printer_uri: the printer-uri for the printer
@type job_id: integer
@param job_id: the job ID
@type document_number: integer
@param document_number: the document number to retrieve
@return: a dict with the following keys: 'file' (string), temporary filename holding the job document; 'document-format' (string), its MIME type. There may also be a 'document-name' key, in which case this is for the document name.
@raise RuntimeError: Not supported in libcups until 1.4
@raise IPPError: IPP problem
- getFile(...)
- getFile(resource, filename=None, fd=-1, file=None) -> None
Fetch a CUPS server resource to a local file.
This is for obtaining CUPS server configuration files and
log files.
@type resource: string
@param resource: resource name
@type filename: string
@param filename: name of local file for storage
@type fd: int
@param fd: file descriptor of local file
@type file: file
@param file: Python file object for local file
@raise HTTPError: HTTP problem
- getJobAttributes(...)
- getJobAttributes(jobid, requested_attributes=None) -> dict
Fetch job attributes.
@type jobid: integer
@param jobid: job ID
@type requested_attributes: string list
@param requested_attributes: list of requested attribute names
@return: a dict representing job attributes.
@raise IPPError: IPP problem
- getJobs(...)
- getJobs(which_jobs='not-completed', my_jobs=False, limit=-1, first_job_id=-1, requested_attributes=None) -> dict
Fetch a list of jobs.
@type which_jobs: string
@param which_jobs: which jobs to fetch; possible values:
'completed', 'not-completed', 'all'
@type my_jobs: boolean
@param my_jobs: whether to restrict the returned jobs to those
owned by the current CUPS user (as set by L{cups.setUser}).
@return: a dict, indexed by job ID, of dicts representing job
attributes.
@type limit: integer
@param limit: maximum number of jobs to return
@type first_job_id: integer
@param first_job_id: lowest job ID to return
@type requested_attributes: string list
@param requested_attributes: list of requested attribute names
@raise IPPError: IPP problem
- getNotifications(...)
- getNotifications(subscription_ids) -> list
Get notifications for subscribed events.
@type subscription_ids: integer list
@param subscription_ids: list of subscription IDs to receive
notifications for
@return: list of dicts, each representing an event
@raise IPPError: IPP problem
- getPPD(...)
- getPPD(name) -> string
Fetch a printer's PPD.
@type name: string
@param name: queue name
@return: temporary PPD file name
@raise IPPError: IPP problem
- getPPD3(...)
- getPPD3(name[, modtime, filename]) -> (status,modtime,filename)
Fetch a printer's PPD if it is newer.
@type name: string
@param name: queue name
@type modtime: float
@param modtime: modification time of existing file
@type filename: string
@param filename: filename of existing file
@return: tuple of HTTP status, modification time, and filename
- getPPDs(...)
- getPPDs(limit=0, exclude_schemes=None, include_schemes=None,
ppd_natural_language=None, ppd_device_id=None, ppd_make=None,
ppd_make_and_model=None, ppd_model_number=-1, ppd_product=None,
ppd_psversion=None, ppd_type=None) -> dict
@type limit: integer
@param limit: maximum number of PPDs to return
@type exclude_schemes: string list
@param exclude_schemes: list of PPD schemes to exclude
@type include_schemes: string list
@param include_schemes: list of PPD schemes to include
@type ppd_natural_language: string
@param ppd_natural_language: required language
@type ppd_device_id: string
@param ppd_device_id: IEEE 1284 Device ID to match against
@type ppd_make: string
@param ppd_make: required printer manufacturer
@type ppd_make_and_model: string
@param ppd_make_and_model: required make and model
@type ppd_model_number: integer
@param ppd_model_number: model number required (from cupsModelNumber
in PPD file)
@type ppd_product: string
@param ppd_product: required PostScript product string (Product)
@type ppd_psversion: string
@param ppd_psversion: required PostScript version (PSVersion)
@type ppd_type: string
@param ppd_type: required type of PPD. Valid values are fax; pdf;
postscript; raster; unknown.
@return: a dict, indexed by PPD name, of dicts representing
PPDs, indexed by attribute.
@raise IPPError: IPP problem
- getPPDs2(...)
- getPPDs2(limit=0, exclude_schemes=None, include_schemes=None,
ppd_natural_language=None, ppd_device_id=None, ppd_make=None,
ppd_make_and_model=None, ppd_model_number=-1, ppd_product=None,
ppd_psversion=None, ppd_type=None) -> dict
@type limit: integer
@param limit: maximum number of PPDs to return
@type exclude_schemes: string list
@param exclude_schemes: list of PPD schemes to exclude
@type include_schemes: string list
@param include_schemes: list of PPD schemes to include
@type ppd_natural_language: string
@param ppd_natural_language: required language
@type ppd_device_id: string
@param ppd_device_id: IEEE 1284 Device ID to match against
@type ppd_make: string
@param ppd_make: required printer manufacturer
@type ppd_make_and_model: string
@param ppd_make_and_model: required make and model
@type ppd_model_number: integer
@param ppd_model_number: model number required (from cupsModelNumber
in PPD file)
@type ppd_product: string
@param ppd_product: required PostScript product string (Product)
@type ppd_psversion: string
@param ppd_psversion: required PostScript version (PSVersion)
@type ppd_type: string
@param ppd_type: required type of PPD. Valid values are fax; pdf;
postscript; raster; unknown.
@return: a dict, indexed by PPD name, of dicts representing
PPDs, indexed by attribute. All attribute values are lists.
@raise IPPError: IPP problem
- getPrinterAttributes(...)
- getPrinterAttributes(name=None, uri=None, requested_attributes=None) -> dict
Fetch the attributes for a printer, specified either by name or by
uri but not both.
@type name: string
@param name: queue name
@type uri: string
@param uri: queue URI
@type requested_attributes: string list
@param requested_attributes: list of requested attribute names
@return: a dict, indexed by attribute, of printer attributes
for the specified printer.
Attributes:
- 'job-sheets-supported': list of strings
- 'job-sheets-default': tuple of strings (start, end)
- 'printer-error-policy-supported': if present, list of strings
- 'printer-error-policy': if present, string
- 'printer-op-policy-supported': if present, list of strings
- 'printer-op-policy': if present, string
There are other attributes; the exact list of attributes returned
will depend on the IPP server.
@raise IPPError: IPP problem
- getPrinters(self, /)
- getPrinters() -> dict
@return: a dict, indexed by name, of dicts representing
queues, indexed by attribute.
@raise IPPError: IPP problem
- getServerPPD(...)
- getServerPPD(ppd_name) -> string
Fetches the named PPD and stores it in a temporary file.
@type ppd_name: string
@param ppd_name: the ppd-name of a PPD
@return: temporary filename holding the PPD
@raise RuntimeError: Not supported in libcups until 1.3
@raise IPPError: IPP problem
- getSubscriptions(...)
- getSubscriptions(uri) -> integer list
Get subscriptions.
@type uri: string
@param uri: URI for object
@type my_subscriptions: boolean
@keyword my_subscriptions: only return subscriptions belonging to
the current user (default False)
@type job_id: integer
@keyword job_id: only return subscriptions relating to this job
@return: list of subscriptions
@raise IPPError: IPP problem
- moveJob(...)
- moveJob(printer_uri=None, job_id=-1, job_printer_uri) -> None
Move a job specified by printer_uri and jobid (only one need be given)
to the printer specified by job_printer_uri.
@type job_id: integer
@param job_id: job ID to move
@type printer_uri: string
@param printer_uri: printer to move job(s) from
@type job_printer_uri: string
@param job_printer_uri: printer to move job(s) to
@raise IPPError: IPP problem
- printFile(...)
- printFile(printer, filename, title, options) -> integer
Print a file.
@type printer: string
@param printer: queue name
@type filename: string
@param filename: local file path to the document
@type title: string
@param title: title of the print job
@type options: dict
@param options: dict of options
@return: job ID
@raise IPPError: IPP problem
- printFiles(...)
- printFiles(printer, filenames, title, options) -> integer
Print a list of files.
@type printer: string
@param printer: queue name
@type filenames: list
@param filenames: list of local file paths to the documents
@type title: string
@param title: title of the print job
@type options: dict
@param options: dict of options
@return: job ID
@raise IPPError: IPP problem
- printTestPage(...)
- printTestPage(name) -> job ID
Print a test page.
@type name: string
@param name: queue name
@type file: string
@keyword file: input file (default is CUPS test page)
@type title: string
@keyword title: job title (default 'Test Page')
@type format: string
@keyword format: document format (default 'application/postscript')
@type user: string
@keyword user: user to submit the job as
@raise IPPError: IPP problem
- putFile(...)
- putFile(resource, filename=None, fd=-1, file=None) -> None
This is for uploading new configuration files for the CUPS
server. Note: L{adminSetServerSettings} is a way of
adjusting server settings without needing to parse the
configuration file.
@type resource: string
@param resource: resource name
@type filename: string
@param filename: name of local file to upload
@type fd: int
@param fd: file descriptor of local file
@type file: file
@param file: Python file object for local file
@raise HTTPError: HTTP problem
- rejectJobs(...)
- rejectJobs(name)
Cause printer to reject jobs.
@type name: string
@param name: queue name
@type reason: string
@keyword reason: optional human-readable reason for rejecting jobs
@raise IPPError: IPP problem
- renewSubscription(...)
- renewSubscription(id, lease_duration=-1) -> None
Renew a subscription.
@type id: integer
@param id: subscription ID
@type lease_duration: integer
@param lease_duration: lease duration in seconds
@raise IPPError: IPP problem
- restartJob(...)
- restartJob(job_id, job_hold_until=None) -> None
Restart a job.
@type job_id: integer
@param job_id: job ID to restart
@type job_hold_until: string
@param job_hold_until: new job-hold-until value for job
@raise IPPError: IPP problem
- setDefault(...)
- setDefault(name) -> None
Set the system default printer. Note that this can be over-ridden
on a per-user basis using the lpoptions command.
@type name: string
@param name: queue name
@raise IPPError: IPP problem
- setJobHoldUntil(...)
- setJobHoldUntil(jobid, job_hold_until) -> None
Specifies when a job should be printed.
@type jobid: integer
@param jobid: job ID to adjust
@type job_hold_until: string
@param job_hold_until: when to print the job; examples: 'hold',
'immediate', 'restart', resume'
@raise IPPError: IPP problem
- setPrinterDevice(...)
- setPrinterDevice(name, device_uri) -> None
Set the device URI for a printer.
@type name: string
@param name: queue name
@type device_uri: string
@param device_uri: device URI
@raise IPPError: IPP problem
- setPrinterErrorPolicy(...)
- setPrinterErrorPolicy(name, policy) -> None
Set the printer's error policy.
@type name: string
@param name: queue name
@type policy: string
@param policy: policy name; supported policy names can be found
by using the L{getPrinterAttributes} function and looking for the
'printer-error-policy-supported' attribute
@raise IPPError: IPP problem
- setPrinterInfo(...)
- setPrinterInfo(name, info) -> None
Set the human-readable information about a printer.
@type name: string
@param name: queue name
@type info: string
@param info: human-readable information about the printer
@raise IPPError: IPP problem
- setPrinterJobSheets(...)
- setPrinterJobSheets(name, start, end) -> None
Specifies job sheets for a printer.
@type name: string
@param name: queue name
@type start: string
@param start: name of a sheet to print before each job
@type end: string
@param end: name of a sheet to print after each job
@raise IPPError: IPP problem
- setPrinterLocation(...)
- setPrinterLocation(name, location) -> None
Set the human-readable printer location
@type name: string
@param name: queue name
@type location: string
@param location: human-readable printer location
@raise IPPError: IPP problem
- setPrinterOpPolicy(...)
- setPrinterOpPolicy(name, policy) -> None
Set the printer's operation policy.
@type name: string
@param name: queue name
@type policy: string
@param policy: policy name; supported policy names can be found
by using the L{getPrinterAttributes} function and looking for the
'printer-op-policy-supported' attribute
@raise IPPError: IPP problem
- setPrinterShared(...)
- setPrinterShared(name, shared) -> None
Set whether a printer is shared with other people. This works
with CUPS servers of at least version 1.2, by setting the
printer-is-shared printer attribute.
@type name: string
@param name: queue name
@type shared: boolean
@param shared: whether printer should be shared
@raise IPPError: IPP problem
- setPrinterUsersAllowed(...)
- setPrinterUsersAllowed(name, allowed) -> None
Set the list of users allowed to use a printer. This works
with CUPS server of at least version 1.2, by setting the
requesting-user-name-allowed printer attribute.
@type name: string
@param name: queue name
@type allowed: string list
@param allowed: list of allowed users; ['all']
means there will be no user-name restriction.
@raise IPPError: IPP problem
- setPrinterUsersDenied(...)
- setPrinterUsersDenied(name, denied) -> None
Set the list of users denied the use of a printer. This works
with CUPS servers of at least version 1.2, by setting the
requesting-user-name-denied printer attribute.
@type name: string
@param name: queue name
@type denied: string list
@param denied: list of denied users; ['none']
means there will be no user-name restriction.
@raise IPPError: IPP problem
- startDocument(...)
- startDocument(printer, job_id, doc_name, format, last_document) -> integer
Add a document to a job created with createJob.
@type printer: string
@param printer: queue name
@type job_id: integer
@param job_id: job ID to create document
@type doc_name: string
@param doc_name: name of the document
@type format: string
@param format: MIME type
@type last_document: integer
@param last_document: 1 for last document of job, 0 otherwise
@return: HTTP status
@raise IPPError: IPP problem
- writeRequestData(...)
- writeRequestData(buffer, length) -> integer
Write data after an IPP request.
@type buffer: string
@param buffer: bytes to write
@type length: integer
@param length: number of bytes to write
@return: HTTP status
@raise IPPError: IPP problem
Static methods defined here:
- __new__(*args, **kwargs)
- Create and return a new object. See help(type) for accurate signature.
|
class Constraint(builtins.object) |
|
PPD constraint
==============
A PPD constraint.
@type option1: string
@ivar option1: first option keyword
@type choice1: string
@ivar choice1: first option choice
@type option2: string
@ivar option2: second option keyword
@type choice2: string
@ivar choice2: secondoption choice |
|
Methods defined here:
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
Static methods defined here:
- __new__(*args, **kwargs)
- Create and return a new object. See help(type) for accurate signature.
Data descriptors defined here:
- choice1
- choice1
- choice2
- choice2
- option1
- option1
- option2
- option2
|
class Dest(builtins.object) |
|
CUPS destination
================
A destination print queue, as returned by L{Connection.getDests}.
@type name: string
@ivar name: destination queue name
@type instance: string
@ivar instance: destination instance name
@type is_default: boolean
@ivar is_default: whether this is the default destination
@type options: dict
@ivar options: string:string dict of default options for this
destination, indexed by option name |
|
Methods defined here:
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
- __repr__(self, /)
- Return repr(self).
Static methods defined here:
- __new__(*args, **kwargs)
- Create and return a new object. See help(type) for accurate signature.
Data descriptors defined here:
- instance
- instance
- is_default
- is_default
- name
- name
- options
- options
|
class Group(builtins.object) |
|
PPD option group
================
A PPD option group.
@type text: string
@ivar text: user-presentable group name
@type name: string
@ivar name: unique group name
@type options: L{Option} list
@ivar options: list of options in the group
@type subgroups: L{Group} list
@ivar subgroups: list of subgroups in the group |
|
Methods defined here:
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
- __repr__(self, /)
- Return repr(self).
Static methods defined here:
- __new__(*args, **kwargs)
- Create and return a new object. See help(type) for accurate signature.
Data descriptors defined here:
- name
- name
- options
- options
- subgroups
- subgroups
- text
- text
|
class HTTPError(builtins.Exception) |
|
This exception is raised when an HTTP problem has occurred. It
provides an integer HTTP status code.
Use it like this::
try:
...
except cups.HTTPError as (status):
print 'HTTP status is %d' % status |
|
- Method resolution order:
- HTTPError
- builtins.Exception
- builtins.BaseException
- builtins.object
Data descriptors defined here:
- __weakref__
- list of weak references to the object
Methods inherited from builtins.Exception:
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
Static methods inherited from builtins.Exception:
- __new__(*args, **kwargs) class method of builtins.Exception
- Create and return a new object. See help(type) for accurate signature.
Methods inherited from builtins.BaseException:
- __delattr__(self, name, /)
- Implement delattr(self, name).
- __getattribute__(self, name, /)
- Return getattr(self, name).
- __reduce__(self, /)
- Helper for pickle.
- __repr__(self, /)
- Return repr(self).
- __setattr__(self, name, value, /)
- Implement setattr(self, name, value).
- __setstate__(self, object, /)
- __str__(self, /)
- Return str(self).
- add_note(self, object, /)
- Exception.add_note(note) --
add a note to the exception
- with_traceback(self, object, /)
- Exception.with_traceback(tb) --
set self.__traceback__ to tb and return self.
Data descriptors inherited from builtins.BaseException:
- __cause__
- exception cause
- __context__
- exception context
- __dict__
- __suppress_context__
- __traceback__
- args
|
class IPPAttribute(builtins.object) |
|
IPP Attribute
=============
An IPP attribute.
@type group_tag: int
@ivar group_tag: IPP group tag
@type value_tag: int
@ivar value_tag: IPP value tag
@type values: list
@ivar value: list of values |
|
Methods defined here:
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
- __repr__(self, /)
- Return repr(self).
Static methods defined here:
- __new__(*args, **kwargs)
- Create and return a new object. See help(type) for accurate signature.
Data descriptors defined here:
- group_tag
- IPP group tag
- name
- IPP attribute name
- value_tag
- IPP value tag
- values
- List of values
|
class IPPError(builtins.Exception) |
|
This exception is raised when an IPP error has occurred. It
provides an integer IPP status code, and a human-readable string
describing the error.
Use it like this::
try:
...
except cups.IPPError as (status, description):
print 'IPP status is %d' % status
print 'Meaning:', description |
|
- Method resolution order:
- IPPError
- builtins.Exception
- builtins.BaseException
- builtins.object
Data descriptors defined here:
- __weakref__
- list of weak references to the object
Methods inherited from builtins.Exception:
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
Static methods inherited from builtins.Exception:
- __new__(*args, **kwargs) class method of builtins.Exception
- Create and return a new object. See help(type) for accurate signature.
Methods inherited from builtins.BaseException:
- __delattr__(self, name, /)
- Implement delattr(self, name).
- __getattribute__(self, name, /)
- Return getattr(self, name).
- __reduce__(self, /)
- Helper for pickle.
- __repr__(self, /)
- Return repr(self).
- __setattr__(self, name, value, /)
- Implement setattr(self, name, value).
- __setstate__(self, object, /)
- __str__(self, /)
- Return str(self).
- add_note(self, object, /)
- Exception.add_note(note) --
add a note to the exception
- with_traceback(self, object, /)
- Exception.with_traceback(tb) --
set self.__traceback__ to tb and return self.
Data descriptors inherited from builtins.BaseException:
- __cause__
- exception cause
- __context__
- exception context
- __dict__
- __suppress_context__
- __traceback__
- args
|
class IPPRequest(builtins.object) |
|
IPP Request
===========
An IPP request. The constructor takes an optional argument of the
operation code. |
|
Methods defined here:
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
- add(...)
- add(attr) -> IPPAttribute
@type attr: IPPAttribute
@param attr: Attribute to add to the request
@return: IPP request attribute
- addSeparator(self, /)
- addSeparator() -> IPPAttribute
@return: IPP request attribute
- readIO(...)
- readIO(read_fn, blocking=True) -> IPP state
@type read_fn: Callable function
@param read_fn: A callback, taking a single integer argument for
'size', for reading IPP data
@type blocking: Boolean
@param blocking: whether to continue reading until a complete
request is read
@return: IPP state value
- writeIO(...)
- writeIO(write_fn, blocking=True) -> IPP state
@type write_fn: Callable function
@param write_fn: A callback, taking a bytes object, for writing
IPP data
@type blocking: Boolean
@param blocking: whether to continue reading until a complete
request is written
@return: IPP state value
Static methods defined here:
- __new__(*args, **kwargs)
- Create and return a new object. See help(type) for accurate signature.
Data descriptors defined here:
- attributes
- IPP request attributes
- operation
- IPP request operation
- state
- IPP request transfer state
- statuscode
- IPP response status code
|
class Option(builtins.object) |
|
PPD option
==========
A PPD option.
@type conflicted: boolean
@ivar conflicted: whether this option is in conflict
@type keyword: string
@ivar keyword: the option keyword e.g. Duplex
@type defchoice: string
@ivar defchoice: the default option choice
@type text: string
@ivar text: the user-presentable option name e.g. Double-sided printing
@type ui: integer
@ivar ui: the option type; one of L{PPD_UI_BOOLEAN},
L{PPD_UI_PICKONE}, L{PPD_UI_PICKMANY}
@type choices: list
@ivar choices: list of the option's choices |
|
Methods defined here:
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
- __repr__(self, /)
- Return repr(self).
Static methods defined here:
- __new__(*args, **kwargs)
- Create and return a new object. See help(type) for accurate signature.
Data descriptors defined here:
- choices
- choices
- conflicted
- Whether this option is in conflict
- defchoice
- defchoice
- keyword
- keyword
- text
- text
- ui
- ui
|
class PPD(builtins.object) |
|
PPD file
========
A PPD file.
@type constraints: L{Constraint} list
@ivar constraints: list of constraints
@type attributes: L{Attribute} list
@ivar attributes: list of attributes
@type optionGroups: L{Group} list
@ivar optionGroups: list of PPD option groups |
|
Methods defined here:
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
- conflicts(self, /)
- conflicts() -> integer
@return: number of conflicts.
- emit(...)
- emit(file, section) -> None
Output marked options for section to a file.
@type file: file
@param file: file object
@type section: integer
@param section: section id
- emitAfterOrder(...)
- emitAfterOrder(file, section, limit, min_order) -> None
Output marked options for section to a file.
@type file: file
@param file: file object
@type section: integer
@param section: section id
@type limit: integer
@param limit: non-zero to use min_order
@type min_order: float
@param min_order: minimum order dependency
- emitFd(...)
- emitFd(fd, section) -> None
Output marked options for section to a file descriptor.
@type fd: integer
@param fd: file descriptor
@type section: integer
@param section: section id
- emitJCL(...)
- emitJCL(file, job_id, user, title) -> None
Emit code for JCL options to a file.
@type file: file object
@param file: file
@type job_id: integer
@param job_id: job id
@type user: string
@param user: user name on job
@type title: string
@param title: title of job
- emitJCLEnd(...)
- emitJCLEnd(file) -> None
Emit JCLEnd code to a file.
@type file: file object
@param file: file
- emitString(...)
- emitString(section, min_order) -> string
Return a string with the marked options for section, with at least min_order order dependency.
@type section: integer
@param section: section id
@type min_order: float
@param min_order: minimum order dependency
@return: string containing emitted postscript
- findAttr(...)
- findAttr(name)
@type name: string
@param name: attribute name
@type spec: string
@keyword spec: specifier string (optional)
@rtype: L{Attribute} or None
@return: matching attribute, or None if not found.
- findNextAttr(...)
- findNextAttr(name)
@type name: string
@param name: attribute name
@type spec: string
@keyword spec: specifier string (optional)
@rtype: L{Attribute} or None
@return: next matching attribute, or None if not found.
- findOption(...)
- findOption(name)
@type name: string
@param name: option keyword
@rtype: L{Option} or None
@return: named option, or None if not found.
- localize(self, /)
- localize() -> None
Localize PPD to the current locale.
- localizeIPPReason(...)
- localizeIPPReason(reason, scheme) -> string or None
Localize IPP reason to the current locale.
- localizeMarkerName(...)
- localizeMarkerName(name) -> string or None
Localize marker name to the current locale.
- markDefaults(self, /)
- markDefaults() -> None
Set (mark) all options to their default choices.
- markOption(...)
- markOption(option, choice) -> integer
Set an option to a particular choice.
@type option: string
@param option: option keyword
@type choice: string
@param choice: option choice
@return: number of conflicts
- nondefaultsMarked(self, /)
- nondefaultsMarked() -> boolean
Returns true if any non-default option choices are marked.
- writeFd(...)
- writeFd(fd) -> None
Write PPD file, with marked choices as defaults, to file
descriptor.
@type fd: integer
@param fd: open file descriptor
Static methods defined here:
- __new__(*args, **kwargs)
- Create and return a new object. See help(type) for accurate signature.
Data descriptors defined here:
- attributes
- List of attributes
- constraints
- List of constraints
- optionGroups
- List of PPD option groups
| |