Changeset 3269

Show
Ignore:
Timestamp:
12/10/07 22:54:17 (17 years ago)
Author:
jerome
Message:

Doesn't reroute/deroute the CUPS print queue through PyKota anymore if its
Device URI can't be retrieved. Also logs a warning message in this case.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pkprinters

    r3260 r3269  
    156156            return cups.doRequest(req).printer["device-uri"][0][1] 
    157157        except :     
     158            self.printInfo(_("Impossible to retrieve %(printername)s's DeviceURI") % locals(), "warn") 
    158159            return "" 
    159160         
     
    168169        """Reroutes a CUPS printer through PyKota.""" 
    169170        uri = self.getPrinterDeviceURI(printer.Name) 
    170         if not self.isPrinterCaptured(deviceuri=uri) : 
     171        if uri and (not self.isPrinterCaptured(deviceuri=uri)) : 
    171172             newuri = "cupspykota://%s" % uri 
    172173             self.regainPriv() # to avoid having to enter password. 
     
    178179        """Deroutes a PyKota printer through CUPS only.""" 
    179180        uri = self.getPrinterDeviceURI(printer.Name) 
    180         if self.isPrinterCaptured(deviceuri=uri) : 
     181        if uri and self.isPrinterCaptured(deviceuri=uri) : 
    181182             newuri = uri.replace("cupspykota:", "") 
    182183             if newuri.startswith("//") :