- Timestamp:
- 02/10/03 01:42:17 (22 years ago)
- Location:
- pykota/trunk
- Files:
-
- 9 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/conf/pykota.conf.sample
r738 r780 52 52 # 53 53 # 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 60 requester: snmp(public, 43.10.2.1.4.1.1) 60 61 # 61 62 # Default policy for inexistant users (e.g. root) -
pykota/trunk/po/en/pykota.po
r779 r780 15 15 # 16 16 # $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 19 20 # 20 21 # Revision 1.3 2003/02/09 14:02:31 jalet … … 45 46 "Generated-By: pygettext.py 1.3\n" 46 47 47 48 #: edpykota:20949 48 msgid "Undefined soft limit set to hard limit (%s) on printer %s." 50 49 msgstr "" 51 50 52 #: edpykota:19153 51 msgid "Hard limit %i is less than soft limit %i, values will be exchanged." 54 52 msgstr "" 55 53 56 #: warnpykota:14157 54 msgid "warnpykota: option --group is currently not implemented." 58 55 msgstr "" 59 56 60 #: edpykota:28761 57 msgid "edpykota: option --group is currently not implemented." 62 58 msgstr "" 63 59 64 #: repykota:10765 60 msgid "Pages grace time: %idays" 66 61 msgstr "" 67 62 68 #: repykota:17769 63 msgid "repykota: unused arguments [%s]. Aborting." 70 64 msgstr "" 71 65 72 #: edpykota:18373 66 msgid "Invalid softlimit value %s." 74 67 msgstr "" 75 68 76 #: edpykota:20077 69 msgid "Prototype %s not found in Quota Storage for printer %s." 78 70 msgstr "" 79 71 80 #: edpykota:28581 72 msgid "edpykota: options --softlimit or --hardlimit and --prototype are incompatible." 82 73 msgstr "" 83 74 84 #: pykota:11485 75 msgid "Printer %s not registered in the PyKota system" 86 76 msgstr "" 87 77 88 #: repykota:17589 78 msgid "repykota: option --group is currently not implemented." 90 79 msgstr "" 91 80 92 #: edpykota:23793 81 msgid "Quota not found for object %s on printer %s." 94 82 msgstr "" 95 83 96 #: repykota:17397 84 msgid "repykota: options --users and --groups are incompatible." 98 85 msgstr "" 99 86 100 #: edpykota:229101 87 msgid "Invalid user name %s" 102 88 msgstr "" 103 89 104 #: edpykota:211105 90 msgid "Both hard and soft limits must be set ! Aborting." 106 91 msgstr "" 107 92 108 #: warnpykota:139109 93 msgid "warnpykota: options --users and --groups are incompatible." 110 94 msgstr "" 111 95 112 #: edpykota:206113 96 msgid "Undefined hard limit set to soft limit (%s) on printer %s." 114 97 msgstr "" 115 98 116 #: edpykota:283117 99 msgid "edpykota: options --users and --groups are incompatible." 118 100 msgstr "" 119 101 120 #: warnpykota:143121 102 msgid "warnpykota: unused arguments [%s]. Aborting." 122 103 msgstr "" 123 104 124 #: edpykota:188125 105 msgid "Invalid hardlimit value %s." 126 106 msgstr "" 127 107 128 #: repykota:116129 108 msgid "Group used soft hard grace total" 130 109 msgstr "" 131 110 132 #: edpykota:177 warnpykota:102 repykota:104133 111 msgid "There's no printer matching %s" 134 112 msgstr "" 135 113 136 #: repykota:106137 114 msgid "*** Report for %s quota on printer %s" 138 115 msgstr "" 139 116 140 #: pykota:137141 117 msgid "Error in page count value %i for user %s on printer %s" 142 118 msgstr "" 143 119 144 #: edpykota:235145 120 msgid "Invalid group name %s" 146 121 msgstr "" 147 122 148 #: repykota:110149 123 msgid "User used soft hard grace total" 150 124 msgstr "" 151 125 152 #: edpykota:175153 126 msgid "Invalid printer name %s" 154 127 msgstr "" 155 128 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 129 msgid "Option requester for printer %s only supports values in %s" 130 msgstr "" 131 162 132 msgid "Print Quota Exceeded" 163 133 msgstr "" 164 134 165 #: tool.py:269166 135 msgid "Print Quota" 167 136 msgstr "" 168 137 169 #: requesters/external.py:31 requesters/external.py:38170 138 msgid "Requester not implemented yet." 171 139 msgstr "" 172 140 173 #: config.py:88 config.py:101174 141 msgid "Option %s not found in section %s of %s" 175 142 msgstr "" 176 143 177 #: tool.py:268178 144 msgid "" 179 145 "You will soon be forbidden to print anymore because\n" … … 181 147 msgstr "" 182 148 183 #: tool.py:202184 149 msgid "" 185 150 "\n" … … 190 155 msgstr "" 191 156 192 #: config.py:152193 157 msgid "Invalid grace delay %s" 194 158 msgstr "" 195 159 196 #: config.py:78197 160 msgid "Option logger only supports values in %s" 198 161 msgstr "" 199 162 200 #: config.py:73201 163 msgid "Option %s not found in section global of %s" 202 164 msgstr "" 203 165 204 #: config.py:82205 166 msgid "Option method only supports values in %s" 206 167 msgstr "" 207 168 208 #: tool.py:219209 169 msgid "Unable to match user %s on printer %s, applying default policy (%s)" 210 170 msgstr "" 211 171 212 #: tool.py:252213 172 msgid "Group quotas are currently not implemented." 214 173 msgstr "" 215 174 216 #: requesters/snmp.py:47217 175 msgid "Unknown printer address in SNMP(%s, %s) for printer %s" 218 176 msgstr "" 219 177 220 #: tool.py:266221 178 msgid "Print Quota soft limit exceeded for user %s on printer %s" 222 179 msgstr "" 223 180 224 #: logger.py:49225 181 msgid "Unsupported logging subsystem %s" 226 182 msgstr "" 227 183 228 #: requesters/snmp.py:52229 184 msgid "Unable to query printer %s via SNMP(%s, %s)" 230 185 msgstr "" 231 186 232 #: requester.py:47233 187 msgid "Unsupported requester backend %s" 234 188 msgstr "" 235 189 236 #: config.py:92237 190 msgid "Option policy in section %s only supports values in %s" 238 191 msgstr "" 239 192 240 #: storage.py:111241 193 msgid "Unsupported quota storage backend %s" 242 194 msgstr "" 243 195 244 #: tool.py:263245 196 msgid "" 246 197 "You are not allowed to print anymore because\n" … … 248 199 msgstr "" 249 200 250 #: tool.py:261251 201 msgid "Print Quota exceeded for user %s on printer %s" 252 202 msgstr "" 253 203 254 204 msgid "Invalid requester for printer %s" 205 msgstr "" 206 207 msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 208 msgstr "" 209 210 msgid "Unable to query printer %s via EXTERNAL(%s)" 211 msgstr "" -
pykota/trunk/po/fr/pykota.po
r776 r780 15 15 # 16 16 # $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 # 17 21 # Revision 1.1 2003/02/09 14:02:31 jalet 18 22 # French translation was added … … 43 47 44 48 45 #: edpykota:20946 49 msgid "Undefined soft limit set to hard limit (%s) on printer %s." 47 50 msgstr "Limite souple ind�nie, positionn��a limite dure (%s) sur l'imprimante %s." 48 51 49 #: edpykota:19150 52 msgid "Hard limit %i is less than soft limit %i, values will be exchanged." 51 53 msgstr "Limite dure %i est inf�eure �a limite souple %i, les valeurs seront �ang�. " 52 54 53 #: warnpykota:14154 55 msgid "warnpykota: option --groups is currently not implemented." 55 56 msgstr "warnpykota: l'option --groups n'est pas encore impl�nt�" 56 57 57 #: edpykota:28758 58 msgid "edpykota: option --groups is currently not implemented." 59 59 msgstr "edpykota: l'option --groups n'est pas encore impl�nt�" 60 60 61 #: repykota:10762 61 msgid "Pages grace time: %idays" 63 62 msgstr "D�i de gr�: %ijours" 64 63 65 #: repykota:17766 64 msgid "repykota: unused arguments [%s]. Aborting." 67 65 msgstr "repykota: arguments [%s] inutilis� Abandon." 68 66 69 #: edpykota:18370 67 msgid "Invalid softlimit value %s." 71 68 msgstr "Valeur %s invalide pour la limite souple." 72 69 73 #: edpykota:20074 70 msgid "Prototype %s not found in Quota Storage for printer %s." 75 71 msgstr "Prototype %s non trouv�ans le Quota Storage pour l'imprimante %s." 76 72 77 #: edpykota:28578 73 msgid "edpykota: options --softlimit or --hardlimit and --prototype are incompatible." 79 74 msgstr "edpykota: les options --softlimit ou --hardlimit et --prototype sont incompatibles." 80 75 81 #: pykota:11482 76 msgid "Printer %s not registered in the PyKota system" 83 77 msgstr "Imprimante %s non enregistr�dans le syst� PyKota" 84 78 85 #: repykota:17586 79 msgid "repykota: option --groups is currently not implemented." 87 80 msgstr "repykota: l'option --groups n'est pas encore impl�nt�" 88 81 89 #: edpykota:23790 82 msgid "Quota not found for object %s on printer %s." 91 83 msgstr "Quota non trouv�our l'objet %s sur l'imprimante %s." 92 84 93 #: repykota:17394 85 msgid "repykota: options --users and --groups are incompatible." 95 86 msgstr "repykota: les options --users et --groups sont incompatibles." 96 87 97 #: edpykota:22998 88 msgid "Invalid user name %s" 99 89 msgstr "Nom d'utilisateur %s invalide" 100 90 101 #: edpykota:211102 91 msgid "Both hard and soft limits must be set ! Aborting." 103 92 msgstr "Les limites dures et souples doivent �e positionn� ! Abandon." 104 93 105 #: warnpykota:139106 94 msgid "warnpykota: options --users and --groups are incompatible." 107 95 msgstr "warnpykota: les options --users et --groups sont incompatibles." 108 96 109 #: edpykota:206110 97 msgid "Undefined hard limit set to soft limit (%s) on printer %s." 111 98 msgstr "Limite dure ind�nie, positionn��a limite souple (%s) sur l'imprimante %s." 112 99 113 #: edpykota:283114 100 msgid "edpykota: options --users and --groups are incompatible." 115 101 msgstr "edykota: les options --users et --groups sont incompatibles." 116 102 117 #: warnpykota:143118 103 msgid "warnpykota: unused arguments [%s]. Aborting." 119 104 msgstr "warnkota: arguments [%s] inutilis� Abandon." 120 105 121 #: edpykota:188122 106 msgid "Invalid hardlimit value %s." 123 107 msgstr "Valeur %s invalide pour la limite dure." 124 108 125 #: repykota:116126 109 msgid "Group used soft hard grace total" 127 110 msgstr "Groupe used soft hard grace total" 128 111 129 #: edpykota:177 warnpykota:102 repykota:104130 112 msgid "There's no printer matching %s" 131 113 msgstr "Aucune imprimante ne correspond �s" 132 114 133 #: repykota:106134 115 msgid "*** Report for %s quota on printer %s" 135 116 msgstr "*** Rapport pour le quota %s sur l'imprimante %s" 136 117 137 #: pykota:137138 118 msgid "Error in page count value %i for user %s on printer %s" 139 119 msgstr "Erreur dans la valeur %i du nombre de page pour l'utilisateur %s sur l'imprimante %s" 140 120 141 #: edpykota:235142 121 msgid "Invalid group name %s" 143 122 msgstr "Nom de groupe %s invalide" 144 123 145 #: repykota:110146 124 msgid "User used soft hard grace total" 147 125 msgstr "Utilisateur used soft hard grace total" 148 126 149 #: edpykota:175150 127 msgid "Invalid printer name %s" 151 128 msgstr "Nom d'imprimante %s invalide" 152 129 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 130 msgid "Option requester for printer %s only supports values in %s" 131 msgstr "L'option requester pour l'imprimante %s supporte seulement les valeurs %s" 132 159 133 msgid "Print Quota Exceeded" 160 134 msgstr "D�ssement de Quota d'Impression" 161 135 162 #: tool.py:269163 136 msgid "Print Quota" 164 137 msgstr "Quota d'Impression" 165 138 166 #: requesters/external.py:31 requesters/external.py:38167 139 msgid "Requester not implemented yet." 168 140 msgstr "Requester non encore impl�nt� 169 141 170 #: config.py:88 config.py:101171 142 msgid "Option %s not found in section %s of %s" 172 143 msgstr "Option %s non trouv�dans la section %s de %s" 173 144 174 #: tool.py:268175 145 msgid "" 176 146 "You will soon be forbidden to print anymore because\n" … … 180 150 "votre Quota d'Impression sur l'imprimante %s est presque atteint." 181 151 182 #: tool.py:202183 152 msgid "" 184 153 "\n" … … 194 163 "\t%s - <%s>\n" 195 164 196 #: config.py:152197 165 msgid "Invalid grace delay %s" 198 166 msgstr "D�i de gr� %s invalide" 199 167 200 #: config.py:78201 168 msgid "Option logger only supports values in %s" 202 169 msgstr "L'option logger supporte seulement les valeurs %s" 203 170 204 #: config.py:73205 171 msgid "Option %s not found in section global of %s" 206 172 msgstr "Option %s non trouv�dans la section global de %s" 207 173 208 #: config.py:82209 174 msgid "Option method only supports values in %s" 210 175 msgstr "L'option method supporte seulement les valeurs %s" 211 176 212 #: tool.py:219213 177 msgid "Unable to match user %s on printer %s, applying default policy (%s)" 214 178 msgstr "Impossible de trouver l'utilisateur %s sur l'imprimante %s, action par d�ut (%s) appliqu� 215 179 216 #: tool.py:252217 180 msgid "Group quotas are currently not implemented." 218 181 msgstr "Les quota de groupes ne sont pas encore impl�nt�" 219 182 220 #: requesters/snmp.py:47221 183 msgid "Unknown printer address in SNMP(%s, %s) for printer %s" 222 184 msgstr "Adresse d'imprimante inconnue dans SNMP(%s, %s) pour l'imprimante %s" 223 185 224 #: tool.py:266225 186 msgid "Print Quota soft limit exceeded for user %s on printer %s" 226 187 msgstr "Limite souple de Quota d'Impression d�ss�pour l'utilisateur %s sur l'imprimante %s" 227 188 228 #: logger.py:49229 189 msgid "Unsupported logging subsystem %s" 230 190 msgstr "Syst� de log %s non support� 231 #: requesters/snmp.py:52232 191 msgid "Unable to query printer %s via SNMP(%s, %s)" 233 192 msgstr "Impossible d'interroger l'imprimante %s par SNMP(%s, %s)" 234 193 235 #: requester.py:47236 194 msgid "Unsupported requester backend %s" 237 195 msgstr "Backend requester %s non support� 238 196 239 #: config.py:92240 197 msgid "Option policy in section %s only supports values in %s" 241 198 msgstr "L'option policy dans la section %s supporte seulement les valeurs %s" 242 199 243 #: storage.py:111244 200 msgid "Unsupported quota storage backend %s" 245 201 msgstr "Backend de stockage de quota %s non support� 246 #: tool.py:263247 202 msgid "" 248 203 "You are not allowed to print anymore because\n" … … 252 207 "votre Quota d'Impression est d�ss�ur l'imprimante %s." 253 208 254 #: tool.py:261255 209 msgid "Print Quota exceeded for user %s on printer %s" 256 210 msgstr "D�ssement de Quota d'Impression pour l'utilisateur %s sur l'imprimante %s" 257 211 258 212 msgid "Invalid requester for printer %s" 213 msgstr "Requester invalide pour l'imprimante %s" 214 215 msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 216 msgstr "Adresse inconnue dans EXTERNAL(%s) pour l'imprimante %s" 217 218 msgid "Unable to query printer %s via EXTERNAL(%s)" 219 msgstr "Impossible d'interroger l'imprimante %s via EXTERNAL(%s)" -
pykota/trunk/po/pykota.pot
r776 r780 15 15 # 16 16 # $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 # 17 21 # Revision 1.3 2003/02/09 14:02:31 jalet 18 22 # French translation was added … … 42 46 "Generated-By: pygettext.py 1.3\n" 43 47 44 45 #: edpykota:20946 48 msgid "Undefined soft limit set to hard limit (%s) on printer %s." 47 49 msgstr "" 48 50 49 #: edpykota:19150 51 msgid "Hard limit %i is less than soft limit %i, values will be exchanged." 51 52 msgstr "" 52 53 53 #: warnpykota:14154 54 msgid "warnpykota: option --group is currently not implemented." 55 55 msgstr "" 56 56 57 #: edpykota:28758 57 msgid "edpykota: option --group is currently not implemented." 59 58 msgstr "" 60 59 61 #: repykota:10762 60 msgid "Pages grace time: %idays" 63 61 msgstr "" 64 62 65 #: repykota:17766 63 msgid "repykota: unused arguments [%s]. Aborting." 67 64 msgstr "" 68 65 69 #: edpykota:18370 66 msgid "Invalid softlimit value %s." 71 67 msgstr "" 72 68 73 #: edpykota:20074 69 msgid "Prototype %s not found in Quota Storage for printer %s." 75 70 msgstr "" 76 71 77 #: edpykota:28578 72 msgid "edpykota: options --softlimit or --hardlimit and --prototype are incompatible." 79 73 msgstr "" 80 74 81 #: pykota:11482 75 msgid "Printer %s not registered in the PyKota system" 83 76 msgstr "" 84 77 85 #: repykota:17586 78 msgid "repykota: option --group is currently not implemented." 87 79 msgstr "" 88 80 89 #: edpykota:23790 81 msgid "Quota not found for object %s on printer %s." 91 82 msgstr "" 92 83 93 #: repykota:17394 84 msgid "repykota: options --users and --groups are incompatible." 95 85 msgstr "" 96 86 97 #: edpykota:22998 87 msgid "Invalid user name %s" 99 88 msgstr "" 100 89 101 #: edpykota:211102 90 msgid "Both hard and soft limits must be set ! Aborting." 103 91 msgstr "" 104 92 105 #: warnpykota:139106 93 msgid "warnpykota: options --users and --groups are incompatible." 107 94 msgstr "" 108 95 109 #: edpykota:206110 96 msgid "Undefined hard limit set to soft limit (%s) on printer %s." 111 97 msgstr "" 112 98 113 #: edpykota:283114 99 msgid "edpykota: options --users and --groups are incompatible." 115 100 msgstr "" 116 101 117 #: warnpykota:143118 102 msgid "warnpykota: unused arguments [%s]. Aborting." 119 103 msgstr "" 120 104 121 #: edpykota:188122 105 msgid "Invalid hardlimit value %s." 123 106 msgstr "" 124 107 125 #: repykota:116126 108 msgid "Group used soft hard grace total" 127 109 msgstr "" 128 110 129 #: edpykota:177 warnpykota:102 repykota:104130 111 msgid "There's no printer matching %s" 131 112 msgstr "" 132 113 133 #: repykota:106134 114 msgid "*** Report for %s quota on printer %s" 135 115 msgstr "" 136 116 137 #: pykota:137138 117 msgid "Error in page count value %i for user %s on printer %s" 139 118 msgstr "" 140 119 141 #: edpykota:235142 120 msgid "Invalid group name %s" 143 121 msgstr "" 144 122 145 #: repykota:110146 123 msgid "User used soft hard grace total" 147 124 msgstr "" 148 125 149 #: edpykota:175150 126 msgid "Invalid printer name %s" 151 127 msgstr "" 152 128 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 129 msgid "Option requester for printer %s only supports values in %s" 130 msgstr "" 131 159 132 msgid "Print Quota Exceeded" 160 133 msgstr "" 161 134 162 #: tool.py:269163 135 msgid "Print Quota" 164 136 msgstr "" 165 137 166 #: requesters/external.py:31 requesters/external.py:38167 138 msgid "Requester not implemented yet." 168 139 msgstr "" 169 140 170 #: config.py:88 config.py:101171 141 msgid "Option %s not found in section %s of %s" 172 142 msgstr "" 173 143 174 #: tool.py:268175 144 msgid "" 176 145 "You will soon be forbidden to print anymore because\n" … … 178 147 msgstr "" 179 148 180 #: tool.py:202181 149 msgid "" 182 150 "\n" … … 187 155 msgstr "" 188 156 189 #: config.py:152190 157 msgid "Invalid grace delay %s" 191 158 msgstr "" 192 159 193 #: config.py:78194 160 msgid "Option logger only supports values in %s" 195 161 msgstr "" 196 162 197 #: config.py:73198 163 msgid "Option %s not found in section global of %s" 199 164 msgstr "" 200 165 201 #: config.py:82202 166 msgid "Option method only supports values in %s" 203 167 msgstr "" 204 168 205 #: tool.py:219206 169 msgid "Unable to match user %s on printer %s, applying default policy (%s)" 207 170 msgstr "" 208 171 209 #: tool.py:252210 172 msgid "Group quotas are currently not implemented." 211 173 msgstr "" 212 174 213 #: requesters/snmp.py:47214 175 msgid "Unknown printer address in SNMP(%s, %s) for printer %s" 215 176 msgstr "" 216 177 217 #: tool.py:266218 178 msgid "Print Quota soft limit exceeded for user %s on printer %s" 219 179 msgstr "" 220 180 221 #: logger.py:49222 181 msgid "Unsupported logging subsystem %s" 223 182 msgstr "" 224 183 225 #: requesters/snmp.py:52226 184 msgid "Unable to query printer %s via SNMP(%s, %s)" 227 185 msgstr "" 228 186 229 #: requester.py:47230 187 msgid "Unsupported requester backend %s" 231 188 msgstr "" 232 189 233 #: config.py:92234 190 msgid "Option policy in section %s only supports values in %s" 235 191 msgstr "" 236 192 237 #: storage.py:111238 193 msgid "Unsupported quota storage backend %s" 239 194 msgstr "" 240 195 241 #: tool.py:263242 196 msgid "" 243 197 "You are not allowed to print anymore because\n" … … 245 199 msgstr "" 246 200 247 #: tool.py:261248 201 msgid "Print Quota exceeded for user %s on printer %s" 249 202 msgstr "" 250 203 251 204 msgid "Invalid requester for printer %s" 205 msgstr "" 206 207 msgid "Unknown printer address in EXTERNAL(%s) for printer %s" 208 msgstr "" 209 210 msgid "Unable to query printer %s via EXTERNAL(%s)" 211 msgstr "" -
pykota/trunk/pykota/config.py
r773 r780 15 15 # 16 16 # $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 # 17 21 # Revision 1.7 2003/02/09 13:05:43 jalet 18 22 # Internationalization continues... … … 95 99 raise PyKotaConfigError, _("Option policy in section %s only supports values in %s") % (printer, str(validpolicies)) 96 100 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)) 105 110 106 111 def getPrinterNames(self) : … … 128 133 129 134 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) 132 144 133 145 def getPrinterPolicy(self, printer) : -
pykota/trunk/pykota/requester.py
r773 r780 15 15 # 16 16 # $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 # 17 21 # Revision 1.4 2003/02/09 13:05:43 jalet 18 22 # Internationalization continues... … … 41 45 def openRequester(config, printername) : 42 46 """Returns a connection handle to the appropriate requester.""" 43 backend= config.getRequesterBackend(printername)47 (backend, args) = config.getRequesterBackend(printername) 44 48 try : 45 49 if not backend.isalpha() : … … 50 54 raise PyKotaRequesterError, _("Unsupported requester backend %s") % backend 51 55 else : 52 return getattr(requesterbackend, "Requester")(config, printername )56 return getattr(requesterbackend, "Requester")(config, printername, args) -
pykota/trunk/pykota/requesters/external.py
r773 r780 15 15 # 16 16 # $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 # 17 21 # Revision 1.2 2003/02/09 13:05:43 jalet 18 22 # Internationalization continues... … … 29 33 class Requester : 30 34 """A class to send queries to printers via external commands.""" 31 def __init__(self, config, printername ) :35 def __init__(self, config, printername, arguments) : 32 36 """Sets instance vars depending on the current printer.""" 33 37 self.printername = printername 34 raise PyKotaRequesterError, _("Requester not implemented yet.")38 self.commandline = arguments[0] 35 39 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. 38 42 39 Currently uses the snmpget external command. TODO : do it internally43 The external command must report the life time page number of the printer on stdout. 40 44 """ 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 42 55 -
pykota/trunk/pykota/requesters/snmp.py
r773 r780 15 15 # 16 16 # $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 # 17 21 # Revision 1.4 2003/02/09 13:05:43 jalet 18 22 # Internationalization continues... … … 36 40 class Requester : 37 41 """A class to send queries to printers via SNMP.""" 38 def __init__(self, config, printername ) :42 def __init__(self, config, printername, arguments) : 39 43 """Sets instance vars depending on the current printer.""" 40 44 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] 43 47 44 48 def getPrinterPageCounter(self, hostname) :