Changeset 3050

Show
Ignore:
Timestamp:
11/08/06 22:43:38 (17 years ago)
Author:
jerome
Message:

Fixed date and time parsing, although I was unable to reproduce the problem reported...

Location:
pykota/trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r3049 r3050  
    947947                now = DateTime.now() 
    948948                try : 
    949                     previous = DateTime.ISO.ParseDateTime(str(self.Printer.LastJob.JobDate)).localtime() 
     949                    previous = DateTime.ISO.ParseDateTime(str(self.Printer.LastJob.JobDate)[:19]).localtime() 
    950950                except : 
    951951                    previous = now 
  • pykota/trunk/cgi-bin/printquota.cgi

    r2953 r3050  
    241241                        else :     
    242242                            billingcode_url = None 
    243                         curdate = DateTime.ISO.ParseDateTime(str(job.JobDate)) 
     243                        curdate = DateTime.ISO.ParseDateTime(str(job.JobDate)[:19]) 
    244244                        self.report.append('<tr class="%s">%s</tr>' % \ 
    245245                                              (oddevenclass, \ 
  • pykota/trunk/NEWS

    r3048 r3050  
    2424    - 1.25alpha15 (2006-11-06) :    
    2525     
     26        - Fixed date and time parsing problems. 
     27         
    2628        - Finally simplified the locking code again, and checked that no 
    2729          stalled lock can persist. The lock files remain on disk though, 
  • pykota/trunk/pykota/dumper.py

    r3030 r3050  
    255255            username = entry[fields["username"]] 
    256256            jobid = entry[fields["jobid"]] 
    257             jobdate = DateTime.ISO.ParseDateTime(str(entry[fields["jobdate"]])) 
     257            jobdate = DateTime.ISO.ParseDateTime(str(entry[fields["jobdate"]])[:19]) 
    258258            gmtoffset = jobdate.gmtoffset() 
    259259            jobdate = "%s %+03i00" % (jobdate.strftime("%d/%b/%Y:%H:%M:%S"), gmtoffset.hour) 
  • pykota/trunk/pykota/reporter.py

    r2945 r3050  
    9494            elif quota.DateLimit is not None : 
    9595                now = DateTime.now() 
    96                 datelimit = DateTime.ISO.ParseDateTime(str(quota.DateLimit)) 
     96                datelimit = DateTime.ISO.ParseDateTime(str(quota.DateLimit)[:19]) 
    9797                if now >= datelimit : 
    9898                    datelimit = "DENY" 
  • pykota/trunk/pykota/storage.py

    r3036 r3050  
    261261    def setDateLimit(self, datelimit) :     
    262262        """Sets the date limit for this quota.""" 
    263         datelimit = DateTime.ISO.ParseDateTime(str(datelimit)) 
     263        datelimit = DateTime.ISO.ParseDateTime(str(datelimit)[:19]) 
    264264        date = "%04i-%02i-%02i %02i:%02i:%02i" % (datelimit.year, datelimit.month, datelimit.day, datelimit.hour, datelimit.minute, datelimit.second) 
    265265        self.parent.writeUserPQuotaDateLimit(self, date) 
     
    403403    def setDateLimit(self, datelimit) :     
    404404        """Sets the date limit for this quota.""" 
    405         datelimit = DateTime.ISO.ParseDateTime(str(datelimit)) 
     405        datelimit = DateTime.ISO.ParseDateTime(str(datelimit)[:19]) 
    406406        date = "%04i-%02i-%02i %02i:%02i:%02i" % (datelimit.year, \ 
    407407                                                  datelimit.month, \ 
     
    759759                        dateval = None 
    760760                    try :     
    761                         DateTime.ISO.ParseDateTime(dateval) 
     761                        DateTime.ISO.ParseDateTime(dateval[:19]) 
    762762                    except :     
    763763                        dateval = None 
  • pykota/trunk/pykota/tool.py

    r3045 r3050  
    544544                            now = DateTime.now() 
    545545                            if userpquota.DateLimit is not None : 
    546                                 datelimit = DateTime.ISO.ParseDateTime(str(userpquota.DateLimit)) 
     546                                datelimit = DateTime.ISO.ParseDateTime(str(userpquota.DateLimit)[:19]) 
    547547                            else : 
    548548                                datelimit = now + self.config.getGraceDelay(printer.Name) 
     
    603603                            now = DateTime.now() 
    604604                            if grouppquota.DateLimit is not None : 
    605                                 datelimit = DateTime.ISO.ParseDateTime(str(grouppquota.DateLimit)) 
     605                                datelimit = DateTime.ISO.ParseDateTime(str(grouppquota.DateLimit)[:19]) 
    606606                            else : 
    607607                                datelimit = now + self.config.getGraceDelay(printer.Name)