Changeset 3306

Show
Ignore:
Timestamp:
01/30/08 13:56:28 (16 years ago)
Author:
jerome
Message:

Fixed some character encoding problems when CUPS' locale was not C : my
earlier tests didn't take this into account.

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r3300 r3306  
    580580        setenv("PYKOTAPGROUPS", ",".join([p.Name for p in self.storage.getParentPrinters(self.Printer)]), self.charset) 
    581581        setenv("PYKOTAPRINTERDESCRIPTION", self.Printer.Description or "", self.charset) 
    582         setenv("PYKOTAPRINTERMAXJOBSIZE", str(self.Printer.MaxJobSize or _("Unlimited")), self.charset) 
     582        setenv("PYKOTAPRINTERMAXJOBSIZE", ((self.Printer.MaxJobSize is None) and _("Unlimited")) or str(self.Printer.MaxJobSize), self.charset) 
    583583        setenv("PYKOTAPRINTERPASSTHROUGHMODE", (self.Printer.PassThrough and _("ON")) or _("OFF"), self.charset) 
    584584        setenv("PYKOTAPRICEPERPAGE", str(self.Printer.PricePerPage or 0), self.charset) 
  • pykota/trunk/pykota/loggers/system.py

    r3275 r3306  
    2323"""This module defines a class for PyKota logging through syslog.""" 
    2424 
     25import sys 
    2526import os 
    2627import syslog 
     
    4748                           syslog.LOG_DEBUG) 
    4849        syslog.syslog(priority, "(PID %s) : %s" \ 
    49                                       % (os.getpid(), message.strip())) 
     50                                      % (os.getpid(), message.strip().encode(sys.stdout.encoding or "UTF-8", "replace")))