Changeset 3045

Show
Ignore:
Timestamp:
10/17/06 14:28:56 (18 years ago)
Author:
jerome
Message:

Added a patch by Andrew Ross from Parakeet Print Quota.

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/CREDITS

    r3004 r3045  
    7373  - Baris Cicek - Turkish translation. 
    7474  - Kanakorn Horsiritham - Wrote phpPykotaAdmin. 
    75   - Tsang Yu Pong, Teddy - PHC Wing Kwong College - Chinese (Trad.) translation  
    76   - Marcus Fl�o de Lima - Universidade Federal de Minas Gerais : Brazilian PyKota+LDAP Documentation 
     75  - Tsang Yu Pong, Teddy - PHC Wing Kwong College - Chinese (Trad.) translation 
     76  - Marcus Fl�o de Lima - Universidade Federal de Minas Gerais :  
     77    Brazilian PyKota+LDAP Documentation 
    7778  - Rong-En Fan - Helped improve the PJL stuff. 
    7879  - Michal Dobroczynski - Polish translation. 
     
    8182  - Brandon Holbrook - Mississipi State University : improved waitprinter.sh 
    8283  - Brian Glogower - Worked on gnuplot scripts 
     84  - Andrew Ross - Parakeet Print Quota : Provided a patch to allow the 
     85    configuration files directory to be set at run time. 
    8386 
    8487============================================================== 
  • pykota/trunk/pykota/tool.py

    r3020 r3045  
    162162    def deferredInit(self) :         
    163163        """Deferred initialization.""" 
    164         # try to find the configuration files in user's 'pykota' home directory. 
    165         try : 
    166             self.pykotauser = pwd.getpwnam("pykota") 
    167         except KeyError :     
    168             self.pykotauser = None 
    169             confdir = "/etc/pykota" 
    170             missingUser = 1 
    171         else :     
    172             confdir = self.pykotauser[5] 
    173             missingUser = 0 
     164        confdir = os.environ.get("PYKOTA_HOME") 
     165        environHome = True 
     166        missingUser = False 
     167        if confdir is None : 
     168            environHome = False 
     169            # check for config files in the 'pykota' user's home directory. 
     170            try : 
     171                self.pykotauser = pwd.getpwnam("pykota") 
     172                confdir = self.pykotauser[5] 
     173            except KeyError :     
     174                self.pykotauser = None 
     175                confdir = "/etc/pykota" 
     176                missingUser = True 
    174177             
    175178        self.config = config.PyKotaConfig(confdir) 
     
    188191        if self.defaultToCLocale : 
    189192            self.printInfo("Incorrect locale settings. PyKota falls back to the default locale.", "warn") 
    190         if missingUser :      
    191             self.printInfo("The 'pykota' system account is missing. Configuration files were searched in /etc/pykota instead.", "warn") 
     193        if environHome : 
     194            self.printInfo("PYKOTA_HOME environment variable is set. Configuration files were searched in %s" % confdir, "info") 
     195        else : 
     196            if missingUser :      
     197                self.printInfo("The 'pykota' system account is missing. Configuration files were searched in %s instead." % confdir, "warn") 
    192198         
    193199        self.logdebug("Charset detected from locale settings : %s" % self.localecharset)