Changeset 780 for pykota/trunk

Show
Ignore:
Timestamp:
02/10/03 01:42:17 (22 years ago)
Author:
jalet
Message:

External requester should be ok (untested)
New syntax for configuration file wrt requesters

Location:
pykota/trunk
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/conf/pykota.conf.sample

    r738 r780  
    5252# 
    5353# How to query the lp printer for its page counter 
    54 # Only SNMP is currently supported 
    55 requester: snmp 
    56 # SNMP Community 
    57 snmpcmnty: public 
    58 # SNMP oid to query : this one seems to be specific to HP LaserJet printers 
    59 snmpoid: 43.10.2.1.4.1.1 
     54# Only snmp(community, oid) and external(command) are supported 
     55# e.g. :  
     56#     external(snmpget -c public -Ov %(printer)s 43.10.2.1.4.1.1 | cut -f 2,2 -d " ") 
     57# and : 
     58#     snmp(public, 43.10.2.1.4.1.1) 
     59# are equivalent 
     60requester: snmp(public, 43.10.2.1.4.1.1) 
    6061# 
    6162# Default policy for inexistant users (e.g. root) 
  • pykota/trunk/po/en/pykota.po

    r779 r780  
    1515# 
    1616# $Log$ 
    17 # Revision 1.3  2003/02/09 23:11:24  jalet 
    18 # I have to learn how to use these things. 
     17# Revision 1.4  2003/02/10 00:42:17  jalet 
     18# External requester should be ok (untested) 
     19# New syntax for configuration file wrt requesters 
    1920# 
    2021# Revision 1.3  2003/02/09 14:02:31  jalet 
     
    4546"Generated-By: pygettext.py 1.3\n" 
    4647 
    47  
    48 #: edpykota:209 
    4948msgid "Undefined soft limit set to hard limit (%s) on printer %s." 
    5049msgstr "" 
    5150 
    52 #: edpykota:191 
    5351msgid "Hard limit %i is less than soft limit %i, values will be exchanged." 
    5452msgstr "" 
    5553 
    56 #: warnpykota:141 
    5754msgid "warnpykota: option --group is currently not implemented." 
    5855msgstr "" 
    5956 
    60 #: edpykota:287 
    6157msgid "edpykota: option --group is currently not implemented." 
    6258msgstr "" 
    6359 
    64 #: repykota:107 
    6560msgid "Pages grace time: %idays" 
    6661msgstr "" 
    6762 
    68 #: repykota:177 
    6963msgid "repykota: unused arguments [%s]. Aborting." 
    7064msgstr "" 
    7165 
    72 #: edpykota:183 
    7366msgid "Invalid softlimit value %s." 
    7467msgstr "" 
    7568 
    76 #: edpykota:200 
    7769msgid "Prototype %s not found in Quota Storage for printer %s." 
    7870msgstr "" 
    7971 
    80 #: edpykota:285 
    8172msgid "edpykota: options --softlimit or --hardlimit and --prototype are incompatible." 
    8273msgstr "" 
    8374 
    84 #: pykota:114 
    8575msgid "Printer %s not registered in the PyKota system" 
    8676msgstr "" 
    8777 
    88 #: repykota:175 
    8978msgid "repykota: option --group is currently not implemented." 
    9079msgstr "" 
    9180 
    92 #: edpykota:237 
    9381msgid "Quota not found for object %s on printer %s." 
    9482msgstr "" 
    9583 
    96 #: repykota:173 
    9784msgid "repykota: options --users and --groups are incompatible." 
    9885msgstr "" 
    9986 
    100 #: edpykota:229 
    10187msgid "Invalid user name %s" 
    10288msgstr "" 
    10389 
    104 #: edpykota:211 
    10590msgid "Both hard and soft limits must be set ! Aborting." 
    10691msgstr "" 
    10792 
    108 #: warnpykota:139 
    10993msgid "warnpykota: options --users and --groups are incompatible." 
    11094msgstr "" 
    11195 
    112 #: edpykota:206 
    11396msgid "Undefined hard limit set to soft limit (%s) on printer %s." 
    11497msgstr "" 
    11598 
    116 #: edpykota:283 
    11799msgid "edpykota: options --users and --groups are incompatible." 
    118100msgstr "" 
    119101 
    120 #: warnpykota:143 
    121102msgid "warnpykota: unused arguments [%s]. Aborting." 
    122103msgstr "" 
    123104 
    124 #: edpykota:188 
    125105msgid "Invalid hardlimit value %s." 
    126106msgstr "" 
    127107 
    128 #: repykota:116 
    129108msgid "Group            used     soft     hard   grace        total" 
    130109msgstr "" 
    131110 
    132 #: edpykota:177 warnpykota:102 repykota:104 
    133111msgid "There's no printer matching %s" 
    134112msgstr "" 
    135113 
    136 #: repykota:106 
    137114msgid "*** Report for %s quota on printer %s" 
    138115msgstr "" 
    139116 
    140 #: pykota:137 
    141117msgid "Error in page count value %i for user %s on printer %s" 
    142118msgstr "" 
    143119 
    144 #: edpykota:235 
    145120msgid "Invalid group name %s" 
    146121msgstr "" 
    147122 
    148 #: repykota:110 
    149123msgid "User             used     soft     hard   grace        total" 
    150124msgstr "" 
    151125 
    152 #: edpykota:175 
    153126msgid "Invalid printer name %s" 
    154127msgstr "" 
    155128 
    156  
    157 #: config.py:97 
    158 msgid "Option requester in section %s only supports values in %s" 
    159 msgstr "" 
    160  
    161 #: tool.py:263 tool.py:268 
     129msgid "Option requester for printer %s only supports values in %s" 
     130msgstr "" 
     131 
    162132msgid "Print Quota Exceeded" 
    163133msgstr "" 
    164134 
    165 #: tool.py:269 
    166135msgid "Print Quota" 
    167136msgstr "" 
    168137 
    169 #: requesters/external.py:31 requesters/external.py:38 
    170138msgid "Requester not implemented yet." 
    171139msgstr "" 
    172140 
    173 #: config.py:88 config.py:101 
    174141msgid "Option %s not found in section %s of %s" 
    175142msgstr "" 
    176143 
    177 #: tool.py:268 
    178144msgid "" 
    179145"You will soon be forbidden to print anymore because\n" 
     
    181147msgstr "" 
    182148 
    183 #: tool.py:202 
    184149msgid "" 
    185150"\n" 
     
    190155msgstr "" 
    191156 
    192 #: config.py:152 
    193157msgid "Invalid grace delay %s" 
    194158msgstr "" 
    195159 
    196 #: config.py:78 
    197160msgid "Option logger only supports values in %s" 
    198161msgstr "" 
    199162 
    200 #: config.py:73 
    201163msgid "Option %s not found in section global of %s" 
    202164msgstr "" 
    203165 
    204 #: config.py:82 
    205166msgid "Option method only supports values in %s" 
    206167msgstr "" 
    207168 
    208 #: tool.py:219 
    209169msgid "Unable to match user %s on printer %s, applying default policy (%s)" 
    210170msgstr "" 
    211171 
    212 #: tool.py:252 
    213172msgid "Group quotas are currently not implemented." 
    214173msgstr "" 
    215174 
    216 #: requesters/snmp.py:47 
    217175msgid "Unknown printer address in SNMP(%s, %s) for printer %s" 
    218176msgstr "" 
    219177 
    220 #: tool.py:266 
    221178msgid "Print Quota soft limit exceeded for user %s on printer %s" 
    222179msgstr "" 
    223180 
    224 #: logger.py:49 
    225181msgid "Unsupported logging subsystem %s" 
    226182msgstr "" 
    227183 
    228 #: requesters/snmp.py:52 
    229184msgid "Unable to query printer %s via SNMP(%s, %s)" 
    230185msgstr "" 
    231186 
    232 #: requester.py:47 
    233187msgid "Unsupported requester backend %s" 
    234188msgstr "" 
    235189 
    236 #: config.py:92 
    237190msgid "Option policy in section %s only supports values in %s" 
    238191msgstr "" 
    239192 
    240 #: storage.py:111 
    241193msgid "Unsupported quota storage backend %s" 
    242194msgstr "" 
    243195 
    244 #: tool.py:263 
    245196msgid "" 
    246197"You are not allowed to print anymore because\n" 
     
    248199msgstr "" 
    249200 
    250 #: tool.py:261 
    251201msgid "Print Quota exceeded for user %s on printer %s" 
    252202msgstr "" 
    253203 
    254  
     204msgid "Invalid requester for printer %s" 
     205msgstr "" 
     206 
     207msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 
     208msgstr "" 
     209 
     210msgid "Unable to query printer %s via EXTERNAL(%s)" 
     211msgstr "" 
  • pykota/trunk/po/fr/pykota.po

    r776 r780  
    1515# 
    1616# $Log$ 
     17# Revision 1.2  2003/02/10 00:42:17  jalet 
     18# External requester should be ok (untested) 
     19# New syntax for configuration file wrt requesters 
     20# 
    1721# Revision 1.1  2003/02/09 14:02:31  jalet 
    1822# French translation was added 
     
    4347 
    4448 
    45 #: edpykota:209 
    4649msgid "Undefined soft limit set to hard limit (%s) on printer %s." 
    4750msgstr "Limite souple ind�nie, positionn��a limite dure (%s) sur l'imprimante %s." 
    4851 
    49 #: edpykota:191 
    5052msgid "Hard limit %i is less than soft limit %i, values will be exchanged." 
    5153msgstr "Limite dure %i est inf�eure �a limite souple %i, les valeurs seront �ang�. " 
    5254 
    53 #: warnpykota:141 
    5455msgid "warnpykota: option --groups is currently not implemented." 
    5556msgstr "warnpykota: l'option --groups n'est pas encore impl�nt�" 
    5657 
    57 #: edpykota:287 
    5858msgid "edpykota: option --groups is currently not implemented." 
    5959msgstr "edpykota: l'option --groups n'est pas encore impl�nt�" 
    6060 
    61 #: repykota:107 
    6261msgid "Pages grace time: %idays" 
    6362msgstr "D�i de gr�: %ijours" 
    6463 
    65 #: repykota:177 
    6664msgid "repykota: unused arguments [%s]. Aborting." 
    6765msgstr "repykota: arguments [%s] inutilis� Abandon." 
    6866 
    69 #: edpykota:183 
    7067msgid "Invalid softlimit value %s." 
    7168msgstr "Valeur %s invalide pour la limite souple." 
    7269 
    73 #: edpykota:200 
    7470msgid "Prototype %s not found in Quota Storage for printer %s." 
    7571msgstr "Prototype %s non trouv�ans le Quota Storage pour l'imprimante %s." 
    7672 
    77 #: edpykota:285 
    7873msgid "edpykota: options --softlimit or --hardlimit and --prototype are incompatible." 
    7974msgstr "edpykota: les options --softlimit ou --hardlimit et --prototype sont incompatibles." 
    8075 
    81 #: pykota:114 
    8276msgid "Printer %s not registered in the PyKota system" 
    8377msgstr "Imprimante %s non enregistr�dans le syst� PyKota" 
    8478 
    85 #: repykota:175 
    8679msgid "repykota: option --groups is currently not implemented." 
    8780msgstr "repykota: l'option --groups n'est pas encore impl�nt�" 
    8881 
    89 #: edpykota:237 
    9082msgid "Quota not found for object %s on printer %s." 
    9183msgstr "Quota non trouv�our l'objet %s sur l'imprimante %s." 
    9284 
    93 #: repykota:173 
    9485msgid "repykota: options --users and --groups are incompatible." 
    9586msgstr "repykota: les options --users et --groups sont incompatibles." 
    9687 
    97 #: edpykota:229 
    9888msgid "Invalid user name %s" 
    9989msgstr "Nom d'utilisateur %s invalide" 
    10090 
    101 #: edpykota:211 
    10291msgid "Both hard and soft limits must be set ! Aborting." 
    10392msgstr "Les limites dures et souples doivent �e positionn� ! Abandon." 
    10493 
    105 #: warnpykota:139 
    10694msgid "warnpykota: options --users and --groups are incompatible." 
    10795msgstr "warnpykota: les options --users et --groups sont incompatibles." 
    10896 
    109 #: edpykota:206 
    11097msgid "Undefined hard limit set to soft limit (%s) on printer %s." 
    11198msgstr "Limite dure ind�nie, positionn��a limite souple (%s) sur l'imprimante %s." 
    11299 
    113 #: edpykota:283 
    114100msgid "edpykota: options --users and --groups are incompatible." 
    115101msgstr "edykota: les options --users et --groups sont incompatibles." 
    116102 
    117 #: warnpykota:143 
    118103msgid "warnpykota: unused arguments [%s]. Aborting." 
    119104msgstr "warnkota: arguments [%s] inutilis� Abandon." 
    120105 
    121 #: edpykota:188 
    122106msgid "Invalid hardlimit value %s." 
    123107msgstr "Valeur %s invalide pour la limite dure." 
    124108 
    125 #: repykota:116 
    126109msgid "Group            used     soft     hard   grace        total" 
    127110msgstr "Groupe           used     soft     hard   grace        total" 
    128111 
    129 #: edpykota:177 warnpykota:102 repykota:104 
    130112msgid "There's no printer matching %s" 
    131113msgstr "Aucune imprimante ne correspond �s" 
    132114 
    133 #: repykota:106 
    134115msgid "*** Report for %s quota on printer %s" 
    135116msgstr "*** Rapport pour le quota %s sur l'imprimante %s" 
    136117 
    137 #: pykota:137 
    138118msgid "Error in page count value %i for user %s on printer %s" 
    139119msgstr "Erreur dans la valeur %i du nombre de page pour l'utilisateur %s sur l'imprimante %s" 
    140120 
    141 #: edpykota:235 
    142121msgid "Invalid group name %s" 
    143122msgstr "Nom de groupe %s invalide" 
    144123 
    145 #: repykota:110 
    146124msgid "User             used     soft     hard   grace        total" 
    147125msgstr "Utilisateur      used     soft     hard   grace        total" 
    148126 
    149 #: edpykota:175 
    150127msgid "Invalid printer name %s" 
    151128msgstr "Nom d'imprimante %s invalide" 
    152129 
    153  
    154 #: config.py:97 
    155 msgid "Option requester in section %s only supports values in %s" 
    156 msgstr "L'option requester dans la section %s supporte seulement les valeurs %s" 
    157  
    158 #: tool.py:263 tool.py:268 
     130msgid "Option requester for printer %s only supports values in %s" 
     131msgstr "L'option requester pour l'imprimante %s supporte seulement les valeurs %s" 
     132 
    159133msgid "Print Quota Exceeded" 
    160134msgstr "D�ssement de Quota d'Impression" 
    161135 
    162 #: tool.py:269 
    163136msgid "Print Quota" 
    164137msgstr "Quota d'Impression" 
    165138 
    166 #: requesters/external.py:31 requesters/external.py:38 
    167139msgid "Requester not implemented yet." 
    168140msgstr "Requester non encore impl�nt� 
    169141 
    170 #: config.py:88 config.py:101 
    171142msgid "Option %s not found in section %s of %s" 
    172143msgstr "Option %s non trouv�dans la section %s de %s" 
    173144 
    174 #: tool.py:268 
    175145msgid "" 
    176146"You will soon be forbidden to print anymore because\n" 
     
    180150"votre Quota d'Impression sur l'imprimante %s est presque atteint." 
    181151 
    182 #: tool.py:202 
    183152msgid "" 
    184153"\n" 
     
    194163"\t%s - <%s>\n" 
    195164 
    196 #: config.py:152 
    197165msgid "Invalid grace delay %s" 
    198166msgstr "D�i de gr� %s invalide" 
    199167 
    200 #: config.py:78 
    201168msgid "Option logger only supports values in %s" 
    202169msgstr "L'option logger supporte seulement les valeurs %s" 
    203170 
    204 #: config.py:73 
    205171msgid "Option %s not found in section global of %s" 
    206172msgstr "Option %s non trouv�dans la section global de %s" 
    207173 
    208 #: config.py:82 
    209174msgid "Option method only supports values in %s" 
    210175msgstr "L'option method supporte seulement les valeurs %s" 
    211176 
    212 #: tool.py:219 
    213177msgid "Unable to match user %s on printer %s, applying default policy (%s)" 
    214178msgstr "Impossible de trouver l'utilisateur %s sur l'imprimante %s, action par d�ut (%s) appliqu� 
    215179 
    216 #: tool.py:252 
    217180msgid "Group quotas are currently not implemented." 
    218181msgstr "Les quota de groupes ne sont pas encore impl�nt�" 
    219182 
    220 #: requesters/snmp.py:47 
    221183msgid "Unknown printer address in SNMP(%s, %s) for printer %s" 
    222184msgstr "Adresse d'imprimante inconnue dans SNMP(%s, %s) pour l'imprimante %s" 
    223185 
    224 #: tool.py:266 
    225186msgid "Print Quota soft limit exceeded for user %s on printer %s" 
    226187msgstr "Limite souple de Quota d'Impression d�ss�pour l'utilisateur %s sur l'imprimante %s" 
    227188 
    228 #: logger.py:49 
    229189msgid "Unsupported logging subsystem %s" 
    230190msgstr "Syst� de log %s non support� 
    231 #: requesters/snmp.py:52 
    232191msgid "Unable to query printer %s via SNMP(%s, %s)" 
    233192msgstr "Impossible d'interroger l'imprimante %s par SNMP(%s, %s)" 
    234193 
    235 #: requester.py:47 
    236194msgid "Unsupported requester backend %s" 
    237195msgstr "Backend requester %s non support� 
    238196 
    239 #: config.py:92 
    240197msgid "Option policy in section %s only supports values in %s" 
    241198msgstr "L'option policy dans la section %s supporte seulement les valeurs %s" 
    242199 
    243 #: storage.py:111 
    244200msgid "Unsupported quota storage backend %s" 
    245201msgstr "Backend de stockage de quota %s non support� 
    246 #: tool.py:263 
    247202msgid "" 
    248203"You are not allowed to print anymore because\n" 
     
    252207"votre Quota d'Impression est d�ss�ur l'imprimante %s." 
    253208 
    254 #: tool.py:261 
    255209msgid "Print Quota exceeded for user %s on printer %s" 
    256210msgstr "D�ssement de Quota d'Impression pour l'utilisateur %s sur l'imprimante %s" 
    257211 
    258  
     212msgid "Invalid requester for printer %s" 
     213msgstr "Requester invalide pour l'imprimante %s" 
     214 
     215msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 
     216msgstr "Adresse inconnue dans EXTERNAL(%s) pour l'imprimante %s" 
     217 
     218msgid "Unable to query printer %s via EXTERNAL(%s)" 
     219msgstr "Impossible d'interroger l'imprimante %s via EXTERNAL(%s)" 
  • pykota/trunk/po/pykota.pot

    r776 r780  
    1515# 
    1616# $Log$ 
     17# Revision 1.4  2003/02/10 00:42:17  jalet 
     18# External requester should be ok (untested) 
     19# New syntax for configuration file wrt requesters 
     20# 
    1721# Revision 1.3  2003/02/09 14:02:31  jalet 
    1822# French translation was added 
     
    4246"Generated-By: pygettext.py 1.3\n" 
    4347 
    44  
    45 #: edpykota:209 
    4648msgid "Undefined soft limit set to hard limit (%s) on printer %s." 
    4749msgstr "" 
    4850 
    49 #: edpykota:191 
    5051msgid "Hard limit %i is less than soft limit %i, values will be exchanged." 
    5152msgstr "" 
    5253 
    53 #: warnpykota:141 
    5454msgid "warnpykota: option --group is currently not implemented." 
    5555msgstr "" 
    5656 
    57 #: edpykota:287 
    5857msgid "edpykota: option --group is currently not implemented." 
    5958msgstr "" 
    6059 
    61 #: repykota:107 
    6260msgid "Pages grace time: %idays" 
    6361msgstr "" 
    6462 
    65 #: repykota:177 
    6663msgid "repykota: unused arguments [%s]. Aborting." 
    6764msgstr "" 
    6865 
    69 #: edpykota:183 
    7066msgid "Invalid softlimit value %s." 
    7167msgstr "" 
    7268 
    73 #: edpykota:200 
    7469msgid "Prototype %s not found in Quota Storage for printer %s." 
    7570msgstr "" 
    7671 
    77 #: edpykota:285 
    7872msgid "edpykota: options --softlimit or --hardlimit and --prototype are incompatible." 
    7973msgstr "" 
    8074 
    81 #: pykota:114 
    8275msgid "Printer %s not registered in the PyKota system" 
    8376msgstr "" 
    8477 
    85 #: repykota:175 
    8678msgid "repykota: option --group is currently not implemented." 
    8779msgstr "" 
    8880 
    89 #: edpykota:237 
    9081msgid "Quota not found for object %s on printer %s." 
    9182msgstr "" 
    9283 
    93 #: repykota:173 
    9484msgid "repykota: options --users and --groups are incompatible." 
    9585msgstr "" 
    9686 
    97 #: edpykota:229 
    9887msgid "Invalid user name %s" 
    9988msgstr "" 
    10089 
    101 #: edpykota:211 
    10290msgid "Both hard and soft limits must be set ! Aborting." 
    10391msgstr "" 
    10492 
    105 #: warnpykota:139 
    10693msgid "warnpykota: options --users and --groups are incompatible." 
    10794msgstr "" 
    10895 
    109 #: edpykota:206 
    11096msgid "Undefined hard limit set to soft limit (%s) on printer %s." 
    11197msgstr "" 
    11298 
    113 #: edpykota:283 
    11499msgid "edpykota: options --users and --groups are incompatible." 
    115100msgstr "" 
    116101 
    117 #: warnpykota:143 
    118102msgid "warnpykota: unused arguments [%s]. Aborting." 
    119103msgstr "" 
    120104 
    121 #: edpykota:188 
    122105msgid "Invalid hardlimit value %s." 
    123106msgstr "" 
    124107 
    125 #: repykota:116 
    126108msgid "Group            used     soft     hard   grace        total" 
    127109msgstr "" 
    128110 
    129 #: edpykota:177 warnpykota:102 repykota:104 
    130111msgid "There's no printer matching %s" 
    131112msgstr "" 
    132113 
    133 #: repykota:106 
    134114msgid "*** Report for %s quota on printer %s" 
    135115msgstr "" 
    136116 
    137 #: pykota:137 
    138117msgid "Error in page count value %i for user %s on printer %s" 
    139118msgstr "" 
    140119 
    141 #: edpykota:235 
    142120msgid "Invalid group name %s" 
    143121msgstr "" 
    144122 
    145 #: repykota:110 
    146123msgid "User             used     soft     hard   grace        total" 
    147124msgstr "" 
    148125 
    149 #: edpykota:175 
    150126msgid "Invalid printer name %s" 
    151127msgstr "" 
    152128 
    153  
    154 #: config.py:97 
    155 msgid "Option requester in section %s only supports values in %s" 
    156 msgstr "" 
    157  
    158 #: tool.py:263 tool.py:268 
     129msgid "Option requester for printer %s only supports values in %s" 
     130msgstr "" 
     131 
    159132msgid "Print Quota Exceeded" 
    160133msgstr "" 
    161134 
    162 #: tool.py:269 
    163135msgid "Print Quota" 
    164136msgstr "" 
    165137 
    166 #: requesters/external.py:31 requesters/external.py:38 
    167138msgid "Requester not implemented yet." 
    168139msgstr "" 
    169140 
    170 #: config.py:88 config.py:101 
    171141msgid "Option %s not found in section %s of %s" 
    172142msgstr "" 
    173143 
    174 #: tool.py:268 
    175144msgid "" 
    176145"You will soon be forbidden to print anymore because\n" 
     
    178147msgstr "" 
    179148 
    180 #: tool.py:202 
    181149msgid "" 
    182150"\n" 
     
    187155msgstr "" 
    188156 
    189 #: config.py:152 
    190157msgid "Invalid grace delay %s" 
    191158msgstr "" 
    192159 
    193 #: config.py:78 
    194160msgid "Option logger only supports values in %s" 
    195161msgstr "" 
    196162 
    197 #: config.py:73 
    198163msgid "Option %s not found in section global of %s" 
    199164msgstr "" 
    200165 
    201 #: config.py:82 
    202166msgid "Option method only supports values in %s" 
    203167msgstr "" 
    204168 
    205 #: tool.py:219 
    206169msgid "Unable to match user %s on printer %s, applying default policy (%s)" 
    207170msgstr "" 
    208171 
    209 #: tool.py:252 
    210172msgid "Group quotas are currently not implemented." 
    211173msgstr "" 
    212174 
    213 #: requesters/snmp.py:47 
    214175msgid "Unknown printer address in SNMP(%s, %s) for printer %s" 
    215176msgstr "" 
    216177 
    217 #: tool.py:266 
    218178msgid "Print Quota soft limit exceeded for user %s on printer %s" 
    219179msgstr "" 
    220180 
    221 #: logger.py:49 
    222181msgid "Unsupported logging subsystem %s" 
    223182msgstr "" 
    224183 
    225 #: requesters/snmp.py:52 
    226184msgid "Unable to query printer %s via SNMP(%s, %s)" 
    227185msgstr "" 
    228186 
    229 #: requester.py:47 
    230187msgid "Unsupported requester backend %s" 
    231188msgstr "" 
    232189 
    233 #: config.py:92 
    234190msgid "Option policy in section %s only supports values in %s" 
    235191msgstr "" 
    236192 
    237 #: storage.py:111 
    238193msgid "Unsupported quota storage backend %s" 
    239194msgstr "" 
    240195 
    241 #: tool.py:263 
    242196msgid "" 
    243197"You are not allowed to print anymore because\n" 
     
    245199msgstr "" 
    246200 
    247 #: tool.py:261 
    248201msgid "Print Quota exceeded for user %s on printer %s" 
    249202msgstr "" 
    250203 
    251  
     204msgid "Invalid requester for printer %s" 
     205msgstr "" 
     206 
     207msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 
     208msgstr "" 
     209 
     210msgid "Unable to query printer %s via EXTERNAL(%s)" 
     211msgstr "" 
  • pykota/trunk/pykota/config.py

    r773 r780  
    1515# 
    1616# $Log$ 
     17# Revision 1.8  2003/02/10 00:42:17  jalet 
     18# External requester should be ok (untested) 
     19# New syntax for configuration file wrt requesters 
     20# 
    1721# Revision 1.7  2003/02/09 13:05:43  jalet 
    1822# Internationalization continues... 
     
    9599                raise PyKotaConfigError, _("Option policy in section %s only supports values in %s") % (printer, str(validpolicies)) 
    96100             
    97             validrequesters = [ "snmp" ] # TODO : add more requesters 
    98             requester = self.config.get(printer, "requester").lower() 
    99             if requester not in validrequesters : 
    100                 raise PyKotaConfigError, _("Option requester in section %s only supports values in %s") % (printer, str(validrequesters)) 
    101             if requester == "snmp" : 
    102                 for poption in [ "snmpcmnty", "snmpoid" ] :  
    103                     if not self.config.has_option(printer, poption) : 
    104                         raise PyKotaConfigError, _("Option %s not found in section %s of %s") % (option, printer, self.filename) 
     101            validrequesters = [ "snmp", "external" ] # TODO : add more requesters 
     102            fullrequester = self.config.get(printer, "requester") 
     103            try : 
     104                (requester, args) = [x.strip() for x in fullrequester.split('('))] 
     105            except ValueError :     
     106                raise PyKotaConfigError, _("Invalid requester for printer %s") % printer 
     107            else : 
     108                if requester not in validrequesters : 
     109                    raise PyKotaConfigError, _("Option requester for printer %s only supports values in %s") % (printer, str(validrequesters)) 
    105110                         
    106111    def getPrinterNames(self) :     
     
    128133         
    129134    def getRequesterBackend(self, printer) :     
    130         """Returns the requester backend to use for a given printer.""" 
    131         return self.config.get(printer, "requester").lower() 
     135        """Returns the requester backend to use for a given printer, with its arguments.""" 
     136        fullrequester = self.config.get(printer, "requester") 
     137        (requester, args) = [x.strip() for x in fullrequester.split('('))] 
     138        if args.endswith(')') : 
     139            args = args[:-1] 
     140        args = [x.strip() for x in args.split(',')] 
     141        if not args : 
     142            raise PyKotaConfigError, _("Invalid requester for printer %s") % printer 
     143        return (requester, args) 
    132144         
    133145    def getPrinterPolicy(self, printer) :     
  • pykota/trunk/pykota/requester.py

    r773 r780  
    1515# 
    1616# $Log$ 
     17# Revision 1.5  2003/02/10 00:42:17  jalet 
     18# External requester should be ok (untested) 
     19# New syntax for configuration file wrt requesters 
     20# 
    1721# Revision 1.4  2003/02/09 13:05:43  jalet 
    1822# Internationalization continues... 
     
    4145def openRequester(config, printername) : 
    4246    """Returns a connection handle to the appropriate requester.""" 
    43     backend = config.getRequesterBackend(printername) 
     47    (backend, args) = config.getRequesterBackend(printername) 
    4448    try : 
    4549        if not backend.isalpha() : 
     
    5054        raise PyKotaRequesterError, _("Unsupported requester backend %s") % backend 
    5155    else :     
    52         return getattr(requesterbackend, "Requester")(config, printername) 
     56        return getattr(requesterbackend, "Requester")(config, printername, args) 
  • pykota/trunk/pykota/requesters/external.py

    r773 r780  
    1515# 
    1616# $Log$ 
     17# Revision 1.3  2003/02/10 00:42:17  jalet 
     18# External requester should be ok (untested) 
     19# New syntax for configuration file wrt requesters 
     20# 
    1721# Revision 1.2  2003/02/09 13:05:43  jalet 
    1822# Internationalization continues... 
     
    2933class Requester : 
    3034    """A class to send queries to printers via external commands.""" 
    31     def __init__(self, config, printername) : 
     35    def __init__(self, config, printername, arguments) : 
    3236        """Sets instance vars depending on the current printer.""" 
    3337        self.printername = printername 
    34         raise PyKotaRequesterError, _("Requester not implemented yet.") 
     38        self.commandline = arguments[0] 
    3539         
    36     def getPrinterPageCounter(self, hostname) : 
    37         """Returns the page counter from the hostname printer via SNMP. 
     40    def getPrinterPageCounter(self, printer) : 
     41        """Returns the page counter from the printer via an external command. 
    3842         
    39            Currently uses the snmpget external command. TODO : do it internally  
     43           The external command must report the life time page number of the printer on stdout. 
    4044        """ 
    41         raise PyKotaRequesterError, _("Requester not implemented yet.") 
     45        commandline = self.commandline % locals() 
     46        if printer is None : 
     47            raise PyKotaRequesterError, _("Unknown printer address in EXTERNAL(%s) for printer %s") % (commandline, self.printername) 
     48        answer = os.popen(commandline) 
     49        try : 
     50            pagecounter = int(answer.readline().strip()) 
     51        except IndexError :     
     52            raise PyKotaRequesterError, _("Unable to query printer %s via EXTERNAL(%s)") % (printer, commandline)  
     53        answer.close() 
     54        return pagecounter 
    4255         
  • pykota/trunk/pykota/requesters/snmp.py

    r773 r780  
    1515# 
    1616# $Log$ 
     17# Revision 1.5  2003/02/10 00:42:17  jalet 
     18# External requester should be ok (untested) 
     19# New syntax for configuration file wrt requesters 
     20# 
    1721# Revision 1.4  2003/02/09 13:05:43  jalet 
    1822# Internationalization continues... 
     
    3640class Requester : 
    3741    """A class to send queries to printers via SNMP.""" 
    38     def __init__(self, config, printername) : 
     42    def __init__(self, config, printername, arguments) : 
    3943        """Sets instance vars depending on the current printer.""" 
    4044        self.printername = printername 
    41         self.community = config.config.get(printername, "snmpcmnty") 
    42         self.oid = config.config.get(printername, "snmpoid") 
     45        self.community = arguments[0] 
     46        self.oid = arguments[1] 
    4347         
    4448    def getPrinterPageCounter(self, hostname) :