Changeset 1761 for pykota/trunk/pykota/storages/ldapstorage.py
- Timestamp:
- 10/02/04 07:48:56 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/ldapstorage.py
r1754 r1761 22 22 # 23 23 # $Log$ 24 # Revision 1.78 2004/10/02 05:48:56 jalet 25 # Should now correctly deal with charsets both when storing into databases and when 26 # retrieving datas. Works with both PostgreSQL and LDAP. 27 # 24 28 # Revision 1.77 2004/09/28 14:29:00 jalet 25 29 # dumpykota for LDAP backend is almost there. … … 576 580 printer.PricePerPage = float(fields.get("pykotaPricePerPage", [0.0])[0] or 0.0) 577 581 printer.uniqueMember = fields.get("uniqueMember", []) 578 printer.Description = fields.get("description", [""])[0] 582 printer.Description = fields.get("description", [""])[0].decode("UTF-8").encode(self.tool.getCharset()) 579 583 printer.Exists = 1 580 584 return printer … … 677 681 lastjob.JobPrice = None 678 682 lastjob.JobAction = fields.get("pykotaAction", [""])[0] 679 lastjob.JobFileName = fields.get("pykotaFileName", [""])[0] 680 lastjob.JobTitle = fields.get("pykotaTitle", [""])[0] 683 lastjob.JobFileName = fields.get("pykotaFileName", [""])[0].decode("UTF-8").encode(self.tool.getCharset()) 684 lastjob.JobTitle = fields.get("pykotaTitle", [""])[0].decode("UTF-8").encode(self.tool.getCharset()) 681 685 lastjob.JobCopies = int(fields.get("pykotaCopies", [0])[0]) 682 lastjob.JobOptions = fields.get("pykotaOptions", [""])[0] 686 lastjob.JobOptions = fields.get("pykotaOptions", [""])[0].decode("UTF-8").encode(self.tool.getCharset()) 683 687 lastjob.JobHostName = fields.get("pykotaHostName", [""])[0] 684 688 lastjob.JobSizeBytes = fields.get("pykotaJobSizeBytes", [0L])[0] … … 753 757 printer.PricePerPage = float(fields.get("pykotaPricePerPage", [0.0])[0] or 0.0) 754 758 printer.uniqueMember = fields.get("uniqueMember", []) 755 printer.Description = fields.get("description", [""])[0] 759 printer.Description = fields.get("description", [""])[0].decode("UTF-8").encode(self.tool.getCharset()) 756 760 printer.Exists = 1 757 761 printers.append(printer) … … 965 969 """Write the printer's description back into the storage.""" 966 970 fields = { 967 "description" : str(printer.Description) ,971 "description" : str(printer.Description).decode(self.tool.getCharset()).encode("UTF-8"), 968 972 } 969 973 self.doModify(printer.ident, fields) … … 1064 1068 "pykotaPrinterPageCounter" : str(pagecounter), 1065 1069 "pykotaAction" : action, 1066 "pykotaFileName" : ((filename is None) and "None") or filename.decode( os.environ.get("CHARSET", "ISO-8859-15")).encode("UTF-8"),1067 "pykotaTitle" : ((title is None) and "None") or title.decode( os.environ.get("CHARSET", "ISO-8859-15")).encode("UTF-8"),1070 "pykotaFileName" : ((filename is None) and "None") or filename.decode(self.tool.getCharset()).encode("UTF-8"), 1071 "pykotaTitle" : ((title is None) and "None") or title.decode(self.tool.getCharset()).encode("UTF-8"), 1068 1072 "pykotaCopies" : str(copies), 1069 "pykotaOptions" : ((options is None) and "None") or options.decode( os.environ.get("CHARSET", "ISO-8859-15")).encode("UTF-8"),1073 "pykotaOptions" : ((options is None) and "None") or options.decode(self.tool.getCharset()).encode("UTF-8"), 1070 1074 "pykotaHostName" : str(clienthost), 1071 1075 "pykotaJobSizeBytes" : str(jobsizebytes), … … 1166 1170 job.JobPrice = None 1167 1171 job.JobAction = fields.get("pykotaAction", [""])[0] 1168 job.JobFileName = fields.get("pykotaFileName", [""])[0] 1169 job.JobTitle = fields.get("pykotaTitle", [""])[0] 1172 job.JobFileName = fields.get("pykotaFileName", [""])[0].decode("UTF-8").encode(self.tool.getCharset()) 1173 job.JobTitle = fields.get("pykotaTitle", [""])[0].decode("UTF-8").encode(self.tool.getCharset()) 1170 1174 job.JobCopies = int(fields.get("pykotaCopies", [0])[0]) 1171 job.JobOptions = fields.get("pykotaOptions", [""])[0] 1175 job.JobOptions = fields.get("pykotaOptions", [""])[0].decode("UTF-8").encode(self.tool.getCharset()) 1172 1176 job.JobHostName = fields.get("pykotaHostName", [""])[0] 1173 1177 job.JobSizeBytes = fields.get("pykotaJobSizeBytes", [0L])[0]