Changeset 3547

Show
Ignore:
Timestamp:
08/17/10 03:08:14 (14 years ago)
Author:
jerome
Message:

Major (temporary ?) fix for a very old bug : the job options were
retrieved from the command line, and automatically converted to unicode
when cupspykota started. All other job attributes were retrieved from a
getJobAttributes() request to CUPS, and returned in utf-8. When looping
over all job attributes (including options) there was a character
encoding mismatch cause the cupspykota backend to fail miserably.
This fix may be improved later.

Location:
pykota/trunk/pykota
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/cups.py

    r3498 r3547  
    8686            self.OriginatingUserName = self.OriginatingUserName.split("@", 1)[0].split("/")[0] 
    8787 
     88        # The options weren't retrieved from the job ticket but from the 
     89        # command line instead, so they already are in unicode form. 
     90        # That's why we convert them back to the ticket's charset. 
     91        try : 
     92            self.Options = self.Options.encode(self.Charset, "replace") 
     93        except AttributeError : 
     94            pass 
     95 
    8896        for attrib in ("OriginatingUserName", 
    8997                       "OriginatingHostName", 
  • pykota/trunk/pykota/version.py

    r3545 r3547  
    2424import time 
    2525 
    26 __version__ = "1.27alpha11_unofficial" 
     26__version__ = "1.27alpha12_unofficial" 
    2727 
    2828__doc__ = "PyKota : a complete Printing Quota Solution for CUPS."