Changeset 1806 for pykota/trunk
- Timestamp:
- 10/12/04 10:58:53 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/warnpykota
r1803 r1806 24 24 # 25 25 # $Log$ 26 # Revision 1.33 2004/10/12 08:58:53 jalet 27 # Now warnpykota only warns users who have already printed, to not confuse 28 # users who have just opened their account. 29 # 26 30 # Revision 1.32 2004/10/11 22:53:05 jalet 27 31 # Postponed string interpolation to help message's output method … … 234 238 else : 235 239 for (user, userpquota) in self.storage.getPrinterUsersAndQuotas(printer, ugnames) : 236 self.warnUserPQuota(userpquota) 240 # we only want to warn users who have ever printed something 241 # and don't want to warn users who have never printed 242 if (user.AccountBalance and (user.AccountBalance != user.LifeTimePaid)) or \ 243 userpquota.PageCounter or userpquota.LifePageCounter or \ 244 self.storage.getUserNbJobsFromHistory(user) : 245 self.warnUserPQuota(userpquota) 237 246 238 247 if __name__ == "__main__" : -
pykota/trunk/NEWS
r1791 r1806 22 22 PyKota NEWS : 23 23 24 - 1.20alpha24 : 25 26 - Now warnpykota only warns users who have ever printed, 27 to not cause confusion to users who have just opened 28 their account. 29 30 - Prepared help messages for translations. 31 24 32 - 1.20alpha23 : 25 33 -
pykota/trunk/pykota/storages/ldapstorage.py
r1790 r1806 22 22 # 23 23 # $Log$ 24 # Revision 1.84 2004/10/12 08:58:53 jalet 25 # Now warnpykota only warns users who have already printed, to not confuse 26 # users who have just opened their account. 27 # 24 28 # Revision 1.83 2004/10/07 21:14:28 jalet 25 29 # Hopefully final fix for data encoding to and from the database … … 522 526 groupnames = [record[1]["pykotaGroupName"][0] for record in result] 523 527 return groupnames 528 529 def getUserNbJobsFromHistory(self, user) : 530 """Returns the number of jobs the user has in history.""" 531 result = self.doSearch("(&(pykotaUserName=%s)(objectClass=pykotaJob))" % user.Name, None, base=self.info["jobbase"]) 532 return len(result) 524 533 525 534 def getUserFromBackend(self, username) : -
pykota/trunk/pykota/storages/sql.py
r1792 r1806 22 22 # 23 23 # $Log$ 24 # Revision 1.58 2004/10/12 08:58:53 jalet 25 # Now warnpykota only warns users who have already printed, to not confuse 26 # users who have just opened their account. 27 # 24 28 # Revision 1.57 2004/10/10 10:12:21 jalet 25 29 # Improved SQL queries for groups. Same work has to be done for groups print quotas. … … 184 188 groupnames = [record["groupname"] for record in result] 185 189 return groupnames 190 191 def getUserNbJobsFromHistory(self, user) : 192 """Returns the number of jobs the user has in history.""" 193 result = self.doSearch("SELECT COUNT(*) FROM jobhistory WHERE userid=%s" % self.doQuote(user.ident)) 194 if result : 195 return result[0]["count"] 196 return 0 186 197 187 198 def getUserFromBackend(self, username) : -
pykota/trunk/pykota/version.py
r1791 r1806 22 22 # 23 23 24 __version__ = "1.20alpha2 3_unofficial"24 __version__ = "1.20alpha24_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""