Changeset 1483

Show
Ignore:
Timestamp:
05/18/04 16:49:34 (20 years ago)
Author:
jalet
Message:

Big code changes to completely remove the need for "requester" directives,
jsut use "hardware(... your previous requester directive's content ...)"

Location:
pykota/trunk
Files:
2 removed
29 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r1478 r1483  
    2424# 
    2525# $Log$ 
     26# Revision 1.44  2004/05/18 14:48:47  jalet 
     27# Big code changes to completely remove the need for "requester" directives, 
     28# jsut use "hardware(... your previous requester directive's content ...)" 
     29# 
    2630# Revision 1.43  2004/05/17 11:46:05  jalet 
    2731# First try at cupspykota's main loop rewrite 
     
    186190from pykota.storage import PyKotaStorageError 
    187191from pykota.accounter import PyKotaAccounterError 
    188 from pykota.requester import PyKotaRequesterError 
    189192     
    190193class PyKotaPopen4(popen2.Popen4) : 
     
    508511            kotabackend = PyKotaBackend()     
    509512            retcode = kotabackend.mainWork() 
    510         except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError, PyKotaAccounterError, PyKotaRequesterError, AttributeError, KeyError, IndexError, ValueError, TypeError, IOError), msg : 
     513        except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError, PyKotaAccounterError, AttributeError, KeyError, IndexError, ValueError, TypeError, IOError), msg : 
    511514            import traceback 
    512515            mm = [((f.endswith('\n') and f) or (f + '\n')) for f in traceback.format_exception(*sys.exc_info())] 
  • pykota/trunk/bin/pkhint

    r1475 r1483  
    2424# 
    2525# $Log$ 
     26# Revision 1.8  2004/05/18 14:48:47  jalet 
     27# Big code changes to completely remove the need for "requester" directives, 
     28# jsut use "hardware(... your previous requester directive's content ...)" 
     29# 
    2630# Revision 1.7  2004/05/13 13:59:27  jalet 
    2731# Code simplifications 
     
    214218                    snmpcommand = self.accepts(SNMPTESTS, hostname) 
    215219                    if snmpcommand is not None : 
    216                         accounter = "hardware" 
    217                         requester = 'external(/usr/share/pykota/waitprinter.sh %(printer)s && ' + snmpcommand + ')' 
    218                         configuration.append((printer, accounter, requester)) 
     220                        accounter = 'hardware(/usr/share/pykota/waitprinter.sh %(printer)s && ' + snmpcommand + ')' 
     221                        configuration.append((printer, accounter)) 
    219222                    else :     
    220223                        netpjlcommand = self.accepts(NETPJLTESTS, hostname, port) 
    221224                        if netpjlcommand is not None : 
    222                             accounter = "hardware" 
    223                             requester = 'external(' + netpjlcommand + ')' 
    224                             configuration.append((printer, accounter, requester)) 
     225                            accounter = 'hardware(' + netpjlcommand + ')' 
     226                            configuration.append((printer, accounter)) 
    225227                elif devicetype == "direct" :  
    226228                    sys.stderr.write("Can't currently handle device %s for printer %s\n" % (device, printer)) 
     
    234236        else : 
    235237            print "\nPut the following lines into your /etc/pykota/pykota.conf file :\n" 
    236             for (printer, accounter, requester) in configuration : 
     238            for (printer, accounter) in configuration : 
    237239                print "[%s]" % printer 
    238240                print "accounter: %s" % accounter 
    239                 if requester is not None : 
    240                     print "requester: %s" % requester 
    241241                print     
    242242         
  • pykota/trunk/bin/pykota

    r1400 r1483  
    2424# 
    2525# $Log$ 
     26# Revision 1.58  2004/05/18 14:48:47  jalet 
     27# Big code changes to completely remove the need for "requester" directives, 
     28# jsut use "hardware(... your previous requester directive's content ...)" 
     29# 
    2630# Revision 1.57  2004/03/15 10:47:56  jalet 
    2731# This time the traceback formatting should be correct ! 
     
    233237from pykota.storage import PyKotaStorageError 
    234238from pykota.accounter import PyKotaAccounterError 
    235 from pykota.requester import PyKotaRequesterError 
    236239 
    237240class PyKotaFilter(PyKotaFilterOrBackend) :         
     
    359362        kotafilter = PyKotaFilter()     
    360363        retcode = kotafilter.mainWork() 
    361     except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError, PyKotaAccounterError, PyKotaRequesterError, AttributeError, KeyError, IndexError, ValueError, TypeError, IOError), msg : 
     364    except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError, PyKotaAccounterError, AttributeError, KeyError, IndexError, ValueError, TypeError, IOError), msg : 
    362365        import traceback 
    363366        mm = [((f.endswith('\n') and f) or (f + '\n')) for f in traceback.format_exception(*sys.exc_info())] 
  • pykota/trunk/conf/pykota.conf.sample

    r1475 r1483  
    187187#                 default in PyKota since its beginning. 
    188188# 
     189#                 In the lines below "%(printer)s" is automatically replaced 
     190#                 at run time with your printer's Fully Qualified Domain Name 
     191#                 for network printers. 
     192#                 e.g. myprinter.example.com 
     193# 
     194#         Example :  
     195#          
     196#             accounter: hardware(/usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") 
     197#          
     198#         Another untested example, using npadmin : 
     199#          
     200#             accounter: hardware(/usr/bin/npadmin --pagecount %(printer)s) 
     201#          
     202#         Another example, for AppleTalk printers which works fine : 
     203#         (You may need the pap CUPS backend installed, and copy the  
     204#         pagecount.ps file from untested/netatalk into /etc or any  
     205#         appropriate location) 
     206#          
     207#             accounter: hardware(/usr/share/pykota/papwaitprinter.sh "MyPrinter:LaserWriter@*" && /usr/bin/pap -p "MyPrinter:LaserWriter@*" /usr/share/pykota/pagecount.ps  2>/dev/null | /bin/grep -v status | /bin/grep -v Connect | /usr/bin/tail -1) 
     208#          
     209#         An example for parallel printers like the HP Laserjet 5MP : 
     210#          
     211#             accounter: hardware(/bin/cat /usr/share/pykota/pagecount.pjl >/dev/lp0 && /usr/bin/head -2 </dev/lp0 | /usr/bin/tail -1) 
     212#          
     213#         This value can be set either globally or per printer or both. 
     214#         If both are defined, the printer option has priority. 
     215#          
     216#         Some examples and comments provided by Bob Martel from csuohio.edu 
     217#          
     218#         For several printers I could not get the page count using snmpget.  I 
     219#         resorted to snmpwalk: 
     220#          
     221#             accounter: hardware(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public %(printer)s | grep mib-2.43.10.2.1.4.1.1 | cut -d " " -f4) 
     222#          
     223#         The last example is still more ugly, some of the printers only provided 
     224#         their counters without names, but at least always on the same line: 
     225#          
     226#             accounter: hardware(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public -Ov %(printer)s | grep Counter32 | tail -2 | head -1 | cut -d " " -f2) 
     227#          
     228#         An example using netcat and a preformatted PJL job which you can find 
     229#         in the untested/pjl directory, which is sent to a JetDirect print 
     230#         server on port 9100 : 
     231#          
     232#             accounter: hardware(/bin/nc -w 2 %(printer)s 9100 </usr/share/pykota/pagecount.pjl | /usr/bin/tail -2) 
     233#          
     234#         An example using the contributed pagecount.pl script which does  
     235#         the same as above, but should work on more printers :  
     236#          
     237#             accounter: hardware(/usr/share/pykota/pagecount.pl %(printer)s 9100) 
     238#          
     239#         WARNING : In any case, when using an hardware accounter, please test the command line outside 
     240#                   of PyKota before. This will save you some headaches in case it doesn't work as expected. 
     241#          
     242#         The waitprinter.sh is there to wait until the printer is idle again. 
     243#         This should prevent a job to be sent to the printer while another one is  
     244#         not yet finished (not all pages are printed, but the complete job is in  
     245#         the printer) 
     246#          
     247#         YOU ABSOLUTELY HAVE TO BE SURE YOU HAVE A SCRIPT WHICH WAITS FOR THE 
     248#         PRINTER BEING READY BEFORE ASKING FOR ITS INTERNAL PAGE COUNTER. 
     249#          
     250#         PYKOTA INCLUDES SUCH SCRIPTS FOR SNMP AND APPLETALK PRINTERS, MORE TO COME 
     251# 
     252#         SOME OF THE ABOVE EXAMPLES DON'T USE SUCH A SCRIPT, YOU HAVE BEEN WARNED 
     253#          
     254# 
    189255#    - software : delegates the job's size computation to any  
    190256#                 external command of your choice.  
     
    209275# This value can be set either globally or on a per printer basis 
    210276# If both are defined, the printer option has priority. 
    211 # if not set it defaults to 'hardware'. 
    212 # 
    213 # default value  
    214 accounter: hardware 
     277# 
     278# default value 
     279accounter: hardware(/usr/share/pykota/waitprinter.sh %(printer)s && /usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") 
    215280# accounter: software(/usr/bin/pkpgcounter) 
    216281 
     
    317382[hpmarketing] 
    318383 
    319 # How to query the hpmarketing printer for its page counter. 
    320 # THIS IS ONLY USED IF YOU HAVE SET 'accounter' TO 'hardware' 
    321 # JUST COMMENT IT OUT IF YOU USE ANY OTHER ACCOUNTING METHOD. 
    322 # (it would be ignored anyway) 
    323 # 
    324 # In the lines below "%(printer)s" is automatically replaced 
    325 # at run time with your printer's Fully Qualified Domain Name 
    326 # for network printers. 
    327 # e.g. myprinter.example.com 
    328 # 
    329 # Only value supported is : external(... your command here...)  
    330 # 
    331 # Example :  
    332 # 
    333 #     requester: external(/usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") 
    334 # 
    335 # Another untested example, using npadmin : 
    336 # 
    337 #     requester: external(/usr/bin/npadmin --pagecount %(printer)s) 
    338 # 
    339 # Another example, for AppleTalk printers which works fine : 
    340 # (You may need the pap CUPS backend installed, and copy the  
    341 # pagecount.ps file from untested/netatalk into /etc or any  
    342 # appropriate location) 
    343 # 
    344 #     requester: external(/usr/share/pykota/papwaitprinter.sh "MyPrinter:LaserWriter@*" && /usr/bin/pap -p "MyPrinter:LaserWriter@*" /usr/share/pykota/pagecount.ps  2>/dev/null | /bin/grep -v status | /bin/grep -v Connect | /usr/bin/tail -1) 
    345 # 
    346 # An example for parallel printers like the HP Laserjet 5MP : 
    347 # 
    348 #     requester: external(/bin/cat /usr/share/pykota/pagecount.pjl >/dev/lp0 && /usr/bin/head -2 </dev/lp0 | /usr/bin/tail -1) 
    349 #  
    350 # This value can be set either globally or per printer or both. 
    351 # If both are defined, the printer option has priority. 
    352 # 
    353 # Some examples and comments provided by Bob Martel from csuohio.edu 
    354 # 
    355 # For several printers I could not get the page count using snmpget.  I 
    356 # resorted to snmpwalk: 
    357 #  
    358 # requester: external(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public %(printer)s | grep mib-2.43.10.2.1.4.1.1 | cut -d " " -f4) 
    359 # 
    360 # The last example is still more ugly, some of the printers only provided 
    361 # their counters without names, but at least always on the same line: 
    362 # 
    363 # requester: external(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public -Ov %(printer)s | grep Counter32 | tail -2 | head -1 | cut -d " " -f2) 
    364 # 
    365 # An example using netcat and a preformatted PJL job which you can find 
    366 # in the untested/pjl directory, which is sent to a JetDirect print 
    367 # server on port 9100 : 
    368 # 
    369 # requester: external(/bin/nc -w 2 %(printer)s 9100 </usr/share/pykota/pagecount.pjl | /usr/bin/tail -2) 
    370 # 
    371 # An example using the contributed pagecount.pl script which does  
    372 # the same as above, but should work on more printers :  
    373 # 
    374 # requester: external(/usr/share/pykota/pagecount.pl %(printer)s 9100) 
    375 # 
    376 # WARNING : In any case, when using an external requester, please test the command line outside 
    377 #           of PyKota before. This will save you some headaches in case it doesn't work as expected. 
    378 # 
    379 # The waitprinter.sh is there to wait until the printer is idle again. 
    380 # This should prevent a job to be sent to the printer while another one is  
    381 # not yet finished (not all pages are printed, but the complete job is in  
    382 # the printer) 
    383 # 
    384 # YOU ABSOLUTELY HAVE TO BE SURE YOU HAVE A SCRIPT WHICH WAITS FOR THE 
    385 # PRINTER BEING READY BEFORE ASKING FOR ITS INTERNAL PAGE COUNTER. 
    386 # 
    387 # PYKOTA INCLUDES SUCH SCRIPTS FOR SNMP AND APPLETALK PRINTERS, MORE TO COME 
    388 # 
    389 # default value 
    390 requester: external(/usr/share/pykota/waitprinter.sh %(printer)s && /usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") 
    391384 
    392385# Default policy for inexistant users (e.g. root) 
     
    395388# If both are defined, the printer option has priority. 
    396389# If the value is not set then the default policy DENY applies. 
    397 # ATTENTION : 
    398 #     Before 1.04 the default value was ALLOW, but unknown users 
    399 #     allowed to print causes accuracy problems : their jobs are 
    400 #     charged to the next person who prints on the same printer. 
    401390# There's no policy wrt inexistant groups, they are ignored. 
    402391# 
     
    441430# List of available environment variables : 
    442431# NB : Most of these variables are also available during the execution 
    443 # of external commands defined in the accounter, requester or mailto  
     432# of external commands defined in the accounter and mailto  
    444433# directives. 
    445434# 
  • pykota/trunk/docs/scripts.sgml

    r1406 r1483  
    2121     
    2222    <para> 
    23       When defining an external <literal>requester</literal> for a printer, it is important to wait for the printer being 
     23      When defining an hardware <literal>accounter</literal> for a printer, it is important to wait for the printer being 
    2424      <literal>idle</literal> before asking it for its internal page counter, otherwise results could 
    2525      be inaccurate. If the printer is asked while the job is still being printed, then the page counter's 
     
    4949     
    5050    <para> 
    51       When defining an external <literal>requester</literal> for a printer, it is important to wait for the printer being 
     51      When defining an hardware <literal>accounter</literal> for a printer, it is important to wait for the printer being 
    5252      <literal>idle</literal> before asking it for its internal page counter, otherwise results could 
    5353      be inaccurate. If the printer is asked while the job is still being printed, then the page counter's 
     
    9292    <title>pagecount.pl</title> 
    9393    <para> 
    94       This <application>Perl</application> script can be used in the <literal>requester</literal> directive of <filename>pykota.conf</filename>, 
     94      This <application>Perl</application> script can be used in the <literal>accounter</literal> directive of <filename>pykota.conf</filename>, 
    9595      to ask a printer for its internal page counter by sending a specially crafted <acronym>PJL</acronym> job 
    9696      to it over the AppSocket protocol, usually on <acronym>TCP</acronym> port 9100. 
     
    103103      to be in <literal>idle</literal> state, in something like : 
    104104<screen>       
    105 requester: external(somewaitscript.sh && pagecount.pl %(printer)s) 
     105accounter: hardware(somewaitscript.sh && pagecount.pl %(printer)s) 
    106106</screen> 
    107107    </para> 
     
    119119 
    120120$Log$ 
     121Revision 1.2  2004/05/18 14:48:48  jalet 
     122Big code changes to completely remove the need for "requester" directives, 
     123jsut use "hardware(... your previous requester directive's content ...)" 
     124 
    121125Revision 1.1  2004/03/16 14:42:31  jalet 
    122126Improved documentation 
  • pykota/trunk/NEWS

    r1482 r1483  
    2222PyKota NEWS : 
    2323 
     24    - 1.19alpha10 : 
     25     
     26        - configuration simplifications : the "accounter" directive's 
     27          'hardware' arguments now accepts what was in the "requester" 
     28          directive as it's content. The "requester" directive is not 
     29          supported anymore. See sample configuration file for details. 
     30         
    2431    - 1.19alpha9 : 
    2532        
  • pykota/trunk/po/br/pykota.po

    r1470 r1483  
    172172 
    173173#, python-format 
    174 msgid "Invalid external accounter %s for printer %s" 
    175 msgstr "Contador de p�nas externo %s inv�do, para a impressora %s" 
     174msgid "Invalid accounter %s for printer %s" 
     175msgstr "Contador de p�nas %s inv�do, para a impressora %s" 
    176176 
    177177#, python-format 
    178178msgid "Option accounter in section %s only supports values in %s" 
    179179msgstr "A op� accounter na se� %s s�porta valores em %s" 
    180  
    181 #, python-format 
    182 msgid "Option requester for printer %s was not set" 
    183 msgstr "A op� requester para a impressora %s n�foi configurada " 
    184  
    185 #, python-format 
    186 msgid "Invalid requester %s for printer %s" 
    187 msgstr "Requester inv�do %s para a impressora %s" 
    188  
    189 #, python-format 
    190 msgid "Option requester for printer %s only supports values in %s" 
    191 msgstr "a op� requester para a impresora %s s�porta valores em %s" 
    192180 
    193181#, python-format 
     
    291279 
    292280#, python-format 
    293 msgid "Unsupported requester backend %s" 
    294 msgstr "Requester backend %s n�suportado" 
    295  
    296 #, python-format 
    297281msgid "Unsupported quota storage backend %s" 
    298282msgstr "o banco de dados: %s  n�suportado" 
     
    438422 
    439423#, python-format 
    440 msgid "Unable to compute job size with external accounter %s" 
    441 msgstr "Impossivel calcular o tamanho do trabalho com o contador externo %s" 
     424msgid "Unable to compute job size with accounter %s" 
     425msgstr "Impossivel calcular o tamanho do trabalho com o contador %s" 
    442426 
    443427msgid "Using the 'stupid' accounting method is unreliable." 
     
    448432 
    449433#, python-format 
    450 msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 
    451 msgstr "Endere�invalido em  EXTERNAL(%s) para a impressora %s" 
    452  
    453 #, python-format 
    454 msgid "Unable to query printer %s via EXTERNAL(%s)" 
    455 msgstr "Imposive consultar a impressora %s via EXTERNAL(%s)" 
     434msgid "Unknown printer address in HARDWARE(%s) for printer %s" 
     435msgstr "Endere�invalido em  HARDWARE(%s) para a impressora %s" 
     436 
     437#, python-format 
     438msgid "Unable to query printer %s via HARDWARE(%s)" 
     439msgstr "Imposive consultar a impressora %s via HARDWARE(%s)" 
    456440 
    457441#, python-format 
     
    496480 
    497481#, python-format 
    498 msgid "SIGTERM was sent to external requester %s (pid: %s)" 
    499 msgstr "" 
    500  
    501 #, python-format 
    502482msgid "Impossible to connect to SMTP server : %s" 
    503483msgstr "" 
  • pykota/trunk/po/en/pykota.po

    r1470 r1483  
    174174 
    175175#, python-format 
    176 msgid "Invalid external accounter %s for printer %s" 
     176msgid "Invalid accounter %s for printer %s" 
    177177msgstr "" 
    178178 
    179179#, python-format 
    180180msgid "Option accounter in section %s only supports values in %s" 
    181 msgstr "" 
    182  
    183 #, python-format 
    184 msgid "Option requester for printer %s was not set" 
    185 msgstr "" 
    186  
    187 #, python-format 
    188 msgid "Invalid requester %s for printer %s" 
    189 msgstr "" 
    190  
    191 #, python-format 
    192 msgid "Option requester for printer %s only supports values in %s" 
    193181msgstr "" 
    194182 
     
    278266#, python-format 
    279267msgid "Unsupported reporter backend %s" 
    280 msgstr "" 
    281  
    282 #, python-format 
    283 msgid "Unsupported requester backend %s" 
    284268msgstr "" 
    285269 
     
    402386 
    403387#, python-format 
    404 msgid "Unable to compute job size with external accounter %s" 
     388msgid "Unable to compute job size with accounter %s" 
    405389msgstr "" 
    406390 
     
    412396 
    413397#, python-format 
    414 msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 
    415 msgstr "" 
    416  
    417 #, python-format 
    418 msgid "Unable to query printer %s via EXTERNAL(%s)" 
     398msgid "Unknown printer address in HARDWARE(%s) for printer %s" 
     399msgstr "" 
     400 
     401#, python-format 
     402msgid "Unable to query printer %s via HARDWARE(%s)" 
    419403msgstr "" 
    420404 
     
    460444 
    461445#, python-format 
    462 msgid "SIGTERM was sent to external requester %s (pid: %s)" 
    463 msgstr "" 
    464  
    465 #, python-format 
    466446msgid "Impossible to connect to SMTP server : %s" 
    467447msgstr "" 
  • pykota/trunk/po/es/pykota.po

    r1470 r1483  
    176176 
    177177#, python-format 
    178 msgid "Invalid external accounter %s for printer %s" 
    179 msgstr "Contador de p�nas externo %s inv�do, para la impresora %s" 
     178msgid "Invalid accounter %s for printer %s" 
     179msgstr "Contador de p�nas %s inv�do, para la impresora %s" 
    180180 
    181181#, python-format 
    182182msgid "Option accounter in section %s only supports values in %s" 
    183183msgstr "La opci�ccounter en la secci�s solo soporta valores en %s" 
    184  
    185 #, python-format 
    186 msgid "Option requester for printer %s was not set" 
    187 msgstr "La opci�equester para la impresora %s no ha sido establecida " 
    188  
    189 #, python-format 
    190 msgid "Invalid requester %s for printer %s" 
    191 msgstr "Requester inv�do %s para la impresora %s" 
    192  
    193 #, python-format 
    194 msgid "Option requester for printer %s only supports values in %s" 
    195 msgstr "La opci�equester para la impresora %s solo soporta valores en %s" 
    196184 
    197185#, python-format 
     
    295283 
    296284#, python-format 
    297 msgid "Unsupported requester backend %s" 
    298 msgstr "Requester backend %s no soportado " 
    299  
    300 #, python-format 
    301285msgid "Unsupported quota storage backend %s" 
    302286msgstr "Backend de almacenamiento de cuota no soportada %s" 
     
    439423 
    440424#, python-format 
    441 msgid "Unable to compute job size with external accounter %s" 
    442 msgstr "Imposible calcular el tama�el trabajo con el contador externo %s" 
     425msgid "Unable to compute job size with accounter %s" 
     426msgstr "Imposible calcular el tama�el trabajo con el contador %s" 
    443427 
    444428msgid "Using the 'stupid' accounting method is unreliable." 
     
    451435 
    452436#, python-format 
    453 msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 
    454 msgstr "Direcci�esconocida en EXTERNAL(%s) para la impresora %s" 
    455  
    456 #, python-format 
    457 msgid "Unable to query printer %s via EXTERNAL(%s)" 
    458 msgstr "Imposible consultar la impresora %s v�EXTERNAL(%s)" 
     437msgid "Unknown printer address in HARDWARE(%s) for printer %s" 
     438msgstr "Direcci�esconocida en HARDWARE(%s) para la impresora %s" 
     439 
     440#, python-format 
     441msgid "Unable to query printer %s via HARDWARE(%s)" 
     442msgstr "Imposible consultar la impresora %s v�HARDWARE(%s)" 
    459443 
    460444#, python-format 
     
    500484 
    501485#, python-format 
    502 msgid "SIGTERM was sent to external requester %s (pid: %s)" 
    503 msgstr "" 
    504  
    505 #, python-format 
    506486msgid "Impossible to connect to SMTP server : %s" 
    507487msgstr "" 
  • pykota/trunk/po/fr/pykota.po

    r1474 r1483  
    181181 
    182182#, python-format 
    183 msgid "Invalid external accounter %s for printer %s" 
    184 msgstr "Compteur de pages externe %s invalide pour l'imprimante %s" 
     183msgid "Invalid accounter %s for printer %s" 
     184msgstr "Compteur de pages %s invalide pour l'imprimante %s" 
    185185 
    186186#, python-format 
     
    188188msgstr "" 
    189189"L'option accounter pour l'imprimante %s supporte seulement les valeurs %s" 
    190  
    191 #, python-format 
    192 msgid "Option requester for printer %s was not set" 
    193 msgstr "L'option requester pour l'imprimante %s n'a pas � d�nie" 
    194  
    195 #, python-format 
    196 msgid "Invalid requester %s for printer %s" 
    197 msgstr "Requester %s invalide pour l'imprimante %s" 
    198  
    199 #, python-format 
    200 msgid "Option requester for printer %s only supports values in %s" 
    201 msgstr "" 
    202 "L'option requester pour l'imprimante %s supporte seulement les valeurs %s" 
    203190 
    204191#, python-format 
     
    298285msgstr "backend reporter %s non support� 
    299286#, python-format 
    300 msgid "Unsupported requester backend %s" 
    301 msgstr "Backend requester %s non support� 
    302 #, python-format 
    303287msgid "Unsupported quota storage backend %s" 
    304288msgstr "Backend de stockage de quota %s non support� 
     
    428412msgstr "L'utilisateur %s n'a toujours pas de quota sur l'imprimante %s dans le syst� PyKota, le travail d'impression sera rejet� 
    429413#, python-format 
    430 msgid "Unable to compute job size with external accounter %s" 
    431 msgstr "Impossible de calculer la taille du job avec le compteur externe %s" 
     414msgid "Unable to compute job size with accounter %s" 
     415msgstr "Impossible de calculer la taille du job avec le compteur %s" 
    432416 
    433417msgid "Using the 'stupid' accounting method is unreliable." 
     
    439423 
    440424#, python-format 
    441 msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 
    442 msgstr "Adresse inconnue dans EXTERNAL(%s) pour l'imprimante %s" 
    443  
    444 #, python-format 
    445 msgid "Unable to query printer %s via EXTERNAL(%s)" 
    446 msgstr "Impossible d'interroger l'imprimante %s via EXTERNAL(%s)" 
     425msgid "Unknown printer address in HARDWARE(%s) for printer %s" 
     426msgstr "Adresse inconnue dans HARDWARE(%s) pour l'imprimante %s" 
     427 
     428#, python-format 
     429msgid "Unable to query printer %s via HARDWARE(%s)" 
     430msgstr "Impossible d'interroger l'imprimante %s via HARDWARE(%s)" 
    447431 
    448432#, python-format 
     
    487471 
    488472#, python-format 
    489 msgid "SIGTERM was sent to external requester %s (pid: %s)" 
    490 msgstr "" 
    491  
    492 #, python-format 
    493473msgid "Impossible to connect to SMTP server : %s" 
    494474msgstr "Impossible de se connecter au serveur SMTP : %s" 
  • pykota/trunk/po/it/pykota.po

    r1470 r1483  
    174174 
    175175#, python-format 
    176 msgid "Invalid external accounter %s for printer %s" 
    177 msgstr "Accounter esterno non valido %s per la stampante %s" 
     176msgid "Invalid accounter %s for printer %s" 
     177msgstr "Accounter non valido %s per la stampante %s" 
    178178 
    179179#, python-format 
    180180msgid "Option accounter in section %s only supports values in %s" 
    181181msgstr "L'opzione accounter nella sezione %s supporta solamente i seguenti valori %s" 
    182  
    183 #, python-format 
    184 msgid "Option requester for printer %s was not set" 
    185 msgstr "Opzione richiedente per la stampante %s non impostata" 
    186  
    187 #, python-format 
    188 msgid "Invalid requester %s for printer %s" 
    189 msgstr "Richiedente non valido %s per la stampante %s" 
    190  
    191 #, python-format 
    192 msgid "Option requester for printer %s only supports values in %s" 
    193 msgstr "Opzione requester per la stampante %s supporta solamente i seguenti valori %s" 
    194182 
    195183#, python-format 
     
    293281 
    294282#, python-format 
    295 msgid "Unsupported requester backend %s" 
    296 msgstr "Requester backend non supportato %s" 
    297  
    298 #, python-format 
    299283msgid "Unsupported quota storage backend %s" 
    300284msgstr "Storage delle quote non supportato %s" 
     
    439423 
    440424#, python-format 
    441 msgid "Unable to compute job size with external accounter %s" 
    442 msgstr "Impossibile calcolare la dimensione della stampa con il metodo external %s" 
     425msgid "Unable to compute job size with accounter %s" 
     426msgstr "Impossibile calcolare la dimensione della stampa con il metodo %s" 
    443427 
    444428msgid "Using the 'stupid' accounting method is unreliable." 
     
    449433 
    450434#, python-format 
    451 msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 
    452 msgstr "Indirizzo stampante sconosciuto per EXTERNAL(%s) per la stampante %s" 
    453  
    454 #, python-format 
    455 msgid "Unable to query printer %s via EXTERNAL(%s)" 
    456 msgstr "Impossibile ottenere informazioni dalla stampante %s via EXTERNAL(%s)" 
     435msgid "Unknown printer address in HARDWARE(%s) for printer %s" 
     436msgstr "Indirizzo stampante sconosciuto per HARDWARE(%s) per la stampante %s" 
     437 
     438#, python-format 
     439msgid "Unable to query printer %s via HARDWARE(%s)" 
     440msgstr "Impossibile ottenere informazioni dalla stampante %s via HARDWARE(%s)" 
    457441 
    458442#, python-format 
     
    493477 
    494478#, python-format 
    495 msgid "SIGTERM was sent to external requester %s (pid: %s)" 
    496 msgstr "" 
    497  
    498 #, python-format 
    499479msgid "Impossible to connect to SMTP server : %s" 
    500480msgstr "" 
  • pykota/trunk/po/pt/pykota.po

    r1470 r1483  
    171171 
    172172#, python-format 
    173 msgid "Invalid external accounter %s for printer %s" 
    174 msgstr "Contador externo de p�nas %s inv�do, para a impressora %s" 
     173msgid "Invalid accounter %s for printer %s" 
     174msgstr "Contador de p�nas %s inv�do, para a impressora %s" 
    175175 
    176176#, python-format 
    177177msgid "Option accounter in section %s only supports values in %s" 
    178178msgstr "A op� accounter na sec� %s s�porta valores em %s" 
    179  
    180 #, python-format 
    181 msgid "Option requester for printer %s was not set" 
    182 msgstr "A op� requester para a impressora %s n�foi configurada" 
    183  
    184 #, python-format 
    185 msgid "Invalid requester %s for printer %s" 
    186 msgstr "Requester %s inv�do para a impressora %s" 
    187  
    188 #, python-format 
    189 msgid "Option requester for printer %s only supports values in %s" 
    190 msgstr "A op� requester para a impresora %s s�porta valores em %s" 
    191179 
    192180#, python-format 
     
    290278 
    291279#, python-format 
    292 msgid "Unsupported requester backend %s" 
    293 msgstr "Backend requester %s n�suportado" 
    294  
    295 #, python-format 
    296280msgid "Unsupported quota storage backend %s" 
    297281msgstr "Base de dados %s n�suportada" 
     
    437421 
    438422#, python-format 
    439 msgid "Unable to compute job size with external accounter %s" 
    440 msgstr "Foi imposs�l calcular o tamanho do trabalho com o contador externo %s" 
     423msgid "Unable to compute job size with accounter %s" 
     424msgstr "Foi imposs�l calcular o tamanho do trabalho com o contador %s" 
    441425 
    442426msgid "Using the 'stupid' accounting method is unreliable." 
     
    448432 
    449433#, python-format 
    450 msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 
    451 msgstr "Endere�inv�do em EXTERNAL(%s) para a impressora %s" 
    452  
    453 #, python-format 
    454 msgid "Unable to query printer %s via EXTERNAL(%s)" 
    455 msgstr "Foi imposs�l consultar a impressora %s via EXTERNAL(%s)" 
     434msgid "Unknown printer address in HARDWARE(%s) for printer %s" 
     435msgstr "Endere�inv�do em HARDWARE(%s) para a impressora %s" 
     436 
     437#, python-format 
     438msgid "Unable to query printer %s via HARDWARE(%s)" 
     439msgstr "Foi imposs�l consultar a impressora %s via HARDWARE(%s)" 
    456440 
    457441#, python-format 
     
    496480 
    497481#, python-format 
    498 msgid "SIGTERM was sent to external requester %s (pid: %s)" 
    499 msgstr "" 
    500  
    501 #, python-format 
    502482msgid "Impossible to connect to SMTP server : %s" 
    503483msgstr "" 
  • pykota/trunk/po/pykota.pot

    r1470 r1483  
    174174 
    175175#, python-format 
    176 msgid "Invalid external accounter %s for printer %s" 
     176msgid "Invalid accounter %s for printer %s" 
    177177msgstr "" 
    178178 
    179179#, python-format 
    180180msgid "Option accounter in section %s only supports values in %s" 
    181 msgstr "" 
    182  
    183 #, python-format 
    184 msgid "Option requester for printer %s was not set" 
    185 msgstr "" 
    186  
    187 #, python-format 
    188 msgid "Invalid requester %s for printer %s" 
    189 msgstr "" 
    190  
    191 #, python-format 
    192 msgid "Option requester for printer %s only supports values in %s" 
    193181msgstr "" 
    194182 
     
    278266#, python-format 
    279267msgid "Unsupported reporter backend %s" 
    280 msgstr "" 
    281  
    282 #, python-format 
    283 msgid "Unsupported requester backend %s" 
    284268msgstr "" 
    285269 
     
    402386 
    403387#, python-format 
    404 msgid "Unable to compute job size with external accounter %s" 
     388msgid "Unable to compute job size with accounter %s" 
    405389msgstr "" 
    406390 
     
    412396 
    413397#, python-format 
    414 msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 
    415 msgstr "" 
    416  
    417 #, python-format 
    418 msgid "Unable to query printer %s via EXTERNAL(%s)" 
     398msgid "Unknown printer address in HARDWARE(%s) for printer %s" 
     399msgstr "" 
     400 
     401#, python-format 
     402msgid "Unable to query printer %s via HARDWARE(%s)" 
    419403msgstr "" 
    420404 
     
    460444 
    461445#, python-format 
    462 msgid "SIGTERM was sent to external requester %s (pid: %s)" 
    463 msgstr "" 
    464  
    465 #, python-format 
    466446msgid "Impossible to connect to SMTP server : %s" 
    467447msgstr "" 
  • pykota/trunk/po/se/pykota.po

    r1470 r1483  
    174174 
    175175#, python-format 
    176 msgid "Invalid external accounter %s for printer %s" 
    177 msgstr "Ogiltig extern redovisningsmetod %s f�rintern %s" 
     176msgid "Invalid accounter %s for printer %s" 
     177msgstr "Ogiltig redovisningsmetod %s f�rintern %s" 
    178178 
    179179#, python-format 
    180180msgid "Option accounter in section %s only supports values in %s" 
    181181msgstr "Variabeln 'accounter' i sektion '%s' st�r bara v�en i %s" 
    182  
    183 #, python-format 
    184 msgid "Option requester for printer %s was not set" 
    185 msgstr "Variabeln 'requester' f�rinter %s var inte satt" 
    186  
    187 #, python-format 
    188 msgid "Invalid requester %s for printer %s" 
    189 msgstr "Ogiltigt v�e %s p�ariabeln 'requester' f�krivare %s" 
    190  
    191 #, python-format 
    192 msgid "Option requester for printer %s only supports values in %s" 
    193 msgstr "Variabeln 'requester' f�krivare %s st�r bara v�en i %s" 
    194182 
    195183#, python-format 
     
    292280 
    293281#, python-format 
    294 msgid "Unsupported requester backend %s" 
    295 msgstr "Ej underst�metod %s f�ariablen 'requester'" 
    296  
    297 #, python-format 
    298282msgid "Unsupported quota storage backend %s" 
    299283msgstr "Ej underst�metod %s f�tt lagra data" 
     
    438422 
    439423#, python-format 
    440 msgid "Unable to compute job size with external accounter %s" 
    441 msgstr "Kunde inte ber�a utskriftsstorlek med extern metod %s" 
     424msgid "Unable to compute job size with accounter %s" 
     425msgstr "Kunde inte ber�a utskriftsstorlek med metod %s" 
    442426 
    443427msgid "Using the 'stupid' accounting method is unreliable." 
     
    448432 
    449433#, python-format 
    450 msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 
    451 msgstr "Ok� skrivaradress i EXTERNAL(%s) f�krivare %s" 
    452  
    453 #, python-format 
    454 msgid "Unable to query printer %s via EXTERNAL(%s)" 
    455 msgstr "Kunde inte h�a information fr�skrivare %s via EXTERNAL(%s)" 
     434msgid "Unknown printer address in HARDWARE(%s) for printer %s" 
     435msgstr "Ok� skrivaradress i HARDWARE(%s) f�krivare %s" 
     436 
     437#, python-format 
     438msgid "Unable to query printer %s via HARDWARE(%s)" 
     439msgstr "Kunde inte h�a information fr�skrivare %s via HARDWARE(%s)" 
    456440 
    457441#, python-format 
     
    492476 
    493477#, python-format 
    494 msgid "SIGTERM was sent to external requester %s (pid: %s)" 
    495 msgstr "" 
    496  
    497 #, python-format 
    498478msgid "Impossible to connect to SMTP server : %s" 
    499479msgstr "" 
  • pykota/trunk/pykota/accounter.py

    r1285 r1483  
    2222# 
    2323# $Log$ 
     24# Revision 1.14  2004/05/18 14:49:19  jalet 
     25# Big code changes to completely remove the need for "requester" directives, 
     26# jsut use "hardware(... your previous requester directive's content ...)" 
     27# 
    2428# Revision 1.13  2004/01/12 22:43:40  jalet 
    2529# New formula to compute a job's price 
     
    6367 
    6468import sys 
     69from pykota import pdlanalyzer 
    6570 
    6671class PyKotaAccounterError(Exception): 
     
    8085        self.arguments = arguments 
    8186        self.isDelayed = 0      # Accounting is immediate by default 
     87        self.firstPassSize = None 
     88         
     89    def getSoftwareJobSize(self) :     
     90        """Pre-computes the job's size with a software method.""" 
     91        if self.filter.preserveinputfile is None : 
     92            raise PyKotaAccounterError, "Only supports raw jobs for now.""" 
     93        else :     
     94            fname = self.filter.preserveinputfile 
     95        parser = pdfanalyzer.PDLAnalyzer(fname)     
     96        try :  
     97            jobsize = parser.getJobSize() 
     98        except TypeError, msg :     
     99            raise PyKotaAccounterError, msg 
     100        else :     
     101            self.firstPassSize = jobsize 
    82102         
    83103    def getLastPageCounter(self) :     
    84104        """Returns last internal page counter value (possibly faked).""" 
    85105        try : 
    86             return self.LastPageCounter 
     106            return self.LastPageCounter or 0 
    87107        except :     
    88108            return 0 
  • pykota/trunk/pykota/accounters/hardware.py

    r1475 r1483  
    2222# 
    2323# $Log$ 
     24# Revision 1.2  2004/05/18 14:49:22  jalet 
     25# Big code changes to completely remove the need for "requester" directives, 
     26# jsut use "hardware(... your previous requester directive's content ...)" 
     27# 
    2428# Revision 1.1  2004/05/13 13:59:30  jalet 
    2529# Code simplifications 
     
    3034import sys 
    3135import os 
     36import popen2 
    3237from pykota.accounter import AccounterBase, PyKotaAccounterError 
    33 from pykota.requester import openRequester, PyKotaRequesterError 
    3438 
    3539class Accounter(AccounterBase) : 
     
    3741        """Initializes querying accounter.""" 
    3842        AccounterBase.__init__(self, kotabackend, arguments) 
    39         self.requester = openRequester(kotabackend, kotabackend.printername) 
    4043        self.isDelayed = 1 # With the pykota filter, accounting is delayed by one job 
    4144         
     
    4447        self.filter.logdebug("Reading printer's internal page counter...") 
    4548        try : 
    46             counter = self.requester.getPrinterPageCounter(self.filter.printerhostname) 
    47         except PyKotaRequesterError, msg : 
     49            counter = self.askPrinterPageCounter(self.filter.printerhostname) 
     50        except PyKotaAccounterError, msg : 
    4851            # can't get actual page counter, assume printer is off or warming up 
    4952            # log the message anyway. 
     
    97100        userpquota.Printer.addJobToHistory(self.filter.jobid, userpquota.User, counterbeforejob, action, filename=self.filter.preserveinputfile, title=self.filter.title, copies=self.filter.copies, options=self.filter.options) 
    98101        return action 
     102         
     103    def askPrinterPageCounter(self, printer) : 
     104        """Returns the page counter from the printer via an external command. 
     105         
     106           The external command must report the life time page number of the printer on stdout. 
     107        """ 
     108        commandline = self.arguments.strip() % locals() 
     109        if printer is None : 
     110            raise PyKotaAccounterError, _("Unknown printer address in HARDWARE(%s) for printer %s") % (commandline, self.filter.printername) 
     111        error = 1 
     112        pagecounter = None 
     113        child = popen2.Popen4(commandline)     
     114        try : 
     115            pagecounter = int(child.fromchild.readline().strip()) 
     116        except ValueError :     
     117            pass 
     118        except IOError :     
     119            # we were interrupted by a signal, certainely a SIGTERM 
     120            # caused by the user cancelling the current job 
     121            try : 
     122                os.kill(child.pid, signal.SIGTERM) 
     123            except :     
     124                pass # already killed ? 
     125            self.filter.logger.log_message(_("SIGTERM was sent to hardware accounter %s (pid: %s)") % (commandline, child.pid), "info") 
     126        else :     
     127            error = 0 
     128        child.fromchild.close()     
     129        child.tochild.close() 
     130        status = child.wait() 
     131        if (not error) and os.WIFEXITED(status) and (not os.WEXITSTATUS(status)) : 
     132            return pagecounter 
     133        else :     
     134            raise PyKotaAccounterError, _("Unable to query printer %s via HARDWARE(%s)") % (printer, commandline)  
    99135             
  • pykota/trunk/pykota/accounters/software.py

    r1475 r1483  
    2222# 
    2323# $Log$ 
     24# Revision 1.2  2004/05/18 14:49:23  jalet 
     25# Big code changes to completely remove the need for "requester" directives, 
     26# jsut use "hardware(... your previous requester directive's content ...)" 
     27# 
    2428# Revision 1.1  2004/05/13 13:59:30  jalet 
    2529# Code simplifications 
     
    4549            infile = open(self.filter.inputfile, "rb") 
    4650             
    47         # launches external accounter 
     51        # launches software accounter 
    4852        # TODO : USE tempfile.mkstemp() instead ! Needs some work ! 
    4953        infilename = tempfile.mktemp() 
     
    6872            # check exit status 
    6973            if (os.WIFEXITED(retcode) and not os.WEXITSTATUS(retcode)) or os.stat(errfilename) : 
    70                 # tries to extract the job size from the external accounter's 
     74                # tries to extract the job size from the software accounter's 
    7175                # standard output 
    7276                childoutput = open(outfilename, "r") 
     
    7478                    pagecount = int(childoutput.readline().strip()) 
    7579                except (AttributeError, ValueError) : 
    76                     self.filter.logger.log_message(_("Unable to compute job size with external accounter %s") % self.arguments) 
     80                    self.filter.logger.log_message(_("Unable to compute job size with accounter %s") % self.arguments) 
    7781                    pagecount = 0 
    7882                childoutput.close()     
    7983            else : 
    80                 self.filter.logger.log_message(_("Unable to compute job size with external accounter %s") % self.arguments) 
     84                self.filter.logger.log_message(_("Unable to compute job size with accounter %s") % self.arguments) 
    8185                pagecount = 0 
    8286            os.remove(infilename) 
     
    8690            # TODO : temporary files may remain on the filesystem... 
    8791            msg = "%s : %s" % (self.arguments, msg)  
    88             self.filter.logger.log_message(_("Unable to compute job size with external accounter %s") % msg) 
     92            self.filter.logger.log_message(_("Unable to compute job size with accounter %s") % msg) 
    8993            pagecount = 0 
    9094             
  • pykota/trunk/pykota/config.py

    r1475 r1483  
    2222# 
    2323# $Log$ 
     24# Revision 1.47  2004/05/18 14:49:20  jalet 
     25# Big code changes to completely remove the need for "requester" directives, 
     26# jsut use "hardware(... your previous requester directive's content ...)" 
     27# 
    2428# Revision 1.46  2004/05/13 13:59:28  jalet 
    2529# Code simplifications 
     
    311315        validaccounters = [ "hardware", "software" ]      
    312316        fullaccounter = self.getPrinterOption(printername, "accounter").strip() 
    313         if fullaccounter.lower().startswith("software") :     
     317        flower = fullaccounter.lower() 
     318        if flower.startswith("software") or flower.startswith("hardware") :     
    314319            try : 
    315320                (accounter, args) = [x.strip() for x in fullaccounter.split('(', 1)] 
    316321            except ValueError :     
    317                 raise PyKotaConfigError, _("Invalid external accounter %s for printer %s") % (fullaccounter, printername) 
     322                raise PyKotaConfigError, _("Invalid accounter %s for printer %s") % (fullaccounter, printername) 
    318323            if args.endswith(')') : 
    319324                args = args[:-1] 
    320325            if not args : 
    321                 raise PyKotaConfigError, _("Invalid external accounter %s for printer %s") % (fullaccounter, printername) 
     326                raise PyKotaConfigError, _("Invalid accounter %s for printer %s") % (fullaccounter, printername) 
    322327            return (accounter.lower(), args)     
    323         elif fullaccounter.lower() not in validaccounters : 
     328        else : 
    324329            raise PyKotaConfigError, _("Option accounter in section %s only supports values in %s") % (printername, str(validaccounters)) 
    325         else :     
    326             return (fullaccounter.lower(), None) 
    327330         
    328331    def getPreHook(self, printername) :     
     
    340343            return      # No command to launch in the post-hook 
    341344             
    342     def getRequesterBackend(self, printername) :     
    343         """Returns the requester backend to use for a given printer, with its arguments.""" 
    344         try : 
    345             fullrequester = self.getPrinterOption(printername, "requester") 
    346         except PyKotaConfigError :     
    347             # No requester defined, maybe it is not needed if accounting method 
    348             # is not set to 'hardware', but if we are called, then the accounting 
    349             # method really IS 'hardware', and so there's a big problem. 
    350             raise PyKotaConfigError, _("Option requester for printer %s was not set") % printername 
    351         else :     
    352             try : 
    353                 (requester, args) = [x.strip() for x in fullrequester.split('(', 1)] 
    354             except ValueError :     
    355                 raise PyKotaConfigError, _("Invalid requester %s for printer %s") % (fullrequester, printername) 
    356             if args.endswith(')') : 
    357                 args = args[:-1] 
    358             if not args : 
    359                 raise PyKotaConfigError, _("Invalid requester %s for printer %s") % (fullrequester, printername) 
    360             validrequesters = [ "external" ]  
    361             requester = requester.lower() 
    362             if requester not in validrequesters : 
    363                 raise PyKotaConfigError, _("Option requester for printer %s only supports values in %s") % (printername, str(validrequesters)) 
    364             return (requester, args) 
    365          
    366345    def getPrinterPolicy(self, printername) :     
    367346        """Returns the default policy for the current printer.""" 
  • pykota/trunk/pykota/Makefile.am

    r1482 r1483  
    77        logger.py               \ 
    88        reporter.py             \ 
    9         requester.py    \ 
    109        storage.py              \ 
    1110        tool.py                 \ 
     
    1312        version.py 
    1413 
    15 SUBDIRS = accounters loggers reporters requesters storages 
     14SUBDIRS = accounters loggers reporters storages 
    1615 
  • pykota/trunk/pykota/tool.py

    r1481 r1483  
    2222# 
    2323# $Log$ 
     24# Revision 1.88  2004/05/18 14:49:20  jalet 
     25# Big code changes to completely remove the need for "requester" directives, 
     26# jsut use "hardware(... your previous requester directive's content ...)" 
     27# 
    2428# Revision 1.87  2004/05/17 19:14:59  jalet 
    2529# Now catches SIGPIPE and SIGCHLD 
     
    764768         self.options, \ 
    765769         self.originalbackend) = self.extractInfoFromCupsOrLprng() 
    766         self.username = self.username or 'root'  
     770        self.username = self.username or 'root' # when printing test page from CUPS web interface, username is empty 
    767771        if self.config.getUserNameToLower() : 
    768772            self.username = self.username.lower() 
  • pykota/trunk/pykota/version.py

    r1478 r1483  
    2222# 
    2323 
    24 __version__ = "1.19alpha9_unofficial" 
     24__version__ = "1.19alpha10_unofficial" 
    2525 
    2626__doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng.""" 
  • pykota/trunk/setup.py

    r1476 r1483  
    2424# 
    2525# $Log$ 
     26# Revision 1.42  2004/05/18 14:48:46  jalet 
     27# Big code changes to completely remove the need for "requester" directives, 
     28# jsut use "hardware(... your previous requester directive's content ...)" 
     29# 
    2630# Revision 1.41  2004/05/13 14:17:32  jalet 
    2731# Warning about changed accounter and requester directives 
     
    301305                 
    302306        # now checks if pre-1.19alpha8 code is still there        
    303         for module in ["accounters/querying", "accounters/external", "requesters/snmp"] : 
     307        for module in ["accounters/querying", "accounters/external", "requesters/snmp", "requesters/external"] : 
    304308            checkOldModule(module) 
    305309         
     
    377381    dummy = raw_input("Please press ENTER when you have read the message above. ") 
    378382     
    379     sys.stdout.write("\n\nWARNING : IF YOU ARE UPGRADING FROM A PRE-1.19alpha8 TO 1.19alpha8 OR ABOVE\n") 
     383    sys.stdout.write("\n\nWARNING : IF YOU ARE UPGRADING FROM A PRE-1.19alpha10 TO 1.19alpha10 OR ABOVE\n") 
    380384    sys.stdout.write("YOU **MUST** MODIFY YOUR /etc/pykota/pykota.conf FILE BECAUSE accounter\n") 
    381385    sys.stdout.write("AND requester DIRECTIVES SUPPORTED VALUES HAVE CHANGED.\n\n") 
    382386    sys.stdout.write("YOU CAN DO THAT AFTER THE INSTALLATION IS FINISHED, OR PRESS CTRL+C NOW.\n") 
    383     sys.stdout.write("\n\nYOU DON'T HAVE ANYTHING SPECIAL TO DO IF THIS IS YOUR FIRST INSTALLATION\nOR IF YOU ARE ALREADY RUNNING VERSION 1.19alpha8 OR ABOVE.\n\n") 
     387    sys.stdout.write("\n\nYOU DON'T HAVE ANYTHING SPECIAL TO DO IF THIS IS YOUR FIRST INSTALLATION\nOR IF YOU ARE ALREADY RUNNING VERSION 1.19alpha10 OR ABOVE.\n\n") 
    384388    dummy = raw_input("Please press ENTER when you have read the message above. ") 
    385389     
     
    442446      author_email = "alet@librelogiciel.com", 
    443447      url = "http://www.librelogiciel.com/software/", 
    444       packages = [ "pykota", "pykota.storages", "pykota.requesters", "pykota.loggers", "pykota.accounters", "pykota.reporters" ], 
     448      packages = [ "pykota", "pykota.storages", "pykota.loggers", "pykota.accounters", "pykota.reporters" ], 
    445449      scripts = [ "bin/pkpgcounter", "bin/snmpprinterstatus", "bin/edpykota", "bin/repykota", "bin/warnpykota", "bin/pykotme", "bin/pkprinters", "bin/pkhint" ], 
    446450      data_files = data_files) 
  • pykota/trunk/untested/README

    r1257 r1483  
    2222This directory contains scripts which may be used to query printers  
    2323for their life time page counter, so you could define them as 
    24 external requesters in PyKota configuration file. 
     24hardware accounters in PyKota configuration file. 
    2525 
    2626They are completely untested, and you certainely have to edit them to