Changeset 720

Show
Ignore:
Timestamp:
02/06/03 15:49:04 (22 years ago)
Author:
jalet
Message:

edpykota should be ok now

Location:
pykota/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/edpykota

    r719 r720  
    1717# 
    1818# $Log$ 
     19# Revision 1.5  2003/02/06 14:49:04  jalet 
     20# edpykota should be ok now 
     21# 
    1922# Revision 1.4  2003/02/06 14:28:59  jalet 
    2023# edpykota should be ok, minus some typos 
     
    185188         
    186189        # Initializes the command line tool 
    187         tool = EdPyKota(doc=__doc__) 
     190        editor = EdPyKota(doc=__doc__) 
    188191         
    189192        # 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) 
    191194         
    192195        # sets long options 
     
    197200        options["groups"] = options["g"] or options["groups"] or defaults["groups"] 
    198201        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"] 
    200203        options["softlimit"] = options["S"] or options["softlimit"] 
    201204        options["hardlimit"] = options["H"] or options["hardlimit"]  
    202205         
    203206        if options["help"] : 
    204             tool.display_usage_and_quit() 
     207            editor.display_usage_and_quit() 
    205208        elif options["version"] : 
    206             tool.display_version_and_quit() 
     209            editor.display_version_and_quit() 
    207210        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 optiions["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." 
    211214        elif options["groups"] :     
    212             raise PyKotaToolError, "edpykota: options --groups is currently not implemented.\n" 
     215            raise PyKotaToolError, "edpykota: options --groups is currently not implemented." 
    213216        else : 
    214             sys.exit(apply(tool.main, args, options)) 
     217            sys.exit(editor.main(args, options)) 
    215218    except PyKotaToolError, msg :             
    216219        sys.stderr.write("%s\n" % msg) 
  • pykota/trunk/pykota/storages/postgresql.py

    r700 r720  
    1515# 
    1616# $Log$ 
     17# Revision 1.3  2003/02/06 14:49:04  jalet 
     18# edpykota should be ok now 
     19# 
    1720# Revision 1.2  2003/02/05 22:28:38  jalet 
    1821# More robust storage 
     
    6265    def doParseResult(self, result) : 
    6366        """Returns the result as a list of Python mappings.""" 
    64         if result.ntuples() > 0 : 
     67        if (result is not None) and (result.ntuples() > 0) : 
    6568            return result.dictresult() 
    6669         
  • pykota/trunk/pykota/storages/sql.py

    r719 r720  
    1515# 
    1616# $Log$ 
     17# Revision 1.8  2003/02/06 14:49:04  jalet 
     18# edpykota should be ok now 
     19# 
    1720# Revision 1.7  2003/02/06 14:28:59  jalet 
    1821# edpykota should be ok, minus some typos 
     
    5053        # storage should use fnmatch to match patterns and be storage agnostic 
    5154        result = self.doQuery("SELECT printername FROM printers;") 
    52         result = self.doParseResult() 
     55        result = self.doParseResult(result) 
    5356        if result is not None : 
    5457            for printer in result :