Changeset 1601

Show
Ignore:
Timestamp:
07/17/04 22:37:27 (20 years ago)
Author:
jalet
Message:

Missing file... Am I really stupid ?

Location:
pykota/trunk
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/ldapstorage.py

    r1584 r1601  
    2222# 
    2323# $Log$ 
     24# Revision 1.73  2004/07/17 20:37:27  jalet 
     25# Missing file... Am I really stupid ? 
     26# 
    2427# Revision 1.72  2004/07/01 19:56:43  jalet 
    2528# Better dispatching of error messages 
     
    637640                lastjob.UserName = fields.get("pykotaUserName")[0] 
    638641                lastjob.PrinterPageCounter = int(fields.get("pykotaPrinterPageCounter", [0])[0] or 0) 
    639                 lastjob.JobSize = int(fields.get("pykotaJobSize", [0])[0]) 
    640                 lastjob.JobPrice = float(fields.get("pykotaJobPrice", [0.0])[0]) 
     642                try : 
     643                    lastjob.JobSize = int(fields.get("pykotaJobSize", [0])[0]) 
     644                except ValueError :     
     645                    lastjob.JobSize = None 
     646                try :     
     647                    lastjob.JobPrice = float(fields.get("pykotaJobPrice", [0.0])[0]) 
     648                except ValueError :     
     649                    lastjob.JobPrice = None 
    641650                lastjob.JobAction = fields.get("pykotaAction", [""])[0] 
    642651                lastjob.JobFileName = fields.get("pykotaFileName", [""])[0] 
     
    11011110                job.JobId = fields.get("pykotaJobId")[0] 
    11021111                job.PrinterPageCounter = int(fields.get("pykotaPrinterPageCounter", [0])[0] or 0) 
    1103                 job.JobSize = int(fields.get("pykotaJobSize", [0])[0]) 
    1104                 job.JobPrice = float(fields.get("pykotaJobPrice", [0.0])[0]) 
     1112                try : 
     1113                    job.JobSize = int(fields.get("pykotaJobSize", [0])[0]) 
     1114                except ValueError :     
     1115                    job.JobSize = None 
     1116                try :     
     1117                    job.JobPrice = float(fields.get("pykotaJobPrice", [0.0])[0]) 
     1118                except ValueError : 
     1119                    job.JobPrice = None 
    11051120                job.JobAction = fields.get("pykotaAction", [""])[0] 
    11061121                job.JobFileName = fields.get("pykotaFileName", [""])[0] 
  • pykota/trunk/pykota/tool.py

    r1600 r1601  
    2222# 
    2323# $Log$ 
     24# Revision 1.113  2004/07/17 20:37:27  jalet 
     25# Missing file... Am I really stupid ? 
     26# 
    2427# Revision 1.112  2004/07/16 12:22:47  jalet 
    2528# LPRng support early version 
     
    918921         self.options, \ 
    919922         self.originalbackend) = self.extractInfoFromCupsOrLprng() 
     923          
     924        self.logdebug(_("Printing system %s, args=%s") % (str(self.printingsystem), " ".join(sys.argv))) 
     925         
    920926        self.username = self.username or 'root' # when printing test page from CUPS web interface, username is empty 
    921927        if self.config.getUserNameToLower() : 
     
    11131119                rseen = "localhost" 
    11141120            try :     
    1115                 df_name = [line[8:] for line in os.environ.get("HF").split() if line.startswith("df_name=")][0] 
     1121                df_name = [line[8:] for line in os.environ.get("HF", "").split() if line.startswith("df_name=")][0] 
    11161122            except IndexError : 
    11171123                inputfile = None