Changeset 748 for pykota/trunk
- Timestamp:
- 02/07/03 23:13:13 (22 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/edpykota
r720 r748 17 17 # 18 18 # $Log$ 19 # Revision 1.6 2003/02/07 22:13:13 jalet 20 # Perhaps edpykota is now able to add printers !!! Oh, stupid me ! 21 # 19 22 # Revision 1.5 2003/02/06 14:49:04 jalet 20 23 # edpykota should be ok now … … 120 123 printernames = self.storage.getMatchingPrinters(options["printer"]) 121 124 if not printernames : 122 raise PyKotaToolError, "There's no printer matching %s" % options["printer"] 125 if options["add"] and options["printer"] and options["printer"].isalpha() : 126 self.storage.addPrinter(options["printer"]) 127 else : 128 raise PyKotaToolError, "There's no printer matching %s" % options["printer"] 123 129 softlimit = hardlimit = None 124 130 if options["softlimit"] : -
pykota/trunk/pykota/storages/sql.py
r732 r748 15 15 # 16 16 # $Log$ 17 # Revision 1.14 2003/02/07 22:13:13 jalet 18 # Perhaps edpykota is now able to add printers !!! Oh, stupid me ! 19 # 17 20 # Revision 1.13 2003/02/07 00:08:52 jalet 18 21 # Typos … … 78 81 return printerslist 79 82 83 def addPrinter(self, printername) : 84 """Adds a printer to the quota storage.""" 85 self.doQuery("INSERT INTO printers (printername) VALUES (%s);" % self.doQuote(printername)) 86 80 87 def getPrinterUsers(self, printername) : 81 88 """Returns the list of usernames which uses a given printer.""" … … 127 134 (userid, printerid) = self.getUPIds(username, printername) 128 135 if printerid is None : 129 self. doQuery("INSERT INTO printers (printername) VALUES (%s);" % self.doQuote(printername))136 self.addPrinter(printername) # should we still add it ? 130 137 if userid is None : 131 138 self.doQuery("INSERT INTO users (username) VALUES (%s);" % self.doQuote(username))