Changeset 1000 for pykota/trunk/bin

Show
Ignore:
Timestamp:
05/28/03 01:00:21 (22 years ago)
Author:
jalet
Message:

Big rewrite of external accounting methods.
Should work well now.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pykota

    r976 r1000  
    2323# 
    2424# $Log$ 
     25# Revision 1.32  2003/05/27 23:00:20  jalet 
     26# Big rewrite of external accounting methods. 
     27# Should work well now. 
     28# 
    2529# Revision 1.31  2003/04/30 13:36:39  jalet 
    2630# Stupid accounting method was added. 
     
    150154    def __init__(self) : 
    151155        PyKotaTool.__init__(self) 
    152         (self.printingsystem, self.printerhostname, self.printername, self.username, self.jobid, self.inputfile) = self.extractInfoFromCupsOrLprng() 
     156        (self.printingsystem, self.printerhostname, self.printername, self.username, self.jobid, self.inputfile, self.copies) = self.extractInfoFromCupsOrLprng() 
    153157        self.accounter = openAccounter(self) 
    154158     
     
    174178                destination = destination[1:] 
    175179            printerhostname = destination.split("/")[0].split(":")[0] 
    176             return ("CUPS", printerhostname, os.environ.get("PRINTER"), sys.argv[2].strip(), sys.argv[1].strip(), inputfile) 
     180            return ("CUPS", printerhostname, os.environ.get("PRINTER"), sys.argv[2].strip(), sys.argv[1].strip(), inputfile, int(sys.argv[4].strip())) 
    177181        else :     
    178182            # Try to detect LPRng 
    179             jseen = Jseen = Pseen = nseen = rseen = None 
     183            jseen = Jseen = Pseen = nseen = rseen = Kseen = None 
    180184            for arg in sys.argv : 
    181185                if arg.startswith("-j") : 
     
    191195                elif arg.startswith("-r") :     
    192196                    rseen = arg[2:].strip() 
     197                elif arg.startswith("-K") or arg.startswith("-#") :     
     198                    Kseen = int(arg[2:].strip()) 
     199            if Kseen is None :         
     200                Kseen = 1       # we assume the user wants at least one copy... 
    193201            if jseen and Pseen and nseen and rseen :         
    194                 return ("LPRNG", rseen, Pseen, nseen, jseen, Jseen) 
    195         return (None, None, None, None, None, None)   # Unknown printing system           
     202                return ("LPRNG", rseen, Pseen, nseen, jseen, Jseen, Kseen) 
     203        return (None, None, None, None, None, None, None)   # Unknown printing system           
    196204         
    197205    def acceptJob(self) :