Show
Ignore:
Timestamp:
09/17/05 16:29:43 (19 years ago)
Author:
jerome
Message:

Upgraded database schema.
Added -i | --ingroups command line option to repykota.
Added -C | --comment command line option to edpykota.
Added 'noquota', 'noprint', and 'nochange' as switches for edpykota's
-l | --limitby command line option.
Severity : entirely new features, in need of testers :-)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r2449 r2452  
    823823         
    824824        if self.Action != "DENY" : 
     825            if self.User.LimitBy == "noprint" : 
     826                self.printInfo(_("User %s is not allowed to print at this time.") % self.UserName, "warn") 
     827                self.Action = "DENY" 
     828                 
     829        if self.Action != "DENY" : 
    825830            # If printing is still allowed at this time, we 
    826831            # need to extract the billing code information from the database. 
     
    841846            # No need to do this if the job is denied, this way we 
    842847            # save some database queries. 
    843             self.logdebug("Checking user %s print quota entry on printer %s" \ 
     848            if self.User.LimitBy in ('noquota', 'nochange') : 
     849                self.logdebug("User %s is allowed to print with no limit, no need to check quota." % self.UserName) 
     850            else : 
     851                self.logdebug("Checking user %s print quota entry on printer %s" \ 
    844852                                    % (self.UserName, self.PrinterName)) 
    845             self.Action = self.warnUserPQuota(self.UserPQuota) 
     853                self.Action = self.warnUserPQuota(self.UserPQuota) 
    846854             
    847855        # exports some new environment variables 
     
    912920            self.printInfo(_("Job size : %i") % self.JobSize) 
    913921             
    914             # update the quota for the current user on this printer  
    915             self.printInfo(_("Updating user %s's quota on printer %s") % (self.UserName, self.PrinterName)) 
    916             self.JobPrice = self.UserPQuota.increasePagesUsage(self.JobSize) 
     922            if self.User.LimitBy == "nochange" : 
     923                # no need to update the quota for the current user on this printer 
     924                self.printInfo(_("User %s's quota on printer %s won't be modified") % (self.UserName, self.PrinterName)) 
     925                self.JobPrice = self.UserPQuota.computeJobPrice(self.JobSize) 
     926            else : 
     927                # update the quota for the current user on this printer  
     928                self.printInfo(_("Updating user %s's quota on printer %s") % (self.UserName, self.PrinterName)) 
     929                self.JobPrice = self.UserPQuota.increasePagesUsage(self.JobSize) 
    917930             
    918931            # adds the current job to history