Changeset 699 for pykota/trunk/bin
- Timestamp:
- 02/05/03 23:16:20 (22 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pykota
r695 r699 17 17 # 18 18 # $Log$ 19 # Revision 1.2 2003/02/05 22:16:20 jalet 20 # DEVICE_URI is undefined outside of CUPS, i.e. for normal command line tools 21 # 19 22 # Revision 1.1 2003/02/05 21:28:17 jalet 20 23 # Initial import into CVS … … 34 37 self.username = username 35 38 self.requester = requester.openRequester(self.config, self.printername) 39 self.printerhostname = self.getPrinterHostname() 36 40 41 def getPrinterHostname(self) : 42 """Returns the printer hostname.""" 43 device_uri = os.environ.get("DEVICE_URI", "") 44 # TODO : check this for more complex urls than ipp://myprinter.dot.com:631/printers/lp 45 try : 46 (backend, destination) = device_uri.split(":", 1) 47 except ValueError : 48 raise PyKotaToolError, "Invalid DEVICE_URI : %s\n" % device_uri 49 while destination.startswith("/") : 50 destination = destination[1:] 51 return destination.split("/")[0].split(":")[0] 52 37 53 def filterInput(self, inputfile) : 38 54 """Transparent filter."""