Changeset 1777 for pykota/trunk/pykota/storages/ldapstorage.py
- Timestamp:
- 10/05/04 11:59:20 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/ldapstorage.py
r1768 r1777 22 22 # 23 23 # $Log$ 24 # Revision 1.82 2004/10/05 09:59:20 jalet 25 # Restore compatibility with Python 2.1 26 # 24 27 # Revision 1.81 2004/10/04 11:27:57 jalet 25 28 # Finished LDAP support for dumpykota. … … 589 592 printer.PricePerPage = float(fields.get("pykotaPricePerPage", [0.0])[0] or 0.0) 590 593 printer.uniqueMember = fields.get("uniqueMember", []) 591 printer.Description = fields.get("description", [""])[0].decode("UTF-8").encode(self.tool.getCharset())594 printer.Description = unicode(fields.get("description", [""])[0], "UTF-8").encode(self.tool.getCharset()) 592 595 printer.Exists = 1 593 596 return printer … … 690 693 lastjob.JobPrice = None 691 694 lastjob.JobAction = fields.get("pykotaAction", [""])[0] 692 lastjob.JobFileName = fields.get("pykotaFileName", [""])[0].decode("UTF-8").encode(self.tool.getCharset())693 lastjob.JobTitle = fields.get("pykotaTitle", [""])[0].decode("UTF-8").encode(self.tool.getCharset())695 lastjob.JobFileName = unicode(fields.get("pykotaFileName", [""])[0], "UTF-8").encode(self.tool.getCharset()) 696 lastjob.JobTitle = unicode(fields.get("pykotaTitle", [""])[0], "UTF-8").encode(self.tool.getCharset()) 694 697 lastjob.JobCopies = int(fields.get("pykotaCopies", [0])[0]) 695 lastjob.JobOptions = fields.get("pykotaOptions", [""])[0].decode("UTF-8").encode(self.tool.getCharset())698 lastjob.JobOptions = unicode(fields.get("pykotaOptions", [""])[0], "UTF-8").encode(self.tool.getCharset()) 696 699 lastjob.JobHostName = fields.get("pykotaHostName", [""])[0] 697 700 lastjob.JobSizeBytes = fields.get("pykotaJobSizeBytes", [0L])[0] … … 766 769 printer.PricePerPage = float(fields.get("pykotaPricePerPage", [0.0])[0] or 0.0) 767 770 printer.uniqueMember = fields.get("uniqueMember", []) 768 printer.Description = fields.get("description", [""])[0].decode("UTF-8").encode(self.tool.getCharset())771 printer.Description = unicode(fields.get("description", [""])[0], "UTF-8").encode(self.tool.getCharset()) 769 772 printer.Exists = 1 770 773 printers.append(printer) … … 978 981 """Write the printer's description back into the storage.""" 979 982 fields = { 980 "description" : str(printer.Description).decode(self.tool.getCharset()).encode("UTF-8"),983 "description" : unicode(str(printer.Description), self.tool.getCharset()).encode("UTF-8"), 981 984 } 982 985 self.doModify(printer.ident, fields) … … 1077 1080 "pykotaPrinterPageCounter" : str(pagecounter), 1078 1081 "pykotaAction" : action, 1079 "pykotaFileName" : ((filename is None) and "None") or filename.decode(self.tool.getCharset()).encode("UTF-8"),1080 "pykotaTitle" : ((title is None) and "None") or title.decode(self.tool.getCharset()).encode("UTF-8"),1082 "pykotaFileName" : ((filename is None) and "None") or unicode(filename, self.tool.getCharset()).encode("UTF-8"), 1083 "pykotaTitle" : ((title is None) and "None") or unicode(title, self.tool.getCharset()).encode("UTF-8"), 1081 1084 "pykotaCopies" : str(copies), 1082 "pykotaOptions" : ((options is None) and "None") or options.decode(self.tool.getCharset()).encode("UTF-8"),1085 "pykotaOptions" : ((options is None) and "None") or unicode(options, self.tool.getCharset()).encode("UTF-8"), 1083 1086 "pykotaHostName" : str(clienthost), 1084 1087 "pykotaJobSizeBytes" : str(jobsizebytes), … … 1179 1182 job.JobPrice = None 1180 1183 job.JobAction = fields.get("pykotaAction", [""])[0] 1181 job.JobFileName = fields.get("pykotaFileName", [""])[0].decode("UTF-8").encode(self.tool.getCharset())1182 job.JobTitle = fields.get("pykotaTitle", [""])[0].decode("UTF-8").encode(self.tool.getCharset())1184 job.JobFileName = unicode(fields.get("pykotaFileName", [""])[0], "UTF-8").encode(self.tool.getCharset()) 1185 job.JobTitle = unicode(fields.get("pykotaTitle", [""])[0], "UTF-8").encode(self.tool.getCharset()) 1183 1186 job.JobCopies = int(fields.get("pykotaCopies", [0])[0]) 1184 job.JobOptions = fields.get("pykotaOptions", [""])[0].decode("UTF-8").encode(self.tool.getCharset())1187 job.JobOptions = unicode(fields.get("pykotaOptions", [""])[0], "UTF-8").encode(self.tool.getCharset()) 1185 1188 job.JobHostName = fields.get("pykotaHostName", [""])[0] 1186 1189 job.JobSizeBytes = fields.get("pykotaJobSizeBytes", [0L])[0]