Changeset 1759 for pykota/trunk/bin

Show
Ignore:
Timestamp:
09/30/04 13:22:30 (20 years ago)
Author:
jalet
Message:

Extends the PATH and doesn't use absolute path anymore to launch edpykota.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/autopykota

    r1758 r1759  
    2424# 
    2525# $Log$ 
     26# Revision 1.2  2004/09/30 11:22:30  jalet 
     27# Extends the PATH and doesn't use absolute path anymore to launch edpykota. 
     28# 
    2629# Revision 1.1  2004/09/30 09:52:45  jalet 
    2730# Initial release of autopykota. Reading help or manpage is greatly 
     
    8083    def main(self, arguments, options) : 
    8184        """Main entry point.""" 
     85        os.environ["PATH"] = "%s:/bin:/usr/bin:/usr/local/bin:/opt/bin" % os.environ.get("PATH", "") 
    8286        username = os.environ.get("PYKOTAUSERNAME") 
    8387        printername = os.environ.get("PYKOTAPRINTERNAME") 
     
    9599                    else :     
    96100                        self.logdebug("User %s already exists. Creating a quota entry for user %s on printer %s." % (username, username, printername)) 
    97                         return os.system('/usr/bin/edpykota --add --printer "%s" "%s"' % (printername, username)) 
     101                        return os.system('edpykota --add --printer "%s" "%s"' % (printername, username)) 
    98102                else : 
    99103                    self.logdebug("User %s already exists. Printer %s doesn't exist. Creating printer %s and a quota entry for user %s on printer %s." % (username, printername, printername, username, printername)) 
    100                     return os.system('/usr/bin/edpykota --add --printer "%s" "%s"' % (printername, username)) 
     104                    return os.system('edpykota --add --printer "%s" "%s"' % (printername, username)) 
    101105            else : 
    102106                if options["initbalance"] is None : 
     
    104108                else : 
    105109                    self.logdebug("User %s doesn't exist yet. Creating user %s's account and quota entries on all existing printers." % (username, username)) 
    106                     return os.system('/usr/bin/edpykota --add --limitby balance --balance "%s" "%s"' % (options["initbalance"], username)) 
     110                    return os.system('edpykota --add --limitby balance --balance "%s" "%s"' % (options["initbalance"], username)) 
    107111     
    108112if __name__ == "__main__" :