Show
Ignore:
Timestamp:
08/18/10 04:20:57 (14 years ago)
Author:
jerome
Message:

Removed support for the MaxJobSize? attribute for users group print quota
entries : I couldn't see a real use for this at the moment, and it would
complexify the code. This support might reappear later however. Added full
support for the MaxJobSize? attribute for user print quota entries,
editable with edpykota's new --maxjobsize command line switch. Changed
the internal handling of the MaxJobSize? attribute for printers :
internally 0 used to mean unlimited, it now allows one to forbid
printing onto a particular printer. The database upgrade script (only
for PostgreSQL) takes care of this.
IMPORTANT : the database schema changes. A database upgrade script is
provided for PostgreSQL only. The LDAP schema doesn't change to not
break any existing LDAP directory, so the pykotaMaxJobSize attribute is
still allowed on group print quota entries, but never used.
Seems to work as expected, for a change :-)
Fixes #15.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r3545 r3549  
    557557        setenv("PYKOTALIFETIMEPAID", str(self.User.LifeTimePaid or 0.0), self.charset) 
    558558        setenv("PYKOTAUSERDESCRIPTION", self.User.Description or "", self.charset) 
     559        setenv("PYKOTAMAXJOBSIZE", ((self.UserPQuota.MaxJobSize is None) and _("Unlimited")) or str(self.UserPQuota.MaxJobSize), self.charset) 
    559560 
    560561        setenv("PYKOTAPAGECOUNTER", str(self.UserPQuota.PageCounter or 0), self.charset) 
     
    10271028                # This printer was set to refuse jobs this large. 
    10281029                self.printInfo(_("Precomputed job size (%s pages) too large for printer %s.") % (self.softwareJobSize, self.PrinterName), "warn") 
     1030                self.Action = "DENY" 
     1031                # here we don't put the precomputed job size in the message 
     1032                # because in case of error the user could complain :-) 
     1033                self.Reason = _("You are not allowed to print so many pages on printer %s at this time.") % self.PrinterName 
     1034 
     1035        if self.Action not in ("DENY", "CANCEL") : 
     1036            if (self.UserPQuota.MaxJobSize is not None) and (self.softwareJobSize > self.UserPQuota.MaxJobSize) : 
     1037                # This user print quota entry was set to refuse jobs this large. 
     1038                self.printInfo(_("Precomputed job size (%s pages) too large for user %s on printer %s.") % (self.softwareJobSize, self.UserName, self.PrinterName), "warn") 
    10291039                self.Action = "DENY" 
    10301040                # here we don't put the precomputed job size in the message