Changeset 3299

Show
Ignore:
Timestamp:
01/24/08 10:37:53 (16 years ago)
Author:
jerome
Message:

Temporary decoding solution for the output of pknotify.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r3298 r3299  
    301301            self.OriginalJobBillingCode = None 
    302302        else :     
    303             self.Ticket.BillingCode = self.UTF8ToUserCharset(self.Ticket.BillingCode) 
     303            self.Ticket.BillingCode = self.UTF8ToUserCharset(self.Ticket.BillingCode).decode("UTF-8") 
    304304            self.OriginalJobBillingCode = self.Ticket.BillingCode[:] 
    305305             
     
    416416                        action = "CANCEL" 
    417417                    elif line.startswith("USERNAME=") :     
    418                         username = self.userCharsetToUTF8(line.split("=", 1)[1].strip()) 
     418                        username = self.userCharsetToUTF8(line.split("=", 1)[1].strip()).decode("UTF-8") 
    419419                        self.logdebug("Seen new username [%s]" % username) 
    420420                    elif line.startswith("BILLINGCODE=") :     
    421                         billingcode = self.userCharsetToUTF8(line.split("=", 1)[1].strip()) 
     421                        billingcode = self.userCharsetToUTF8(line.split("=", 1)[1].strip()).decode("UTF-8") 
    422422                        self.logdebug("Seen new billing code [%s]" % billingcode) 
    423423                    elif line.startswith("REASON=") : 
    424                         reason = self.userCharsetToUTF8(line.split("=", 1)[1].strip()) 
     424                        reason = self.userCharsetToUTF8(line.split("=", 1)[1].strip()).decode("UTF-8") 
    425425                        self.logdebug("Seen new reason [%s]" % reason) 
    426426            except IOError, msg :             
     
    559559        setenv("PYKOTABALANCE", str(self.User.AccountBalance or 0.0), self.charset) 
    560560        setenv("PYKOTALIFETIMEPAID", str(self.User.LifeTimePaid or 0.0), self.charset) 
    561         setenv("PYKOTAUSERDESCRIPTION", str(self.User.Description or ""), self.charset) 
     561        setenv("PYKOTAUSERDESCRIPTION", self.User.Description or "", self.charset) 
    562562         
    563563        setenv("PYKOTAPAGECOUNTER", str(self.UserPQuota.PageCounter or 0), self.charset) 
     
    579579        # printer is a member of 
    580580        setenv("PYKOTAPGROUPS", ",".join([p.Name for p in self.storage.getParentPrinters(self.Printer)]), self.charset) 
    581         setenv("PYKOTAPRINTERDESCRIPTION", str(self.Printer.Description or ""), self.charset) 
     581        setenv("PYKOTAPRINTERDESCRIPTION", self.Printer.Description or "", self.charset) 
    582582        setenv("PYKOTAPRINTERMAXJOBSIZE", str(self.Printer.MaxJobSize or _("Unlimited")), self.charset) 
    583583        setenv("PYKOTAPRINTERPASSTHROUGHMODE", (self.Printer.PassThrough and _("ON")) or _("OFF"), self.charset) 
     
    602602        """Exports the job's action status and optional reason.""" 
    603603        self.logdebug("Exporting job's action status...") 
    604         setenv("PYKOTAACTION", str(self.Action), self.charset) 
     604        setenv("PYKOTAACTION", self.Action or "", self.charset) 
    605605        if self.Reason : 
    606             setenv("PYKOTAREASON", str(self.Reason), self.charset) 
     606            setenv("PYKOTAREASON", self.Reason or "", self.charset) 
    607607        self.logdebug("Environment updated.") 
    608608