Back to index

system-config-printer  1.3.9+20120706
Public Member Functions | Private Member Functions | Private Attributes
cupspk.Connection Class Reference

List of all members.

Public Member Functions

def __init__
def set_parent
def getDevices
def cancelJob
def setJobHoldUntil
def restartJob
def getFile
def putFile
def addPrinter
def setPrinterDevice
def setPrinterInfo
def setPrinterLocation
def setPrinterShared
def setPrinterJobSheets
def setPrinterErrorPolicy
def setPrinterOpPolicy
def setPrinterUsersAllowed
def setPrinterUsersDenied
def addPrinterOptionDefault
def deletePrinterOptionDefault
def deletePrinter
def addPrinterToClass
def deletePrinterFromClass
def deleteClass
def setDefault
def enablePrinter
def disablePrinter
def acceptJobs
def rejectJobs
def adminGetServerSettings
def adminSetServerSettings

Private Member Functions

def _hack_subclass
def _get_cups_pk
def _call_with_pk_and_fallback
def _args_to_tuple
def _kwds_to_vars

Private Attributes

 _parent
 _session_bus
 _system_bus
 _connection

Detailed Description

Definition at line 52 of file cupspk.py.


Constructor & Destructor Documentation

def cupspk.Connection.__init__ (   self,
  host,
  port,
  encryption 
)

Definition at line 53 of file cupspk.py.

00053 
00054     def __init__(self, host, port, encryption):
00055         self._parent = None
00056 
00057         try:
00058             self._session_bus = dbus.SessionBus()
00059             self._system_bus = dbus.SystemBus()
00060         except dbus.exceptions.DBusException:
00061             # One or other bus not running.
00062             self._session_bus = self._system_bus = None
00063 
00064         self._connection = cups.Connection(host=host,
00065                                            port=port,
00066                                            encryption=encryption)
00067 
00068         self._hack_subclass()
00069 


Member Function Documentation

def cupspk.Connection._args_to_tuple (   self,
  types,
  args 
) [private]

Definition at line 149 of file cupspk.py.

00149 
00150     def _args_to_tuple(self, types, *args):
00151         retval = [ False ]
00152 
00153         if len(types) != len(args):
00154             retval[0] = True
00155             # We do this to have the right length for the returned value
00156             retval.extend(types)
00157             return tuple(types)
00158 
00159         exception = False
00160 
00161         for i in range(len(types)):
00162             if type(args[i]) != types[i]:
00163                 if types[i] == str and type(args[i]) == unicode:
00164                     # we accept a mix between unicode and str
00165                     pass
00166                 elif types[i] == str and type(args[i]) == int:
00167                     # we accept a mix between int and str
00168                     retval.append(str(args[i]))
00169                     continue
00170                 elif types[i] == str and type(args[i]) == float:
00171                     # we accept a mix between float and str
00172                     retval.append(str(args[i]))
00173                     continue
00174                 elif types[i] == str and type(args[i]) == bool:
00175                     # we accept a mix between bool and str
00176                     retval.append(str(args[i]))
00177                     continue
00178                 elif types[i] == str and args[i] == None:
00179                     # None is an empty string for dbus
00180                     retval.append('')
00181                     continue
00182                 elif types[i] == list and type(args[i]) == tuple:
00183                     # we accept a mix between list and tuple
00184                     retval.append(list(args[i]))
00185                     continue
00186                 elif types[i] == list and args[i] == None:
00187                     # None is an empty list
00188                     retval.append([])
00189                     continue
00190                 else:
00191                     exception = True
00192             retval.append(args[i])
00193 
00194         retval[0] = exception
00195 
00196         return tuple(retval)
00197 

Here is the caller graph for this function:

def cupspk.Connection._call_with_pk_and_fallback (   self,
  use_fallback,
  pk_function_name,
  pk_args,
  fallback_function,
  args,
  kwds 
) [private]

Definition at line 100 of file cupspk.py.

00100 
00101     def _call_with_pk_and_fallback(self, use_fallback, pk_function_name, pk_args, fallback_function, *args, **kwds):
00102         pk_function = None
00103 
00104         if not use_fallback:
00105             cups_pk = self._get_cups_pk()
00106             if cups_pk:
00107                 try:
00108                     pk_function = cups_pk.get_dbus_method(pk_function_name)
00109                 except dbus.exceptions.DBusException:
00110                     pass
00111 
00112         if use_fallback or not pk_function:
00113             return fallback_function(*args, **kwds)
00114 
00115         pk_retval = 'PolicyKit communication issue'
00116 
00117         while True:
00118             try:
00119                 # FIXME: async call or not?
00120                 pk_retval = pk_function(*pk_args)
00121 
00122                 # if the PK call has more than one return values, we pop the
00123                 # first one as the error message
00124                 if type(pk_retval) == tuple:
00125                     retval = pk_retval[1:]
00126                     # if there's no error, then we can safely return what we
00127                     # got
00128                     if pk_retval[0] == '':
00129                         # if there's only one item left in the tuple, we don't
00130                         # want to return the tuple, but the item
00131                         if len(retval) == 1:
00132                             return retval[0]
00133                         else:
00134                             return retval
00135                 break
00136             except dbus.exceptions.DBusException, e:
00137                 if e.get_dbus_name() == CUPS_PK_NEED_AUTH:
00138                     raise cups.IPPError(cups.IPP_NOT_AUTHORIZED, 'pkcancel')
00139 
00140                 break
00141 
00142         # The PolicyKit call did not work (either a PK-error and we got a dbus
00143         # exception that wasn't handled, or an error in the mechanism itself)
00144         if pk_retval != '':
00145             debugprint ('PolicyKit call to %s did not work: %s' %
00146                         (pk_function_name, pk_retval))
00147             return fallback_function(*args, **kwds)
00148 

Here is the call graph for this function:

Here is the caller graph for this function:

def cupspk.Connection._get_cups_pk (   self) [private]

Definition at line 88 of file cupspk.py.

00088 
00089     def _get_cups_pk(self):
00090         try:
00091             object = self._system_bus.get_object(CUPS_PK_NAME, CUPS_PK_PATH)
00092             return dbus.Interface(object, CUPS_PK_IFACE)
00093         except dbus.exceptions.DBusException:
00094             # Failed to get object or interface.
00095             return None
00096         except AttributeError:
00097             # No system D-Bus
00098             return None
00099 

Here is the caller graph for this function:

def cupspk.Connection._hack_subclass (   self) [private]

Definition at line 70 of file cupspk.py.

00070 
00071     def _hack_subclass(self):
00072         # here's how to subclass without really subclassing. Just provide
00073         # the same methods
00074         methodtype = type(self._connection.getPrinters)
00075         for fname in dir(self._connection):
00076             if fname[0] == '_':
00077                 continue
00078             fn = getattr(self._connection, fname)
00079             if type(fn) != methodtype:
00080                 continue
00081             if not hasattr(self, fname):
00082                 setattr(self, fname, fn.__call__)
00083 

def cupspk.Connection._kwds_to_vars (   self,
  names,
  kwds 
) [private]

Definition at line 198 of file cupspk.py.

00198 
00199     def _kwds_to_vars(self, names, **kwds):
00200         ret = []
00201 
00202         for name in names:
00203             if kwds.has_key(name):
00204                 ret.append(kwds[name])
00205             else:
00206                 ret.append('')
00207 
00208         return tuple(ret)
00209 
00210 
00211 #    getPrinters
00212 #    getDests
00213 #    getClasses
00214 #    getPPDs
00215 #    getServerPPD
00216 #    getDocument
00217 

Here is the caller graph for this function:

def cupspk.Connection.acceptJobs (   self,
  args,
  kwds 
)

Definition at line 698 of file cupspk.py.

00698 
00699     def acceptJobs(self, *args, **kwds):
00700         (use_pycups, name) = self._args_to_tuple([str], *args)
00701         pk_args = (name, True, '')
00702 
00703         self._call_with_pk_and_fallback(use_pycups,
00704                                         'PrinterSetAcceptJobs', pk_args,
00705                                         self._connection.acceptJobs,
00706                                         *args, **kwds)
00707 

Here is the call graph for this function:

def cupspk.Connection.addPrinter (   self,
  args,
  kwds 
)

Definition at line 481 of file cupspk.py.

00481 
00482     def addPrinter(self, *args, **kwds):
00483         (use_pycups, name) = self._args_to_tuple([str], *args)
00484         (filename, ppdname, info, location, device, ppd) = self._kwds_to_vars(['filename', 'ppdname', 'info', 'location', 'device', 'ppd'], **kwds)
00485 
00486         need_unlink = False
00487         if not ppdname and not filename and ppd:
00488             (fd, filename) = tempfile.mkstemp ()
00489             ppd.writeFd(fd)
00490             os.close(fd)
00491             need_unlink = True
00492 
00493         if filename and not ppdname:
00494             pk_args = (name, device, filename, info, location)
00495             self._call_with_pk_and_fallback(use_pycups,
00496                                             'PrinterAddWithPpdFile', pk_args,
00497                                             self._connection.addPrinter,
00498                                             *args, **kwds)
00499             if need_unlink:
00500                 os.unlink(filename)
00501         else:
00502             pk_args = (name, device, ppdname, info, location)
00503             self._call_with_pk_and_fallback(use_pycups,
00504                                             'PrinterAdd', pk_args,
00505                                             self._connection.addPrinter,
00506                                             *args, **kwds)
00507 

Here is the call graph for this function:

def cupspk.Connection.addPrinterOptionDefault (   self,
  args,
  kwds 
)

Definition at line 597 of file cupspk.py.

00597 
00598     def addPrinterOptionDefault(self, *args, **kwds):
00599         # The values can be either a single string, or a list of strings, so
00600         # we have to handle this
00601         (use_pycups, name, option, value) = self._args_to_tuple([str, str, str], *args)
00602         # success
00603         if not use_pycups:
00604             values = (value,)
00605         # okay, maybe we directly have values
00606         else:
00607             (use_pycups, name, option, values) = self._args_to_tuple([str, str, list], *args)
00608         pk_args = (name, option, values)
00609 
00610         self._call_with_pk_and_fallback(use_pycups,
00611                                         'PrinterAddOptionDefault', pk_args,
00612                                         self._connection.addPrinterOptionDefault,
00613                                         *args, **kwds)
00614 

Here is the call graph for this function:

def cupspk.Connection.addPrinterToClass (   self,
  args,
  kwds 
)

Definition at line 636 of file cupspk.py.

00636 
00637     def addPrinterToClass(self, *args, **kwds):
00638         (use_pycups, printer, name) = self._args_to_tuple([str, str], *args)
00639         pk_args = (name, printer)
00640 
00641         self._call_with_pk_and_fallback(use_pycups,
00642                                         'ClassAddPrinter', pk_args,
00643                                         self._connection.addPrinterToClass,
00644                                         *args, **kwds)
00645 

Here is the call graph for this function:

def cupspk.Connection.adminGetServerSettings (   self,
  args,
  kwds 
)

Definition at line 721 of file cupspk.py.

00721 
00722     def adminGetServerSettings(self, *args, **kwds):
00723         use_pycups = False
00724         pk_args = ()
00725 
00726         result = self._call_with_pk_and_fallback(use_pycups,
00727                                                'ServerGetSettings', pk_args,
00728                                                self._connection.adminGetServerSettings,
00729                                                *args, **kwds)
00730         settings = {}
00731         if result != None:
00732             for i in result.keys():
00733                 if type(i) == dbus.String:
00734                     settings[str(i)] = str(result[i])
00735                 else:
00736                     settings[i] = result[i]
00737 
00738         return settings
00739 

Here is the call graph for this function:

def cupspk.Connection.adminSetServerSettings (   self,
  args,
  kwds 
)

Definition at line 740 of file cupspk.py.

00740 
00741     def adminSetServerSettings(self, *args, **kwds):
00742         (use_pycups, settings) = self._args_to_tuple([dict], *args)
00743         pk_args = (settings,)
00744 
00745         self._call_with_pk_and_fallback(use_pycups,
00746                                         'ServerSetSettings', pk_args,
00747                                         self._connection.adminSetServerSettings,
00748                                         *args, **kwds)
00749 
00750 
00751 #    getSubscriptions
00752 #    createSubscription
00753 #    getNotifications
00754 #    cancelSubscription
00755 #    renewSubscription
00756 #    printFile
00757 #    printFiles

Here is the call graph for this function:

def cupspk.Connection.cancelJob (   self,
  args,
  kwds 
)

Definition at line 315 of file cupspk.py.

00315 
00316     def cancelJob(self, *args, **kwds):
00317         (use_pycups, jobid) = self._args_to_tuple([int], *args)
00318         pk_args = (jobid, )
00319 
00320         self._call_with_pk_and_fallback(use_pycups,
00321                                         'JobCancel', pk_args,
00322                                         self._connection.cancelJob,
00323                                         *args, **kwds)
00324 
00325 
00326 #    cancelAllJobs
#    authenticateJob

Here is the call graph for this function:

def cupspk.Connection.deleteClass (   self,
  args,
  kwds 
)

Definition at line 656 of file cupspk.py.

00656 
00657     def deleteClass(self, *args, **kwds):
00658         (use_pycups, name) = self._args_to_tuple([str], *args)
00659         pk_args = (name,)
00660 
00661         self._call_with_pk_and_fallback(use_pycups,
00662                                         'ClassDelete', pk_args,
00663                                         self._connection.deleteClass,
00664                                         *args, **kwds)
00665 
00666 #    getDefault

Here is the call graph for this function:

def cupspk.Connection.deletePrinter (   self,
  args,
  kwds 
)

Definition at line 625 of file cupspk.py.

00625 
00626     def deletePrinter(self, *args, **kwds):
00627         (use_pycups, name) = self._args_to_tuple([str], *args)
00628         pk_args = (name,)
00629 
00630         self._call_with_pk_and_fallback(use_pycups,
00631                                         'PrinterDelete', pk_args,
00632                                         self._connection.deletePrinter,
00633                                         *args, **kwds)
00634 
00635 #    getPrinterAttributes

Here is the call graph for this function:

def cupspk.Connection.deletePrinterFromClass (   self,
  args,
  kwds 
)

Definition at line 646 of file cupspk.py.

00646 
00647     def deletePrinterFromClass(self, *args, **kwds):
00648         (use_pycups, printer, name) = self._args_to_tuple([str, str], *args)
00649         pk_args = (name, printer)
00650 
00651         self._call_with_pk_and_fallback(use_pycups,
00652                                         'ClassDeletePrinter', pk_args,
00653                                         self._connection.deletePrinterFromClass,
00654                                         *args, **kwds)
00655 

Here is the call graph for this function:

def cupspk.Connection.deletePrinterOptionDefault (   self,
  args,
  kwds 
)

Definition at line 615 of file cupspk.py.

00615 
00616     def deletePrinterOptionDefault(self, *args, **kwds):
00617         (use_pycups, name, option) = self._args_to_tuple([str, str], *args)
00618         pk_args = (name, option)
00619 
00620         self._call_with_pk_and_fallback(use_pycups,
00621                                         'PrinterDeleteOptionDefault', pk_args,
00622                                         self._connection.deletePrinterOptionDefault,
00623                                         *args, **kwds)
00624 

Here is the call graph for this function:

def cupspk.Connection.disablePrinter (   self,
  args,
  kwds 
)

Definition at line 688 of file cupspk.py.

00688 
00689     def disablePrinter(self, *args, **kwds):
00690         (use_pycups, name) = self._args_to_tuple([str], *args)
00691         pk_args = (name, False)
00692 
00693         self._call_with_pk_and_fallback(use_pycups,
00694                                         'PrinterSetEnabled', pk_args,
00695                                         self._connection.disablePrinter,
00696                                         *args, **kwds)
00697 

Here is the call graph for this function:

def cupspk.Connection.enablePrinter (   self,
  args,
  kwds 
)

Definition at line 678 of file cupspk.py.

00678 
00679     def enablePrinter(self, *args, **kwds):
00680         (use_pycups, name) = self._args_to_tuple([str], *args)
00681         pk_args = (name, True)
00682 
00683         self._call_with_pk_and_fallback(use_pycups,
00684                                         'PrinterSetEnabled', pk_args,
00685                                         self._connection.enablePrinter,
00686                                         *args, **kwds)
00687 

Here is the call graph for this function:

def cupspk.Connection.getDevices (   self,
  args,
  kwds 
)

Definition at line 218 of file cupspk.py.

00218 
00219     def getDevices(self, *args, **kwds):
00220         use_pycups = False
00221 
00222         limit = 0
00223         include_schemes = []
00224         exclude_schemes = []
00225         timeout = 0
00226 
00227         if len(args) == 4:
00228             (use_pycups, limit, include_schemes, exclude_schemes, timeout) = self._args_to_tuple([int, str, str, int], *args)
00229         else:
00230             if kwds.has_key('timeout'):
00231                 timeout = kwds['timeout']
00232 
00233             if kwds.has_key('limit'):
00234                 limit = kwds['limit']
00235 
00236             if kwds.has_key('include_schemes'):
00237                 include_schemes = kwds['include_schemes']
00238 
00239             if kwds.has_key('exclude_schemes'):
00240                 exclude_schemes = kwds['exclude_schemes']
00241 
00242         pk_args = (timeout, limit, include_schemes, exclude_schemes)
00243 
00244         try:
00245             result = self._call_with_pk_and_fallback(use_pycups,
00246                                                      'DevicesGet', pk_args,
00247                                                      self._connection.getDevices,
00248                                                      *args, **kwds)
00249         except TypeError:
00250             debugprint ("DevicesGet API exception; using old signature")
00251             if kwds.has_key ('timeout'):
00252                 use_pycups = True
00253 
00254             # Convert from list to string
00255             if len (include_schemes) > 0:
00256                 include_schemes = reduce (lambda x, y: x + "," + y,
00257                                           include_schemes)
00258             else:
00259                 include_schemes = ""
00260 
00261             if len (exclude_schemes) > 0:
00262                 exclude_schemes = reduce (lambda x, y: x + "," + y,
00263                                           exclude_schemes)
00264             else:
00265                 exclude_schemes = ""
00266 
00267             pk_args = (limit, include_schemes, exclude_schemes)
00268             result = self._call_with_pk_and_fallback(use_pycups,
00269                                                      'DevicesGet', pk_args,
00270                                                      self._connection.getDevices,
00271                                                      *args, **kwds)
00272 
00273         # return 'result' if fallback was called
00274         if len (result.keys()) > 0 and type (result[result.keys()[0]]) == dict:
00275              return result
00276 
00277         result_str = {}
00278         if result != None:
00279             for i in result.keys():
00280                 if type(i) == dbus.String:
00281                     result_str[str(i)] = str(result[i])
00282                 else:
00283                     result_str[i] = result[i]
00284 
00285         # cups-pk-helper returns all devices in one dictionary.
00286         # Keys of different devices are distinguished by ':n' postfix.
00287 
00288         devices = {}
00289         n = 0
00290         postfix = ':' + str (n)
00291         device_keys = [x for x in result_str.keys() if x.endswith(postfix)]
00292         while len (device_keys) > 0:
00293 
00294             device_uri = None
00295             device_dict = {}
00296             for i in device_keys:
00297                 key = i[:len(i) - len(postfix)]
00298                 if key != 'device-uri':
00299                     device_dict[key] = result_str[i]
00300                 else:
00301                     device_uri = result_str[i]
00302 
00303             if device_uri != None:
00304                 devices[device_uri] = device_dict
00305 
00306             n += 1
00307             postfix = ':' + str (n)
00308             device_keys = [x for x in result_str.keys() if x.endswith(postfix)]
00309 
00310         return devices
00311 
00312 
00313 #    getJobs
00314 #    getJobAttributes

Here is the call graph for this function:

def cupspk.Connection.getFile (   self,
  args,
  kwds 
)
Keeping this as an alternative for the code.
    We don't use it because it's not possible to know if the call was a
    PK-one (and so we push the content of a temporary filename to fd or
    file) or a non-PK-one (in which case nothing should be done).

filename = None
fd = None
file = None
if use_pycups:
    if len(kwds) != 1:
        use_pycups = True
    elif kwds.has_key('filename'):
        filename = kwds['filename']
    elif kwds.has_key('fd'):
        fd = kwds['fd']
    elif kwds.has_key('file'):
        file = kwds['file']
    else:
        use_pycups = True

    if fd or file:

Definition at line 345 of file cupspk.py.

00345 
00346     def getFile(self, *args, **kwds):
00347         ''' Keeping this as an alternative for the code.
00348             We don't use it because it's not possible to know if the call was a
00349             PK-one (and so we push the content of a temporary filename to fd or
00350             file) or a non-PK-one (in which case nothing should be done).
00351 
00352                 filename = None
00353                 fd = None
00354                 file = None
00355                 if use_pycups:
00356                     if len(kwds) != 1:
00357                         use_pycups = True
00358                     elif kwds.has_key('filename'):
00359                         filename = kwds['filename']
00360                     elif kwds.has_key('fd'):
00361                         fd = kwds['fd']
00362                     elif kwds.has_key('file'):
00363                         file = kwds['file']
00364                     else:
00365                         use_pycups = True
00366 
00367                     if fd or file:
00368         '''
00369 
00370         file_object = None
00371         fd = None
00372         if len(args) == 2:
00373             (use_pycups, resource, filename) = self._args_to_tuple([str, str], *args)
00374         else:
00375             (use_pycups, resource) = self._args_to_tuple([str], *args)
00376             if kwds.has_key('filename'):
00377                 filename = kwds['filename']
00378             elif kwds.has_key('fd'):
00379                 fd = kwds['fd']
00380             elif kwds.has_key('file'):
00381                 file_object = kwds['file']
00382             else:
00383                 if not use_pycups:
00384                     raise TypeError()
00385                 else:
00386                     filename = None
00387 
00388         if (not use_pycups) and (fd != None or file_object != None):
00389             # Create the temporary file in /tmp to ensure that
00390             # cups-pk-helper-mechanism is able to write to it.
00391             (tmpfd, tmpfname) = tempfile.mkstemp(dir="/tmp")
00392             os.close (tmpfd)
00393 
00394             pk_args = (resource, tmpfname)
00395             self._call_with_pk_and_fallback(use_pycups,
00396                                             'FileGet', pk_args,
00397                                             self._connection.getFile,
00398                                             *args, **kwds)
00399 
00400             tmpfd = os.open (tmpfname, os.O_RDONLY)
00401             tmpfile = os.fdopen (tmpfd, 'r')
00402             tmpfile.seek (0)
00403 
00404             if fd != None:
00405                 os.lseek (fd, 0, os.SEEK_SET)
00406                 line = tmpfile.readline()
00407                 while line != '':
00408                     os.write (fd, line)
00409                     line = tmpfile.readline()
00410             else:
00411                 file_object.seek (0)
00412                 line = tmpfile.readline()
00413                 while line != '':
00414                     file_object.write (line)
00415                     line = tmpfile.readline()
00416 
00417             tmpfile.close ()
00418             os.remove (tmpfname)
00419         else:
00420             pk_args = (resource, filename)
00421 
00422             self._call_with_pk_and_fallback(use_pycups,
00423                                             'FileGet', pk_args,
00424                                             self._connection.getFile,
00425                                             *args, **kwds)
00426 

Here is the call graph for this function:

def cupspk.Connection.putFile (   self,
  args,
  kwds 
)

Definition at line 427 of file cupspk.py.

00427 
00428     def putFile(self, *args, **kwds):
00429         if len(args) == 2:
00430             (use_pycups, resource, filename) = self._args_to_tuple([str, str], *args)
00431         else:
00432             (use_pycups, resource) = self._args_to_tuple([str], *args)
00433             if kwds.has_key('filename'):
00434                 filename = kwds['filename']
00435             elif kwds.has_key('fd'):
00436                 fd = kwds['fd']
00437             elif kwds.has_key('file'):
00438                 file_object = kwds['file']
00439             else:
00440                 if not use_pycups:
00441                     raise TypeError()
00442                 else:
00443                     filename = None
00444 
00445         if (not use_pycups) and (fd != None or file_object != None):
00446             (tmpfd, tmpfname) = tempfile.mkstemp()
00447             os.lseek (tmpfd, 0, os.SEEK_SET)
00448 
00449             if fd != None:
00450                 os.lseek (fd, 0, os.SEEK_SET)
00451                 buf = os.read (fd, 512)
00452                 while buf != '':
00453                     os.write (tmpfd, buf)
00454                     buf = os.read (fd, 512)
00455             else:
00456                 file_object.seek (0)
00457                 line = file_object.readline ()
00458                 while line != '':
00459                     os.write (tmpfd, line)
00460                     line = file_object.readline ()
00461 
00462             os.close (tmpfd)
00463 
00464             pk_args = (resource, tmpfname)
00465 
00466             self._call_with_pk_and_fallback(use_pycups,
00467                                             'FilePut', pk_args,
00468                                             self._connection.putFile,
00469                                             *args, **kwds)
00470 
00471             os.remove (tmpfname)
00472         else:
00473 
00474             pk_args = (resource, filename)
00475 
00476             self._call_with_pk_and_fallback(use_pycups,
00477                                             'FilePut', pk_args,
00478                                             self._connection.putFile,
00479                                             *args, **kwds)
00480 

Here is the call graph for this function:

def cupspk.Connection.rejectJobs (   self,
  args,
  kwds 
)

Definition at line 708 of file cupspk.py.

00708 
00709     def rejectJobs(self, *args, **kwds):
00710         (use_pycups, name) = self._args_to_tuple([str], *args)
00711         (reason,) = self._kwds_to_vars(['reason'], **kwds)
00712         pk_args = (name, False, reason)
00713 
00714         self._call_with_pk_and_fallback(use_pycups,
00715                                         'PrinterSetAcceptJobs', pk_args,
00716                                         self._connection.rejectJobs,
00717                                         *args, **kwds)
00718 
00719 
00720 #    printTestPage

Here is the call graph for this function:

def cupspk.Connection.restartJob (   self,
  args,
  kwds 
)

Definition at line 336 of file cupspk.py.

00336 
00337     def restartJob(self, *args, **kwds):
00338         (use_pycups, jobid) = self._args_to_tuple([int], *args)
00339         pk_args = (jobid, )
00340         
00341         self._call_with_pk_and_fallback(use_pycups,
00342                                         'JobRestart', pk_args,
00343                                         self._connection.restartJob,
00344                                         *args, **kwds)

Here is the call graph for this function:

def cupspk.Connection.set_parent (   self,
  parent 
)

Definition at line 84 of file cupspk.py.

00084 
00085     def set_parent(self, parent):
00086         self._parent = parent
00087 

def cupspk.Connection.setDefault (   self,
  args,
  kwds 
)

Definition at line 667 of file cupspk.py.

00667 
00668     def setDefault(self, *args, **kwds):
00669         (use_pycups, name) = self._args_to_tuple([str], *args)
00670         pk_args = (name,)
00671 
00672         self._call_with_pk_and_fallback(use_pycups,
00673                                         'PrinterSetDefault', pk_args,
00674                                         self._connection.setDefault,
00675                                         *args, **kwds)
00676 
00677 #    getPPD

Here is the call graph for this function:

def cupspk.Connection.setJobHoldUntil (   self,
  args,
  kwds 
)

Definition at line 327 of file cupspk.py.

00327 
00328     def setJobHoldUntil(self, *args, **kwds):
00329         (use_pycups, jobid, job_hold_until) = self._args_to_tuple([int, str], *args)
00330         pk_args = (jobid, job_hold_until, )
00331 
00332         self._call_with_pk_and_fallback(use_pycups,
00333                                         'JobSetHoldUntil', pk_args,
00334                                         self._connection.setJobHoldUntil,
00335                                         *args, **kwds)

Here is the call graph for this function:

def cupspk.Connection.setPrinterDevice (   self,
  args,
  kwds 
)

Definition at line 508 of file cupspk.py.

00508 
00509     def setPrinterDevice(self, *args, **kwds):
00510         (use_pycups, name, device) = self._args_to_tuple([str, str], *args)
00511         pk_args = (name, device)
00512 
00513         self._call_with_pk_and_fallback(use_pycups,
00514                                         'PrinterSetDevice', pk_args,
00515                                         self._connection.setPrinterDevice,
00516                                         *args, **kwds)
00517 

Here is the call graph for this function:

def cupspk.Connection.setPrinterErrorPolicy (   self,
  args,
  kwds 
)

Definition at line 558 of file cupspk.py.

00558 
00559     def setPrinterErrorPolicy(self, *args, **kwds):
00560         (use_pycups, name, policy) = self._args_to_tuple([str, str], *args)
00561         pk_args = (name, policy)
00562 
00563         self._call_with_pk_and_fallback(use_pycups,
00564                                         'PrinterSetErrorPolicy', pk_args,
00565                                         self._connection.setPrinterErrorPolicy,
00566                                         *args, **kwds)
00567 

Here is the call graph for this function:

def cupspk.Connection.setPrinterInfo (   self,
  args,
  kwds 
)

Definition at line 518 of file cupspk.py.

00518 
00519     def setPrinterInfo(self, *args, **kwds):
00520         (use_pycups, name, info) = self._args_to_tuple([str, str], *args)
00521         pk_args = (name, info)
00522 
00523         self._call_with_pk_and_fallback(use_pycups,
00524                                         'PrinterSetInfo', pk_args,
00525                                         self._connection.setPrinterInfo,
00526                                         *args, **kwds)
00527 

Here is the call graph for this function:

def cupspk.Connection.setPrinterJobSheets (   self,
  args,
  kwds 
)

Definition at line 548 of file cupspk.py.

00548 
00549     def setPrinterJobSheets(self, *args, **kwds):
00550         (use_pycups, name, start, end) = self._args_to_tuple([str, str, str], *args)
00551         pk_args = (name, start, end)
00552 
00553         self._call_with_pk_and_fallback(use_pycups,
00554                                         'PrinterSetJobSheets', pk_args,
00555                                         self._connection.setPrinterJobSheets,
00556                                         *args, **kwds)
00557 

Here is the call graph for this function:

def cupspk.Connection.setPrinterLocation (   self,
  args,
  kwds 
)

Definition at line 528 of file cupspk.py.

00528 
00529     def setPrinterLocation(self, *args, **kwds):
00530         (use_pycups, name, location) = self._args_to_tuple([str, str], *args)
00531         pk_args = (name, location)
00532 
00533         self._call_with_pk_and_fallback(use_pycups,
00534                                         'PrinterSetLocation', pk_args,
00535                                         self._connection.setPrinterLocation,
00536                                         *args, **kwds)
00537 

Here is the call graph for this function:

def cupspk.Connection.setPrinterOpPolicy (   self,
  args,
  kwds 
)

Definition at line 568 of file cupspk.py.

00568 
00569     def setPrinterOpPolicy(self, *args, **kwds):
00570         (use_pycups, name, policy) = self._args_to_tuple([str, str], *args)
00571         pk_args = (name, policy)
00572 
00573         self._call_with_pk_and_fallback(use_pycups,
00574                                         'PrinterSetOpPolicy', pk_args,
00575                                         self._connection.setPrinterOpPolicy,
00576                                         *args, **kwds)
00577 

Here is the call graph for this function:

def cupspk.Connection.setPrinterShared (   self,
  args,
  kwds 
)

Definition at line 538 of file cupspk.py.

00538 
00539     def setPrinterShared(self, *args, **kwds):
00540         (use_pycups, name, shared) = self._args_to_tuple([str, bool], *args)
00541         pk_args = (name, shared)
00542 
00543         self._call_with_pk_and_fallback(use_pycups,
00544                                         'PrinterSetShared', pk_args,
00545                                         self._connection.setPrinterShared,
00546                                         *args, **kwds)
00547 

Here is the call graph for this function:

def cupspk.Connection.setPrinterUsersAllowed (   self,
  args,
  kwds 
)

Definition at line 578 of file cupspk.py.

00578 
00579     def setPrinterUsersAllowed(self, *args, **kwds):
00580         (use_pycups, name, users) = self._args_to_tuple([str, list], *args)
00581         pk_args = (name, users)
00582 
00583         self._call_with_pk_and_fallback(use_pycups,
00584                                         'PrinterSetUsersAllowed', pk_args,
00585                                         self._connection.setPrinterUsersAllowed,
00586                                         *args, **kwds)
00587 

Here is the call graph for this function:

def cupspk.Connection.setPrinterUsersDenied (   self,
  args,
  kwds 
)

Definition at line 588 of file cupspk.py.

00588 
00589     def setPrinterUsersDenied(self, *args, **kwds):
00590         (use_pycups, name, users) = self._args_to_tuple([str, list], *args)
00591         pk_args = (name, users)
00592 
00593         self._call_with_pk_and_fallback(use_pycups,
00594                                         'PrinterSetUsersDenied', pk_args,
00595                                         self._connection.setPrinterUsersDenied,
00596                                         *args, **kwds)

Here is the call graph for this function:


Member Data Documentation

Definition at line 63 of file cupspk.py.

Definition at line 54 of file cupspk.py.

Definition at line 57 of file cupspk.py.

Definition at line 58 of file cupspk.py.


The documentation for this class was generated from the following file: