Changeset 720
- Timestamp:
- 02/06/03 15:49:04 (22 years ago)
- Location:
- pykota/trunk
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/edpykota
r719 r720 17 17 # 18 18 # $Log$ 19 # Revision 1.5 2003/02/06 14:49:04 jalet 20 # edpykota should be ok now 21 # 19 22 # Revision 1.4 2003/02/06 14:28:59 jalet 20 23 # edpykota should be ok, minus some typos … … 185 188 186 189 # Initializes the command line tool 187 tool= EdPyKota(doc=__doc__)190 editor = EdPyKota(doc=__doc__) 188 191 189 192 # parse and checks the command line 190 (options, args) = tool.parseCommandline(sys.argv[1:], short_options, long_options)193 (options, args) = editor.parseCommandline(sys.argv[1:], short_options, long_options) 191 194 192 195 # sets long options … … 197 200 options["groups"] = options["g"] or options["groups"] or defaults["groups"] 198 201 options["prototype"] = options["p"] or options["prototype"] 199 options["printer"] = options["P"] or options["printer"] 202 options["printer"] = options["P"] or options["printer"] or defaults["printer"] 200 203 options["softlimit"] = options["S"] or options["softlimit"] 201 204 options["hardlimit"] = options["H"] or options["hardlimit"] 202 205 203 206 if options["help"] : 204 tool.display_usage_and_quit()207 editor.display_usage_and_quit() 205 208 elif options["version"] : 206 tool.display_version_and_quit()209 editor.display_version_and_quit() 207 210 elif options["users"] and options["groups"] : 208 raise PyKotaToolError, "edpykota: options --users and --groups are incompatible. \n"209 elif (options["softlimit"] or options["hardlimit"]) and opti ions["prototype"] :210 raise PyKotaToolError, "edpykota: options --softlimit or --hardlimit and --prototype are incompatible. \n"211 raise PyKotaToolError, "edpykota: options --users and --groups are incompatible." 212 elif (options["softlimit"] or options["hardlimit"]) and options["prototype"] : 213 raise PyKotaToolError, "edpykota: options --softlimit or --hardlimit and --prototype are incompatible." 211 214 elif options["groups"] : 212 raise PyKotaToolError, "edpykota: options --groups is currently not implemented. \n"215 raise PyKotaToolError, "edpykota: options --groups is currently not implemented." 213 216 else : 214 sys.exit( apply(tool.main,args, options))217 sys.exit(editor.main(args, options)) 215 218 except PyKotaToolError, msg : 216 219 sys.stderr.write("%s\n" % msg) -
pykota/trunk/pykota/storages/postgresql.py
r700 r720 15 15 # 16 16 # $Log$ 17 # Revision 1.3 2003/02/06 14:49:04 jalet 18 # edpykota should be ok now 19 # 17 20 # Revision 1.2 2003/02/05 22:28:38 jalet 18 21 # More robust storage … … 62 65 def doParseResult(self, result) : 63 66 """Returns the result as a list of Python mappings.""" 64 if result.ntuples() > 0:67 if (result is not None) and (result.ntuples() > 0) : 65 68 return result.dictresult() 66 69 -
pykota/trunk/pykota/storages/sql.py
r719 r720 15 15 # 16 16 # $Log$ 17 # Revision 1.8 2003/02/06 14:49:04 jalet 18 # edpykota should be ok now 19 # 17 20 # Revision 1.7 2003/02/06 14:28:59 jalet 18 21 # edpykota should be ok, minus some typos … … 50 53 # storage should use fnmatch to match patterns and be storage agnostic 51 54 result = self.doQuery("SELECT printername FROM printers;") 52 result = self.doParseResult( )55 result = self.doParseResult(result) 53 56 if result is not None : 54 57 for printer in result :