Back to index

system-config-printer  1.3.9+20120706
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
scp-dbus-service.GetBestDriversRequest Class Reference

List of all members.

Public Member Functions

def __init__
def __del__

Public Attributes

 device_id
 device_make_and_model
 device_uri
 reply_handler
 error_handler

Private Member Functions

def _disconnect_signals
def _ppds_error
def _ppds_ready

Private Attributes

 _signals

Detailed Description

Definition at line 122 of file scp-dbus-service.py.


Constructor & Destructor Documentation

def scp-dbus-service.GetBestDriversRequest.__init__ (   self,
  device_id,
  device_make_and_model,
  device_uri,
  cupsconn,
  language,
  reply_handler,
  error_handler 
)

Definition at line 124 of file scp-dbus-service.py.

00124 
00125                   cupsconn, language, reply_handler, error_handler):
00126         self.device_id = device_id
00127         self.device_make_and_model = device_make_and_model
00128         self.device_uri = device_uri
00129         self.reply_handler = reply_handler
00130         self.error_handler = error_handler
00131         self._signals = []
00132         debugprint ("+%s" % self)
00133 
00134         g_killtimer.add_hold ()
00135         global g_ppds
00136         if g_ppds == None:
00137             debugprint ("GetBestDrivers request: need to fetch PPDs")
00138             g_ppds = FetchedPPDs (cupsconn, language)
00139             self._signals.append (g_ppds.connect ('ready', self._ppds_ready))
00140             self._signals.append (g_ppds.connect ('error', self._ppds_error))
00141             g_ppds.run ()
00142         else:
00143             if g_ppds.is_ready ():
00144                 debugprint ("GetBestDrivers request: PPDs already fetched")
00145                 self._ppds_ready (g_ppds)
00146             else:
00147                 debugprint ("GetBestDrivers request: waiting for PPDs")
00148                 self._signals.append (g_ppds.connect ('ready',
00149                                                       self._ppds_ready))
00150                 self._signals.append (g_ppds.connect ('error',
00151                                                       self._ppds_error))

def scp-dbus-service.GetBestDriversRequest.__del__ (   self)

Definition at line 152 of file scp-dbus-service.py.

00152 
00153     def __del__ (self):
00154         debugprint ("-%s" % self)


Member Function Documentation

def scp-dbus-service.GetBestDriversRequest._disconnect_signals (   self) [private]

Definition at line 155 of file scp-dbus-service.py.

00155 
00156     def _disconnect_signals (self):
00157         for s in self._signals:
00158             g_ppds.disconnect (s)

Here is the caller graph for this function:

def scp-dbus-service.GetBestDriversRequest._ppds_error (   self,
  fetchedppds,
  exc 
) [private]

Definition at line 159 of file scp-dbus-service.py.

00159 
00160     def _ppds_error (self, fetchedppds, exc):
00161         self._disconnect_signals ()
00162         self.error_handler (exc)

Here is the call graph for this function:

def scp-dbus-service.GetBestDriversRequest._ppds_ready (   self,
  fetchedppds 
) [private]

Definition at line 163 of file scp-dbus-service.py.

00163 
00164     def _ppds_ready (self, fetchedppds):
00165         self._disconnect_signals ()
00166         ppds = fetchedppds.get_ppds ()
00167 
00168         try:
00169             if self.device_id:
00170                 id_dict = cupshelpers.parseDeviceID (self.device_id)
00171             else:
00172                 id_dict = {}
00173                 (mfg,
00174                  mdl) = cupshelpers.ppds.ppdMakeModelSplit (self.device_make_and_model)
00175                 id_dict["MFG"] = mfg
00176                 id_dict["MDL"] = mdl
00177                 id_dict["DES"] = ""
00178                 id_dict["CMD"] = []
00179 
00180             fit = ppds.getPPDNamesFromDeviceID (id_dict["MFG"],
00181                                                 id_dict["MDL"],
00182                                                 id_dict["DES"],
00183                                                 id_dict["CMD"],
00184                                                 self.device_uri,
00185                                                 self.device_make_and_model)
00186 
00187             ppdnamelist = ppds.orderPPDNamesByPreference (fit.keys ())
00188 
00189             g_killtimer.remove_hold ()
00190             self.reply_handler (map (lambda x: (x, fit[x]), ppdnamelist))
00191         except Exception, e:
00192             try:
00193                 g_killtimer.remove_hold ()
00194             except:
00195                 pass
00196 
00197             self.error_handler (e)

Here is the call graph for this function:


Member Data Documentation

scp-dbus-service.GetBestDriversRequest._signals [private]

Definition at line 130 of file scp-dbus-service.py.

scp-dbus-service.GetBestDriversRequest.device_id

Definition at line 125 of file scp-dbus-service.py.

scp-dbus-service.GetBestDriversRequest.device_make_and_model

Definition at line 126 of file scp-dbus-service.py.

scp-dbus-service.GetBestDriversRequest.device_uri

Definition at line 127 of file scp-dbus-service.py.

scp-dbus-service.GetBestDriversRequest.error_handler

Definition at line 129 of file scp-dbus-service.py.

scp-dbus-service.GetBestDriversRequest.reply_handler

Definition at line 128 of file scp-dbus-service.py.


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