Changeset 1068 for pykota/trunk
- Timestamp:
- 07/07/03 13:49:24 (21 years ago)
- Location:
- pykota/trunk
- Files:
-
- 14 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/NEWS
r1067 r1068 22 22 PyKota NEWS : 23 23 24 - 1.13 : 25 26 - The whole module code was passed through PyChecker and 27 several small code inconsistencies were fixed, 28 as well as a bug in the groups code. 29 24 30 - 1.13alpha1 : 25 31 -
pykota/trunk/pykota/accounters/external.py
r1041 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.5 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.4 2003/06/25 14:10:01 jalet 24 27 # Hey, it may work (edpykota --reset excepted) ! … … 88 91 89 92 # launches external accounter 90 infilename = tempfile.mktemp() 91 outfilename = tempfile.mktemp() 92 errfilename = tempfile.mktemp() 93 try : 94 infilename = tempfile.mkstemp() # Python 2.3 95 except AttributeError : 96 infilename = tempfile.mktemp() 97 try : 98 outfilename = tempfile.mkstemp() # Python 2.3 99 except AttributeError : 100 outfilename = tempfile.mktemp() 101 try : 102 errfilename = tempfile.mkstemp() # Python 2.3 103 except AttributeError : 104 errfilename = tempfile.mktemp() 93 105 94 106 try : -
pykota/trunk/pykota/accounters/querying.py
r1041 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.5 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.4 2003/06/25 14:10:01 jalet 24 27 # Hey, it may work (edpykota --reset excepted) ! … … 70 73 if not printer.LastJob.Exists : 71 74 # The printer hasn't been used yet, from PyKota's point of view 72 lastjob = None73 75 lastuser = user 74 76 lastpagecounter = counterbeforejob 75 77 else : 76 78 # get last values from Quota Storage 77 lastjob = printer.LastJob78 79 lastuser = printer.LastJob.User 79 80 lastpagecounter = printer.LastJob.PrinterPageCounter -
pykota/trunk/pykota/config.py
r1041 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.31 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.30 2003/06/25 14:10:01 jalet 24 27 # Hey, it may work (edpykota --reset excepted) ! … … 142 145 # 143 146 144 import sys145 147 import os 146 148 import ConfigParser -
pykota/trunk/pykota/logger.py
r1021 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.8 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.7 2003/06/10 16:37:54 jalet 24 27 # Deletion of the second user which is not needed anymore. … … 50 53 # 51 54 52 import sys53 54 55 class PyKotaLoggingError(Exception): 55 56 """An exception for logging related stuff.""" -
pykota/trunk/pykota/loggers/system.py
r952 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.7 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.6 2003/04/23 22:13:57 jalet 24 27 # Preliminary support for LPRng added BUT STILL UNTESTED. … … 44 47 # 45 48 46 import sys47 49 import syslog 48 50 -
pykota/trunk/pykota/reporters/text.py
r1062 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.4 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.3 2003/07/05 07:46:50 jalet 24 27 # The previous bug fix was incomplete. … … 32 35 # 33 36 # 34 35 import sys36 37 37 38 from mx import DateTime -
pykota/trunk/pykota/requester.py
r952 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.8 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.7 2003/04/23 22:13:57 jalet 24 27 # Preliminary support for LPRng added BUT STILL UNTESTED. … … 68 71 raise PyKotaRequesterError, _("Unsupported requester backend %s") % backend 69 72 else : 70 return getattr(requesterbackend, "Requester")( config,printername, args)73 return getattr(requesterbackend, "Requester")(printername, args) -
pykota/trunk/pykota/requesters/external.py
r952 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.8 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.7 2003/04/23 22:13:57 jalet 24 27 # Preliminary support for LPRng added BUT STILL UNTESTED. … … 53 56 class Requester : 54 57 """A class to send queries to printers via external commands.""" 55 def __init__(self, config,printername, arguments) :58 def __init__(self, printername, arguments) : 56 59 """Sets instance vars depending on the current printer.""" 57 60 self.printername = printername -
pykota/trunk/pykota/requesters/snmp.py
r999 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.11 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.10 2003/05/22 12:56:06 jalet 24 27 # Uses SNMP version 1 instead of version 2c by default, which is probably … … 66 69 class Requester : 67 70 """A class to send queries to printers via SNMP.""" 68 def __init__(self, config,printername, arguments) :71 def __init__(self, printername, arguments) : 69 72 """Sets instance vars depending on the current printer.""" 70 73 self.printername = printername -
pykota/trunk/pykota/storages/ldapstorage.py
r1067 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.15 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.14 2003/07/07 08:33:18 jalet 24 27 # Bug fix due to a typo in LDAP code … … 425 428 for (groupquotaid, fields) in result : 426 429 group = self.getGroup(fields.get("pykotaGroupName")[0]) 427 if (names is None) or self.tool.matchString( user.Name, names) :430 if (names is None) or self.tool.matchString(group.Name, names) : 428 431 grouppquota = self.getGroupPQuota(group, printer) 429 432 groupsandquotas.append((group, grouppquota)) -
pykota/trunk/pykota/storages/pgstorage.py
r1067 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.6 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.5 2003/07/07 08:33:19 jalet 24 27 # Bug fix due to a typo in LDAP code … … 126 129 except pg.error, msg : 127 130 raise PyKotaStorageError, msg 131 else : 132 return result 128 133 129 134 def doQuote(self, field) : … … 329 334 def addUserToGroup(self, user, group) : 330 335 """Adds an user to a group.""" 331 result = self.do Modify("SELECT COUNT(*) AS mexists FROM groupsmembers WHERE groupid=%s AND userid=%s" % (self.doQuote(group.ident), self.doQuote(user.ident)))336 result = self.doSearch("SELECT COUNT(*) AS mexists FROM groupsmembers WHERE groupid=%s AND userid=%s" % (self.doQuote(group.ident), self.doQuote(user.ident))) 332 337 try : 333 mexists = self.doParseResult(result)[0]["mexists"]334 except TypeError:338 mexists = int(result[0].get("mexists")) 339 except (IndexError, TypeError) : 335 340 mexists = 0 336 341 if not mexists : -
pykota/trunk/pykota/tool.py
r1061 r1068 21 21 # 22 22 # $Log$ 23 # Revision 1.44 2003/07/07 11:49:24 jalet 24 # Lots of small fixes with the help of PyChecker 25 # 23 26 # Revision 1.43 2003/07/04 09:06:32 jalet 24 27 # Small bug fix wrt undefined "LimitBy" field. … … 181 184 182 185 import sys 183 import os184 186 import fnmatch 185 187 import getopt … … 458 460 adminmail = self.config.getAdminMail(printer.Name) 459 461 mailto = self.config.getMailTo(printer.Name) 460 action = self.checkGroupPQuota(grouppquota , printer)462 action = self.checkGroupPQuota(grouppquota) 461 463 if action.startswith("POLICY_") : 462 464 action = action[7:] -
pykota/trunk/pykota/version.py
r1067 r1068 21 21 # 22 22 23 __version__ = "1.13 alpha1_unofficial"23 __version__ = "1.13_unofficial" 24 24 25 25 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""