Changeset 2266

Show
Ignore:
Timestamp:
05/21/05 00:40:21 (19 years ago)
Author:
jerome
Message:

Now dumpykota and dumpykota.cgi accept start= and end=
to specify the starting and ending dates when dumping the
history.
Syntax allowed is :

start|end=YYYY[MM[DD[hh[mm[ss]]]]]

and this is REALLY powerful !

Location:
pykota/trunk
Files:
37 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/dumpykota

    r2218 r2266  
    9090         hostname       Client's hostname 
    9191         billingcode    Job's billing code 
     92         start          Job's date of printing 
     93         end            Job's date of printing 
    9294          
    9395  Contrary to other PyKota management tools, wildcard characters are not  
     
    111113   
    112114  Dumps the job history for user jerome on printer HP2100 only. 
     115   
     116  $ dumpykota --data history start=200503 end=20050730234615 
     117   
     118  Dumps all jobs printed between March 1st 2005 at midnight and 
     119  July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    113120   
    114121This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/cgi-bin/printquota.cgi

    r2265 r2266  
    2929import cgi 
    3030import urllib 
     31 
     32from mx import DateTime 
    3133 
    3234from pykota import version 
     
    203205                    billingcode = None 
    204206                self.report = ["<h2>%s</h2>" % _("History")]     
    205                 history = self.storage.retrieveHistory(user, printer, datelimit, hostname, billingcode) 
     207                history = self.storage.retrieveHistory(user, printer, hostname, billingcode, end=datelimit) 
    206208                if not history : 
    207209                    self.report.append("<h3>%s</h3>" % _("Empty")) 
     
    257259                                                            job.JobPages)]))) 
    258260                    self.report.append('</table>') 
     261                    d = DateTime.ISO.ParseDateTime(job.JobDate)        
    259262                    dico = { "history" : 1, 
    260                              "datelimit" : job.JobDate, 
     263                             "datelimit" : "%04i%02i%02i %02i:%02i:%02i" % (d.year, d.month, d.day, d.hour, d.minute, d.second), 
    261264                           } 
    262265                    if user and user.Exists : 
  • pykota/trunk/docs/dumpykota.sgml

    r2236 r2266  
    6060    be ANDed together to select only certain records in the database. 
    6161    For example the filter expression <literal>username=jerome</literal> 
    62     would only dump datas pertaining to user <literal>jerome</literal>. 
     62    would only dump datas pertaining to user <literal>jerome</literal> 
     63    while the filter expression <literal>start=2005</literal> used 
     64    when dumping the history would only dump jobs printed during 
     65    the year <literal>2005</literal>. 
    6366  </para> 
    6467   
     
    6669    Several keys like <literal>username</literal> are possible, but some 
    6770    only apply to certain data types. Using a key which is not supported 
    68     for a particular data type will return an empty result. 
     71    for a particular data type may return an incorrect result. 
    6972    <tip><title>Tip</title> 
    7073      <para> 
  • pykota/trunk/man/de/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "mai 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NOM 
    4 dumpykota \- page de manuel de dumpykota 1.22_unofficial 
     4dumpykota \- page de manuel de dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Dumps PyKota database's content. 
     
    8080billingcode 
    8181Job's billing code 
     82.TP 
     83start 
     84Job's date of printing 
     85.TP 
     86end 
     87Job's date of printing 
    8288.IP 
    8389Contrary to other PyKota management tools, wildcard characters are not 
     
    101107.IP 
    102108Dumps the job history for user jerome on printer HP2100 only. 
     109.IP 
     110\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     111.IP 
     112Dumps all jobs printed between March 1st 2005 at midnight and 
     113July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    103114.PP 
    104115This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "May 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NAME 
    4 dumpykota \- manual page for dumpykota 1.22_unofficial 
     4dumpykota \- manual page for dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Dumps PyKota database's content. 
     
    8080billingcode 
    8181Job's billing code 
     82.TP 
     83start 
     84Job's date of printing 
     85.TP 
     86end 
     87Job's date of printing 
    8288.IP 
    8389Contrary to other PyKota management tools, wildcard characters are not 
     
    101107.IP 
    102108Dumps the job history for user jerome on printer HP2100 only. 
     109.IP 
     110\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     111.IP 
     112Dumps all jobs printed between March 1st 2005 at midnight and 
     113July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    103114.PP 
    104115This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/el_GR/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "mai 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NOM 
    4 dumpykota \- page de manuel de dumpykota 1.22_unofficial 
     4dumpykota \- page de manuel de dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Dumps PyKota database's content. 
     
    8080billingcode 
    8181Job's billing code 
     82.TP 
     83start 
     84Job's date of printing 
     85.TP 
     86end 
     87Job's date of printing 
    8288.IP 
    8389Contrary to other PyKota management tools, wildcard characters are not 
     
    101107.IP 
    102108Dumps the job history for user jerome on printer HP2100 only. 
     109.IP 
     110\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     111.IP 
     112Dumps all jobs printed between March 1st 2005 at midnight and 
     113July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    103114.PP 
    104115This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/es/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "mai 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NOM 
    4 dumpykota \- page de manuel de dumpykota 1.22_unofficial 
     4dumpykota \- page de manuel de dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Dumps PyKota database's content. 
     
    8080billingcode 
    8181Job's billing code 
     82.TP 
     83start 
     84Job's date of printing 
     85.TP 
     86end 
     87Job's date of printing 
    8288.IP 
    8389Contrary to other PyKota management tools, wildcard characters are not 
     
    101107.IP 
    102108Dumps the job history for user jerome on printer HP2100 only. 
     109.IP 
     110\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     111.IP 
     112Dumps all jobs printed between March 1st 2005 at midnight and 
     113July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    103114.PP 
    104115This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/fr/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "mai 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NOM 
    4 dumpykota \- page de manuel de dumpykota 1.22_unofficial 
     4dumpykota \- page de manuel de dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Exporte le contenu de la base de donn� de PyKota. 
     
    8787billingcode 
    8888Code de facturation du travail d'impression 
     89.TP 
     90start 
     91Date du travail d'impression 
     92.TP 
     93end 
     94Date du travail d'impression 
    8995.IP 
    9096Contrairement aux autres outils d'administration de PyKota, les caract�s 
     
    110116Exporte l'historique des travaux de l'utilisateur jerome sur l'imprimante 
    111117HP2100 seulement. 
     118.IP 
     119\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     120.IP 
     121Exporte tous les travaux imprim�entre le 1er Mars 2005 �inuit et 
     122le 30 Juillet 2005 �3 heures 46 minutes et 15 secondes inclus. 
    112123.PP 
    113124This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/it/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "mai 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NOM 
    4 dumpykota \- page de manuel de dumpykota 1.22_unofficial 
     4dumpykota \- page de manuel de dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Dumps PyKota database's content. 
     
    8080billingcode 
    8181Job's billing code 
     82.TP 
     83start 
     84Job's date of printing 
     85.TP 
     86end 
     87Job's date of printing 
    8288.IP 
    8389Contrary to other PyKota management tools, wildcard characters are not 
     
    101107.IP 
    102108Dumps the job history for user jerome on printer HP2100 only. 
     109.IP 
     110\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     111.IP 
     112Dumps all jobs printed between March 1st 2005 at midnight and 
     113July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    103114.PP 
    104115This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/nb_NO/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "mai 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NOM 
    4 dumpykota \- page de manuel de dumpykota 1.22_unofficial 
     4dumpykota \- page de manuel de dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Dumps PyKota database's content. 
     
    8080billingcode 
    8181Job's billing code 
     82.TP 
     83start 
     84Job's date of printing 
     85.TP 
     86end 
     87Job's date of printing 
    8288.IP 
    8389Contrary to other PyKota management tools, wildcard characters are not 
     
    101107.IP 
    102108Dumps the job history for user jerome on printer HP2100 only. 
     109.IP 
     110\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     111.IP 
     112Dumps all jobs printed between March 1st 2005 at midnight and 
     113July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    103114.PP 
    104115This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/pt_BR/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "mai 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NOM 
    4 dumpykota \- page de manuel de dumpykota 1.22_unofficial 
     4dumpykota \- page de manuel de dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Dumps PyKota database's content. 
     
    8080billingcode 
    8181Job's billing code 
     82.TP 
     83start 
     84Job's date of printing 
     85.TP 
     86end 
     87Job's date of printing 
    8288.IP 
    8389Contrary to other PyKota management tools, wildcard characters are not 
     
    101107.IP 
    102108Dumps the job history for user jerome on printer HP2100 only. 
     109.IP 
     110\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     111.IP 
     112Dumps all jobs printed between March 1st 2005 at midnight and 
     113July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    103114.PP 
    104115This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/pt/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "mai 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NOM 
    4 dumpykota \- page de manuel de dumpykota 1.22_unofficial 
     4dumpykota \- page de manuel de dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Dumps PyKota database's content. 
     
    8080billingcode 
    8181Job's billing code 
     82.TP 
     83start 
     84Job's date of printing 
     85.TP 
     86end 
     87Job's date of printing 
    8288.IP 
    8389Contrary to other PyKota management tools, wildcard characters are not 
     
    101107.IP 
    102108Dumps the job history for user jerome on printer HP2100 only. 
     109.IP 
     110\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     111.IP 
     112Dumps all jobs printed between March 1st 2005 at midnight and 
     113July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    103114.PP 
    104115This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/sv_SE/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "mai 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NOM 
    4 dumpykota \- page de manuel de dumpykota 1.22_unofficial 
     4dumpykota \- page de manuel de dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Dumps PyKota database's content. 
     
    8080billingcode 
    8181Job's billing code 
     82.TP 
     83start 
     84Job's date of printing 
     85.TP 
     86end 
     87Job's date of printing 
    8288.IP 
    8389Contrary to other PyKota management tools, wildcard characters are not 
     
    101107.IP 
    102108Dumps the job history for user jerome on printer HP2100 only. 
     109.IP 
     110\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     111.IP 
     112Dumps all jobs printed between March 1st 2005 at midnight and 
     113July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    103114.PP 
    104115This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/th/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "mai 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NOM 
    4 dumpykota \- page de manuel de dumpykota 1.22_unofficial 
     4dumpykota \- page de manuel de dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Dumps PyKota database's content. 
     
    8080billingcode 
    8181Job's billing code 
     82.TP 
     83start 
     84Job's date of printing 
     85.TP 
     86end 
     87Job's date of printing 
    8288.IP 
    8389Contrary to other PyKota management tools, wildcard characters are not 
     
    101107.IP 
    102108Dumps the job history for user jerome on printer HP2100 only. 
     109.IP 
     110\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     111.IP 
     112Dumps all jobs printed between March 1st 2005 at midnight and 
     113July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    103114.PP 
    104115This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/tr/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "mai 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NOM 
    4 dumpykota \- page de manuel de dumpykota 1.22_unofficial 
     4dumpykota \- page de manuel de dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Dumps PyKota database's content. 
     
    8080billingcode 
    8181Job's billing code 
     82.TP 
     83start 
     84Job's date of printing 
     85.TP 
     86end 
     87Job's date of printing 
    8288.IP 
    8389Contrary to other PyKota management tools, wildcard characters are not 
     
    101107.IP 
    102108Dumps the job history for user jerome on printer HP2100 only. 
     109.IP 
     110\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     111.IP 
     112Dumps all jobs printed between March 1st 2005 at midnight and 
     113July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    103114.PP 
    104115This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/zh_TW/dumpykota.1

    r2237 r2266  
    22.TH DUMPYKOTA "1" "mai 2005" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NOM 
    4 dumpykota \- page de manuel de dumpykota 1.22_unofficial 
     4dumpykota \- page de manuel de dumpykota 1.23alpha4_unofficial 
    55.SH DESCRIPTION 
    6 dumpykota v1.22_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
     6dumpykota v1.23alpha4_unofficial (c) 2003, 2004, 2005 C@LL \- Conseil Internet & Logiciels Libres 
    77.PP 
    88Dumps PyKota database's content. 
     
    8080billingcode 
    8181Job's billing code 
     82.TP 
     83start 
     84Job's date of printing 
     85.TP 
     86end 
     87Job's date of printing 
    8288.IP 
    8389Contrary to other PyKota management tools, wildcard characters are not 
     
    101107.IP 
    102108Dumps the job history for user jerome on printer HP2100 only. 
     109.IP 
     110\f(CW$ dumpykota --data history start=200503 end=20050730234615\fR 
     111.IP 
     112Dumps all jobs printed between March 1st 2005 at midnight and 
     113July 30th 2005 at 23 hours 46 minutes and 15 secondes included. 
    103114.PP 
    104115This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/NEWS

    r2265 r2266  
    2222PyKota NEWS : 
    2323        
     24    - 1.23alpha4 : 
     25     
     26        - The data dumper now accept start= and end= to specify the starting 
     27          and ending dates to dump the history. 
     28           
    2429    - 1.23alpha3 : 
    2530     
  • pykota/trunk/po/de/pykota.po

    r2228 r2266  
    244244"         hostname       Client's hostname\n" 
    245245"         billingcode    Job's billing code\n" 
     246"         start          Job's date of printing\n" 
     247"         end            Job's date of printing\n" 
    246248"         \n" 
    247249"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    265267"  \n" 
    266268"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     269"  \n" 
     270"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     271"  \n" 
     272"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     273"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    267274"  \n" 
    268275"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/po/el_GR/pykota.po

    r2228 r2266  
    240240"         hostname       Client's hostname\n" 
    241241"         billingcode    Job's billing code\n" 
     242"         start          Job's date of printing\n" 
     243"         end            Job's date of printing\n" 
    242244"         \n" 
    243245"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    261263"  \n" 
    262264"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     265"  \n" 
     266"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     267"  \n" 
     268"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     269"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    263270"  \n" 
    264271"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/po/es/pykota.po

    r2228 r2266  
    258258"         hostname       Client's hostname\n" 
    259259"         billingcode    Job's billing code\n" 
     260"         start          Job's date of printing\n" 
     261"         end            Job's date of printing\n" 
    260262"         \n" 
    261263"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    279281"  \n" 
    280282"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     283"  \n" 
     284"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     285"  \n" 
     286"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     287"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    281288"  \n" 
    282289"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/po/fr/pykota.po

    r2228 r2266  
    254254"         hostname       Client's hostname\n" 
    255255"         billingcode    Job's billing code\n" 
     256"         start          Job's date of printing\n" 
     257"         end            Job's date of printing\n" 
    256258"         \n" 
    257259"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    275277"  \n" 
    276278"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     279"  \n" 
     280"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     281"  \n" 
     282"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     283"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    277284"  \n" 
    278285"This program is free software; you can redistribute it and/or modify\n" 
     
    359366"         hostname       Nom d'h�de la machine cliente\n" 
    360367"         billingcode    Code de facturation du travail d'impression\n" 
     368"         start          Date du travail d'impression\n" 
     369"         end            Date du travail d'impression\n" 
    361370"         \n" 
    362371"  Contrairement aux autres outils d'administration de PyKota, les " 
     
    383392"  Exporte l'historique des travaux de l'utilisateur jerome sur l'imprimante\n" 
    384393"  HP2100 seulement.\n" 
     394"  \n" 
     395"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     396"  \n" 
     397"  Exporte tous les travaux imprim�entre le 1er Mars 2005 �inuit et\n" 
     398"  le 30 Juillet 2005 �3 heures 46 minutes et 15 secondes inclus.\n" 
    385399"  \n" 
    386400"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/po/it/pykota.po

    r2228 r2266  
    202202"         hostname       Client's hostname\n" 
    203203"         billingcode    Job's billing code\n" 
     204"         start          Job's date of printing\n" 
     205"         end            Job's date of printing\n" 
    204206"         \n" 
    205207"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    223225"  \n" 
    224226"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     227"  \n" 
     228"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     229"  \n" 
     230"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     231"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    225232"  \n" 
    226233"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/po/nb_NO/pykota.po

    r2228 r2266  
    254254"         hostname       Client's hostname\n" 
    255255"         billingcode    Job's billing code\n" 
     256"         start          Job's date of printing\n" 
     257"         end            Job's date of printing\n" 
    256258"         \n" 
    257259"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    275277"  \n" 
    276278"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     279"  \n" 
     280"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     281"  \n" 
     282"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     283"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    277284"  \n" 
    278285"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/po/pt_BR/pykota.po

    r2228 r2266  
    200200"         hostname       Client's hostname\n" 
    201201"         billingcode    Job's billing code\n" 
     202"         start          Job's date of printing\n" 
     203"         end            Job's date of printing\n" 
    202204"         \n" 
    203205"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    221223"  \n" 
    222224"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     225"  \n" 
     226"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     227"  \n" 
     228"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     229"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    223230"  \n" 
    224231"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/po/pt/pykota.po

    r2228 r2266  
    200200"         hostname       Client's hostname\n" 
    201201"         billingcode    Job's billing code\n" 
     202"         start          Job's date of printing\n" 
     203"         end            Job's date of printing\n" 
    202204"         \n" 
    203205"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    221223"  \n" 
    222224"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     225"  \n" 
     226"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     227"  \n" 
     228"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     229"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    223230"  \n" 
    224231"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/po/pykota.pot

    r2228 r2266  
    202202"         hostname       Client's hostname\n" 
    203203"         billingcode    Job's billing code\n" 
     204"         start          Job's date of printing\n" 
     205"         end            Job's date of printing\n" 
    204206"         \n" 
    205207"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    223225"  \n" 
    224226"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     227"  \n" 
     228"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     229"  \n" 
     230"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     231"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    225232"  \n" 
    226233"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/po/sv_SE/pykota.po

    r2228 r2266  
    203203"         hostname       Client's hostname\n" 
    204204"         billingcode    Job's billing code\n" 
     205"         start          Job's date of printing\n" 
     206"         end            Job's date of printing\n" 
    205207"         \n" 
    206208"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    224226"  \n" 
    225227"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     228"  \n" 
     229"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     230"  \n" 
     231"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     232"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    226233"  \n" 
    227234"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/po/th/pykota.po

    r2228 r2266  
    201201"         hostname       Client's hostname\n" 
    202202"         billingcode    Job's billing code\n" 
     203"         start          Job's date of printing\n" 
     204"         end            Job's date of printing\n" 
    203205"         \n" 
    204206"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    222224"  \n" 
    223225"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     226"  \n" 
     227"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     228"  \n" 
     229"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     230"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    224231"  \n" 
    225232"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/po/tr/pykota.po

    r2228 r2266  
    247247"         hostname       Client's hostname\n" 
    248248"         billingcode    Job's billing code\n" 
     249"         start          Job's date of printing\n" 
     250"         end            Job's date of printing\n" 
    249251"         \n" 
    250252"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    268270"  \n" 
    269271"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     272"  \n" 
     273"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     274"  \n" 
     275"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     276"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    270277"  \n" 
    271278"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/po/zh_TW/pykota.po

    r2226 r2266  
    203203"         hostname       Client's hostname\n" 
    204204"         billingcode    Job's billing code\n" 
     205"         start          Job's date of printing\n" 
     206"         end            Job's date of printing\n" 
    205207"         \n" 
    206208"  Contrary to other PyKota management tools, wildcard characters are not \n" 
     
    224226"  \n" 
    225227"  Dumps the job history for user jerome on printer HP2100 only.\n" 
     228"  \n" 
     229"  $ dumpykota --data history start=200503 end=20050730234615\n" 
     230"  \n" 
     231"  Dumps all jobs printed between March 1st 2005 at midnight and\n" 
     232"  July 30th 2005 at 23 hours 46 minutes and 15 secondes included.\n" 
    226233"  \n" 
    227234"This program is free software; you can redistribute it and/or modify\n" 
  • pykota/trunk/pykota/dumper.py

    r2264 r2266  
    6565                        "hostname", 
    6666                        "billingcode", 
     67                        "start", 
     68                        "end", 
    6769                      ] 
    6870    def main(self, arguments, options, restricted=1) : 
  • pykota/trunk/pykota/storage.py

    r2217 r2266  
    2323# 
    2424 
     25from mx import DateTime 
     26 
    2527class PyKotaStorageError(Exception): 
    2628    """An exception for Quota Storage related stuff.""" 
     
    588590        return text 
    589591         
     592    def cleanDates(self, startdate, enddate) :     
     593        """Clean the dates to create a correct filter.""" 
     594        if startdate is None : 
     595            startdate = enddate 
     596        if enddate is None :     
     597            enddate = startdate 
     598        if (startdate is None) and (enddate is None) :     
     599            return (None, None) 
     600        if startdate.isdigit() and enddate.isdigit() : 
     601            datedict = { "start" : startdate, "end" : enddate }     
     602            for limit in datedict.keys() : 
     603                dateval = datedict[limit] 
     604                lgdateval = len(dateval) 
     605                if lgdateval == 4 : 
     606                    if limit == "start" :  
     607                        dateval = "%s0101 00:00:00" % dateval 
     608                    else :   
     609                        dateval = "%s1231 23:59:59" % dateval 
     610                elif lgdateval == 6 : 
     611                    if limit == "start" :  
     612                        dateval = "%s01 00:00:00" % dateval 
     613                    else :   
     614                        mxdate = DateTime.ISO.ParseDateTime("%s01 00:00:00" % dateval) 
     615                        dateval = "%s%02i 23:59:59" % (dateval, mxdate.days_in_month) 
     616                elif lgdateval == 8 : 
     617                    if limit == "start" :  
     618                        dateval = "%s 00:00:00" % dateval 
     619                    else :   
     620                        dateval = "%s 23:59:59" % dateval 
     621                elif lgdateval == 10 : 
     622                    if limit == "start" :  
     623                        dateval = "%s %s:00:00" % (dateval[:8], dateval[8:]) 
     624                    else :   
     625                        dateval = "%s %s:59:59" % (dateval[:8], dateval[8:]) 
     626                elif lgdateval == 12 : 
     627                    if limit == "start" :  
     628                        dateval = "%s %s:%s:00" % (dateval[:8], dateval[8:10], dateval[10:]) 
     629                    else :   
     630                        dateval = "%s %s:%s:59" % (dateval[:8], dateval[8:10], dateval[10:]) 
     631                elif lgdateval == 14 :         
     632                    dateval = "%s %s:%s:%s" % (dateval[:8], dateval[8:10], dateval[10:12], dateval[12:]) 
     633                else :     
     634                    dateval = None 
     635                try :     
     636                    DateTime.ISO.ParseDateTime(dateval) 
     637                except :     
     638                    dateval = None 
     639                datedict[limit] = dateval     
     640            (start, end) = (datedict["start"], datedict["end"]) 
     641            if start > end : 
     642                (start, end) = (end, start) 
     643            return (start, end)     
     644        else :             
     645            return (None, None) 
     646         
    590647def openConnection(pykotatool) : 
    591648    """Returns a connection handle to the appropriate Quota Storage Database.""" 
  • pykota/trunk/pykota/storages/ldapstorage.py

    r2222 r2266  
    10441044            self.doModify(pgroup.ident, fields)          
    10451045             
    1046     def retrieveHistory(self, user=None, printer=None, datelimit=None, hostname=None, billingcode=None, limit=100) : 
    1047         """Retrieves all print jobs for user on printer (or all) before date, limited to first 100 results.""" 
     1046    def retrieveHistory(self, user=None, printer=None, hostname=None, billingcode=None, limit=100, start=None, end=None) : 
     1047        """Retrieves all print jobs for user on printer (or all) between start and end date, limited to first 100 results.""" 
    10481048        precond = "(objectClass=pykotaJob)" 
    10491049        where = [] 
     
    11101110                minute = int(date[10:12]) 
    11111111                second = int(date[12:14]) 
    1112                 job.JobDate = "%04i-%02i-%02i %02i:%02i:%02i" % (year, month, day, hour, minute, second) 
    1113                 if (datelimit is None) or (job.JobDate <= datelimit) : 
     1112                job.JobDate = "%04i%02i%02i %02i:%02i:%02i" % (year, month, day, hour, minute, second) 
     1113                if ((start is None) and (end is None)) or \ 
     1114                   ((start is None) and (job.JobDate <= end)) or \ 
     1115                   ((end is None) and (job.JobDate >= start)) or \ 
     1116                   ((job.JobDate >= start) and (job.JobDate <= end)) : 
    11141117                    job.UserName = fields.get("pykotaUserName")[0] 
    11151118                    job.PrinterName = fields.get("pykotaPrinterName")[0] 
     
    13351338        else :     
    13361339            printer = None 
    1337         entries = self.retrieveHistory(user, printer, hostname=extractonly.get("hostname"), billingcode=extractonly.get("billingcode"), limit=None) 
     1340        startdate = extractonly.get("start") 
     1341        enddate = extractonly.get("end") 
     1342        for limit in ("start", "end") : 
     1343            try : 
     1344                del extractonly[limit] 
     1345            except KeyError :     
     1346                pass 
     1347        (startdate, enddate) = self.cleanDates(startdate, enddate) 
     1348        entries = self.retrieveHistory(user, printer, hostname=extractonly.get("hostname"), billingcode=extractonly.get("billingcode"), limit=None, start=startdate, end=enddate) 
    13381349        if entries : 
    13391350            result = [ ("username", "printername", "dn", "jobid", "pagecounter", "jobsize", "action", "jobdate", "filename", "title", "copies", "options", "jobprice", "hostname", "jobsizebytes", "md5sum", "pages", "billingcode") ]  
  • pykota/trunk/pykota/storages/sql.py

    r2222 r2266  
    124124    def extractHistory(self, extractonly={}) : 
    125125        """Extracts all jobhistory records.""" 
     126        startdate = extractonly.get("start") 
     127        enddate = extractonly.get("end") 
     128        for limit in ("start", "end") : 
     129            try : 
     130                del extractonly[limit] 
     131            except KeyError :     
     132                pass 
    126133        thefilter = self.createFilter(extractonly) 
    127134        if thefilter : 
    128135            thefilter = "AND %s" % thefilter 
     136        (startdate, enddate) = self.cleanDates(startdate, enddate) 
     137        if startdate and enddate :  
     138            thefilter = "%s AND jobdate>=%s AND jobdate<=%s" % (thefilter, self.doQuote(startdate), self.doQuote(enddate)) 
    129139        result = self.doRawSearch("SELECT users.username,printers.printername,jobhistory.* FROM users,printers,jobhistory WHERE users.id=jobhistory.userid AND printers.id=jobhistory.printerid %s ORDER BY jobhistory.id ASC" % thefilter) 
    130140        return self.prepareRawResult(result) 
    131          
     141             
    132142    def getAllUsersNames(self) :     
    133143        """Extracts all user names.""" 
     
    498508        self.doModify("DELETE FROM printergroupsmembers WHERE groupid=%s AND printerid=%s" % (self.doQuote(pgroup.ident), self.doQuote(printer.ident))) 
    499509         
    500     def retrieveHistory(self, user=None, printer=None, datelimit=None, hostname=None, billingcode=None, limit=100) : 
    501         """Retrieves all print jobs for user on printer (or all) before date, limited to first 100 results.""" 
     510    def retrieveHistory(self, user=None, printer=None, hostname=None, billingcode=None, limit=100, start=None, end=None) : 
     511        """Retrieves all print jobs for user on printer (or all) between start and end date, limited to first 100 results.""" 
    502512        query = "SELECT jobhistory.*,username,printername FROM jobhistory,users,printers WHERE users.id=userid AND printers.id=printerid" 
    503513        where = [] 
     
    510520        if billingcode is not None :     
    511521            where.append("billingcode=%s" % self.doQuote(self.userCharsetToDatabase(billingcode))) 
    512         if datelimit is not None :     
    513             where.append("jobdate<=%s" % self.doQuote(datelimit)) 
     522        if start is not None :     
     523            where.append("jobdate>=%s" % self.doQuote(start)) 
     524        if end is not None :     
     525            where.append("jobdate<=%s" % self.doQuote(end)) 
    514526        if where :     
    515527            query += " AND %s" % " AND ".join(where) 
  • pykota/trunk/pykota/version.py

    r2262 r2266  
    2222# 
    2323 
    24 __version__ = "1.23alpha3_unofficial" 
     24__version__ = "1.23alpha4_unofficial" 
    2525 
    2626__doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng.""" 
  • pykota/trunk/TODO

    r2264 r2266  
    2626          Winboxes it seems) 
    2727 
    28         - Add date filtering options to dumpykota, something like  
    29                 date=+20050101 date=-20050201 
    30           to dump all jobs printed between January 1st 2005 included       
    31           and February 1st 2005 not included. This looks ugly but 
    32           at least we avoid the problematic '<' and '>' on command 
    33           lines, which would mandate the use of quotes... 
    34          
    3528        - Pass-through mode for printers : history correctly filled (including 
    3629          job size) but no impact on user's page counter or account