Show
Ignore:
Timestamp:
03/06/05 17:52:43 (19 years ago)
Author:
jerome
Message:

Removed all references to $Log$

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/tool.py

    r2146 r2147  
    2020# 
    2121# $Id$ 
    22 # 
    23 # $Log$ 
    24 # Revision 1.151  2005/02/22 17:56:58  jalet 
    25 # Now logs the type of user running the command : mere mortal vs PyKota Admin 
    26 # 
    27 # Revision 1.150  2005/02/14 22:53:44  jalet 
    28 # Now always precomputes the job's size with the internal PDL parser, and not 
    29 # only when 'enforcement: strict' was set in pykota.conf 
    30 # 
    31 # Revision 1.149  2005/02/13 22:02:29  jalet 
    32 # Big database structure changes. Upgrade script is now included as well as 
    33 # the new LDAP schema. 
    34 # Introduction of the -o | --overcharge command line option to edpykota. 
    35 # The output of repykota is more complete, but doesn't fit in 80 columns anymore. 
    36 # Introduction of the new 'maxdenybanners' directive. 
    37 # 
    38 # Revision 1.148  2005/01/06 23:24:21  jalet 
    39 # Regain priviledge the time to open the job's data file when printing in 
    40 # raw mode with CUPS. 
    41 # 
    42 # Revision 1.147  2005/01/06 22:52:53  jalet 
    43 # Implemented the dropping of priviledges. Beware, beware... 
    44 # 
    45 # Revision 1.146  2004/12/09 23:03:57  jalet 
    46 # Fixed a bug when pkbanner's output was piped into another command (e.g. gs) 
    47 # 
    48 # Revision 1.145  2004/11/27 22:52:07  jalet 
    49 # Now PyKota searches its configuration files first in system user pykota's 
    50 # home directory 
    51 # 
    52 # Revision 1.144  2004/11/18 06:01:53  jalet 
    53 # Fix for the fix 
    54 # 
    55 # Revision 1.143  2004/11/18 05:54:15  jalet 
    56 # Fix problem with spaces at the end of filenames in LPRng 
    57 # 
    58 # Revision 1.142  2004/11/16 23:15:05  jalet 
    59 # Fix for LPRng job's file detection code 
    60 # 
    61 # Revision 1.141  2004/11/15 22:01:34  jalet 
    62 # Improved banner handling. 
    63 # Fix for raw printing and banners. 
    64 # 
    65 # Revision 1.140  2004/11/15 19:59:34  jalet 
    66 # PyKota banners now basically work ! 
    67 # 
    68 # Revision 1.139  2004/11/15 15:54:03  jalet 
    69 # Continued integration of Matt's patch for banners 
    70 # 
    71 # Revision 1.138  2004/11/12 23:46:44  jalet 
    72 # Heavy work on pkbanner. Not finished yet though, but mostly works. 
    73 # 
    74 # Revision 1.137  2004/11/01 16:21:17  jalet 
    75 # Little change for locale+gettext 
    76 # 
    77 # Revision 1.136  2004/10/24 09:06:46  jalet 
    78 # Added debug messages for LPRng support possible problem ??? 
    79 # 
    80 # Revision 1.135  2004/10/20 14:29:30  jalet 
    81 # Now logs something when locale settings are incorrect. 
    82 # 
    83 # Revision 1.134  2004/10/20 08:12:27  jalet 
    84 # Another fix for charset detection and Python2.3 
    85 # 
    86 # Revision 1.133  2004/10/19 22:24:00  jalet 
    87 # Should fix the printer's hostname or IP address detection code. 
    88 # 
    89 # Revision 1.132  2004/10/19 21:45:25  jalet 
    90 # Now correctly logs command line arguments 
    91 # 
    92 # Revision 1.131  2004/10/19 21:37:57  jalet 
    93 # Fixes recently introduced bug 
    94 # 
    95 # Revision 1.130  2004/10/19 15:21:48  jalet 
    96 # Fixed incorrect setting of the user's locale 
    97 # 
    98 # Revision 1.129  2004/10/13 20:51:27  jalet 
    99 # Made debugging levels be the same in cupspykota and lprngpykota. 
    100 # Now outputs more information in informational messages : user, printer, jobid 
    101 # 
    102 # Revision 1.128  2004/10/11 22:53:06  jalet 
    103 # Postponed string interpolation to help message's output method 
    104 # 
    105 # Revision 1.127  2004/10/11 12:48:38  jalet 
    106 # Adds fake translation marker 
    107 # 
    108 # Revision 1.126  2004/10/05 09:41:13  jalet 
    109 # Small fix for errors caused by unknown locale 
    110 # 
    111 # Revision 1.125  2004/10/04 11:18:10  jalet 
    112 # Now exports the MD5 sum of the job's datas as an hexadecimal digest 
    113 # 
    114 # Revision 1.124  2004/10/02 05:48:56  jalet 
    115 # Should now correctly deal with charsets both when storing into databases and when 
    116 # retrieving datas. Works with both PostgreSQL and LDAP. 
    117 # 
    118 # Revision 1.123  2004/09/29 20:20:52  jalet 
    119 # Added the winbind_separator directive to pykota.conf to allow the admin to 
    120 # strip out the Samba/Winbind domain name when users print. 
    121 # 
    122 # Revision 1.122  2004/09/28 21:38:56  jalet 
    123 # Now computes the job's datas MD5 checksum to later forbid duplicate print jobs. 
    124 # The checksum is not yet saved into the database. 
    125 # 
    126 # Revision 1.121  2004/09/15 18:47:58  jalet 
    127 # Re-Extends the list of invalid characters in names to prevent 
    128 # people from adding user "*" for example, or to prevent 
    129 # print administrators to hijack the system by putting dangerous 
    130 # datas into the database which would cause commands later run by root 
    131 # to compromise the system. 
    132 # 
    133 # Revision 1.120  2004/09/02 13:26:29  jalet 
    134 # Small fix for old versions of LPRng 
    135 # 
    136 # Revision 1.119  2004/09/02 13:09:58  jalet 
    137 # Now exports PYKOTAPRINTERHOSTNAME 
    138 # 
    139 # Revision 1.118  2004/08/06 20:46:45  jalet 
    140 # Finished group quota fix for balance when no user in group has a balance 
    141 # 
    142 # Revision 1.117  2004/08/06 13:45:51  jalet 
    143 # Fixed french translation problem. 
    144 # Fixed problem with group quotas and strict enforcement. 
    145 # 
    146 # Revision 1.116  2004/07/24 20:20:29  jalet 
    147 # Unitialized variable 
    148 # 
    149 # Revision 1.115  2004/07/21 09:35:48  jalet 
    150 # Software accounting seems to be OK with LPRng support now 
    151 # 
    152 # Revision 1.114  2004/07/20 22:19:45  jalet 
    153 # Sanitized a bit + use of gettext 
    154 # 
    155 # Revision 1.113  2004/07/17 20:37:27  jalet 
    156 # Missing file... Am I really stupid ? 
    157 # 
    158 # Revision 1.112  2004/07/16 12:22:47  jalet 
    159 # LPRng support early version 
    160 # 
    161 # Revision 1.111  2004/07/06 18:09:42  jalet 
    162 # Reduced the set of invalid characters in names 
    163 # 
    164 # Revision 1.110  2004/07/01 19:56:42  jalet 
    165 # Better dispatching of error messages 
    166 # 
    167 # Revision 1.109  2004/07/01 17:45:49  jalet 
    168 # Added code to handle the description field for printers 
    169 # 
    170 # Revision 1.108  2004/06/24 23:09:30  jalet 
    171 # Also prints read size on last block 
    172 # 
    173 # Revision 1.107  2004/06/23 13:03:28  jalet 
    174 # Catches accounter configuration errors earlier 
    175 # 
    176 # Revision 1.106  2004/06/22 09:31:18  jalet 
    177 # Always send some debug info to CUPS' back channel stream (stderr) as 
    178 # informationnal messages. 
    179 # 
    180 # Revision 1.105  2004/06/21 08:17:38  jalet 
    181 # Added version number in subject message for directive crashrecipient. 
    182 # 
    183 # Revision 1.104  2004/06/18 13:34:49  jalet 
    184 # Now all tracebacks include PyKota's version number 
    185 # 
    186 # Revision 1.103  2004/06/18 13:17:26  jalet 
    187 # Now includes PyKota's version number in messages sent by the crashrecipient 
    188 # directive. 
    189 # 
    190 # Revision 1.102  2004/06/17 13:26:51  jalet 
    191 # Better exception handling code 
    192 # 
    193 # Revision 1.101  2004/06/16 20:56:34  jalet 
    194 # Smarter initialisation code 
    195 # 
    196 # Revision 1.100  2004/06/11 08:16:03  jalet 
    197 # More exceptions catched in case of very early failure. 
    198 # 
    199 # Revision 1.99  2004/06/11 07:07:38  jalet 
    200 # Now detects and logs configuration syntax errors instead of failing without 
    201 # any notice message. 
    202 # 
    203 # Revision 1.98  2004/06/08 19:27:12  jalet 
    204 # Doesn't ignore SIGCHLD anymore 
    205 # 
    206 # Revision 1.97  2004/06/07 22:45:35  jalet 
    207 # Now accepts a job when enforcement is STRICT and predicted account balance 
    208 # is equal to 0.0 : since the job hasn't been printed yet, only its printing 
    209 # will really render balance equal to 0.0, so we should be allowed to print. 
    210 # 
    211 # Revision 1.96  2004/06/05 22:18:04  jalet 
    212 # Now catches some exceptions earlier. 
    213 # storage.py and ldapstorage.py : removed old comments 
    214 # 
    215 # Revision 1.95  2004/06/03 21:50:34  jalet 
    216 # Improved error logging. 
    217 # crashrecipient directive added. 
    218 # Now exports the job's size in bytes too. 
    219 # 
    220 # Revision 1.94  2004/06/03 08:51:03  jalet 
    221 # logs job's size in bytes now 
    222 # 
    223 # Revision 1.93  2004/06/02 21:51:02  jalet 
    224 # Moved the sigterm capturing elsewhere 
    225 # 
    226 # Revision 1.92  2004/06/02 13:21:38  jalet 
    227 # Debug message added 
    228 # 
    229 # Revision 1.91  2004/05/25 05:17:52  jalet 
    230 # Now precomputes the job's size only if current printer's enforcement 
    231 # is "STRICT" 
    232 # 
    233 # Revision 1.90  2004/05/24 22:45:49  jalet 
    234 # New 'enforcement' directive added 
    235 # Polling loop improvements 
    236 # 
    237 # Revision 1.89  2004/05/21 22:02:52  jalet 
    238 # Preliminary work on pre-accounting 
    239 # 
    240 # Revision 1.88  2004/05/18 14:49:20  jalet 
    241 # Big code changes to completely remove the need for "requester" directives, 
    242 # jsut use "hardware(... your previous requester directive's content ...)" 
    243 # 
    244 # Revision 1.87  2004/05/17 19:14:59  jalet 
    245 # Now catches SIGPIPE and SIGCHLD 
    246 # 
    247 # Revision 1.86  2004/05/13 13:59:28  jalet 
    248 # Code simplifications 
    249 # 
    250 # Revision 1.85  2004/05/11 08:26:27  jalet 
    251 # Now catches connection problems to SMTP server 
    252 # 
    253 # Revision 1.84  2004/04/21 08:36:32  jalet 
    254 # Exports the PYKOTASTATUS environment variable when SIGTERM is received. 
    255 # 
    256 # Revision 1.83  2004/04/16 17:03:49  jalet 
    257 # The list of printers groups the current printer is a member of is 
    258 # now exported in the PYKOTAPGROUPS environment variable 
    259 # 
    260 # Revision 1.82  2004/04/13 09:38:03  jalet 
    261 # More work on correct child processes handling 
    262 # 
    263 # Revision 1.81  2004/04/09 22:24:47  jalet 
    264 # Began work on correct handling of child processes when jobs are cancelled by 
    265 # the user. Especially important when an external requester is running for a 
    266 # long time. 
    267 # 
    268 # Revision 1.80  2004/04/06 12:00:21  jalet 
    269 # uninitialized values caused problems 
    270 # 
    271 # Revision 1.79  2004/03/28 21:01:29  jalet 
    272 # PYKOTALIMITBY environment variable is now exported too 
    273 # 
    274 # Revision 1.78  2004/03/08 20:13:25  jalet 
    275 # Allow names to begin with a digit 
    276 # 
    277 # Revision 1.77  2004/03/03 13:10:35  jalet 
    278 # Now catches all smtplib exceptions when there's a problem sending messages 
    279 # 
    280 # Revision 1.76  2004/03/01 14:34:15  jalet 
    281 # PYKOTAPHASE wasn't set at the right time at the end of data transmission 
    282 # to underlying layer (real backend) 
    283 # 
    284 # Revision 1.75  2004/03/01 11:23:25  jalet 
    285 # Pre and Post hooks to external commands are available in the cupspykota 
    286 # backend. Forthe pykota filter they will be implemented real soon now. 
    287 # 
    288 # Revision 1.74  2004/02/26 14:18:07  jalet 
    289 # Should fix the remaining bugs wrt printers groups and users groups. 
    290 # 
    291 # Revision 1.73  2004/02/19 14:20:21  jalet 
    292 # maildomain pykota.conf directive added. 
    293 # Small improvements on mail headers quality. 
    294 # 
    295 # Revision 1.72  2004/01/14 15:51:19  jalet 
    296 # Docstring added. 
    297 # 
    298 # Revision 1.71  2004/01/11 23:22:42  jalet 
    299 # Major code refactoring, it's way cleaner, and now allows automated addition 
    300 # of printers on first print. 
    301 # 
    302 # Revision 1.70  2004/01/08 14:10:32  jalet 
    303 # Copyright year changed. 
    304 # 
    305 # Revision 1.69  2004/01/05 16:02:18  jalet 
    306 # Dots in user, groups and printer names should be allowed. 
    307 # 
    308 # Revision 1.68  2004/01/02 17:38:40  jalet 
    309 # This time it should be better... 
    310 # 
    311 # Revision 1.67  2004/01/02 17:37:09  jalet 
    312 # I'm completely stupid !!! Better to not talk while coding ! 
    313 # 
    314 # Revision 1.66  2004/01/02 17:31:26  jalet 
    315 # Forgot to remove some code 
    316 # 
    317 # Revision 1.65  2003/12/06 08:14:38  jalet 
    318 # Added support for CUPS device uris which contain authentication information. 
    319 # 
    320 # Revision 1.64  2003/11/29 22:03:17  jalet 
    321 # Some code refactoring work. New code is not used at this time. 
    322 # 
    323 # Revision 1.63  2003/11/29 20:06:20  jalet 
    324 # Added 'utolower' configuration option to convert all usernames to 
    325 # lowercase when printing. All database accesses are still and will 
    326 # remain case sensitive though. 
    327 # 
    328 # Revision 1.62  2003/11/25 22:37:22  jalet 
    329 # Small code move 
    330 # 
    331 # Revision 1.61  2003/11/25 22:03:28  jalet 
    332 # No more message on stderr when the translation is not available. 
    333 # 
    334 # Revision 1.60  2003/11/25 21:54:05  jalet 
    335 # updated FAQ 
    336 # 
    337 # Revision 1.59  2003/11/25 13:33:43  jalet 
    338 # Puts 'root' instead of '' when printing from CUPS web interface (which 
    339 # gives an empty username) 
    340 # 
    341 # Revision 1.58  2003/11/21 14:28:45  jalet 
    342 # More complete job history. 
    343 # 
    344 # Revision 1.57  2003/11/19 23:19:38  jalet 
    345 # Code refactoring work. 
    346 # Explicit redirection to /dev/null has to be set in external policy now, just 
    347 # like in external mailto. 
    348 # 
    349 # Revision 1.56  2003/11/19 07:40:20  jalet 
    350 # Missing import statement. 
    351 # Better documentation for mailto: external(...) 
    352 # 
    353 # Revision 1.55  2003/11/18 23:43:12  jalet 
    354 # Mailto can be any external command now, as usual. 
    355 # 
    356 # Revision 1.54  2003/10/24 21:52:46  jalet 
    357 # Now can force language when coming from CGI script. 
    358 # 
    359 # Revision 1.53  2003/10/08 21:41:38  jalet 
    360 # External policies for printers works ! 
    361 # We can now auto-add users on first print, and do other useful things if needed. 
    362 # 
    363 # Revision 1.52  2003/10/07 09:07:28  jalet 
    364 # Character encoding added to please latest version of Python 
    365 # 
    366 # Revision 1.51  2003/10/06 14:21:41  jalet 
    367 # Test reversed to not retrieve group members when no messages for them. 
    368 # 
    369 # Revision 1.50  2003/10/02 20:23:18  jalet 
    370 # Storage caching mechanism added. 
    371 # 
    372 # Revision 1.49  2003/07/29 20:55:17  jalet 
    373 # 1.14 is out ! 
    374 # 
    375 # Revision 1.48  2003/07/21 23:01:56  jalet 
    376 # Modified some messages aout soft limit 
    377 # 
    378 # Revision 1.47  2003/07/16 21:53:08  jalet 
    379 # Really big modifications wrt new configuration file's location and content. 
    380 # 
    381 # Revision 1.46  2003/07/09 20:17:07  jalet 
    382 # Email field added to PostgreSQL schema 
    383 # 
    384 # Revision 1.45  2003/07/08 19:43:51  jalet 
    385 # Configurable warning messages. 
    386 # Poor man's treshold value added. 
    387 # 
    388 # Revision 1.44  2003/07/07 11:49:24  jalet 
    389 # Lots of small fixes with the help of PyChecker 
    390 # 
    391 # Revision 1.43  2003/07/04 09:06:32  jalet 
    392 # Small bug fix wrt undefined "LimitBy" field. 
    393 # 
    394 # Revision 1.42  2003/06/30 12:46:15  jalet 
    395 # Extracted reporting code. 
    396 # 
    397 # Revision 1.41  2003/06/25 14:10:01  jalet 
    398 # Hey, it may work (edpykota --reset excepted) ! 
    399 # 
    400 # Revision 1.40  2003/06/10 16:37:54  jalet 
    401 # Deletion of the second user which is not needed anymore. 
    402 # Added a debug configuration field in /etc/pykota.conf 
    403 # All queries can now be sent to the logger in debug mode, this will 
    404 # greatly help improve performance when time for this will come. 
    405 # 
    406 # Revision 1.39  2003/04/29 18:37:54  jalet 
    407 # Pluggable accounting methods (actually doesn't support external scripts) 
    408 # 
    409 # Revision 1.38  2003/04/24 11:53:48  jalet 
    410 # Default policy for unknown users/groups is to DENY printing instead 
    411 # of the previous default to ALLOW printing. This is to solve an accuracy 
    412 # problem. If you set the policy to ALLOW, jobs printed by in nexistant user 
    413 # (from PyKota's POV) will be charged to the next user who prints on the 
    414 # same printer. 
    415 # 
    416 # Revision 1.37  2003/04/24 08:08:27  jalet 
    417 # Debug message forgotten 
    418 # 
    419 # Revision 1.36  2003/04/24 07:59:40  jalet 
    420 # LPRng support now works ! 
    421 # 
    422 # Revision 1.35  2003/04/23 22:13:57  jalet 
    423 # Preliminary support for LPRng added BUT STILL UNTESTED. 
    424 # 
    425 # Revision 1.34  2003/04/17 09:26:21  jalet 
    426 # repykota now reports account balances too. 
    427 # 
    428 # Revision 1.33  2003/04/16 12:35:49  jalet 
    429 # Groups quota work now ! 
    430 # 
    431 # Revision 1.32  2003/04/16 08:53:14  jalet 
    432 # Printing can now be limited either by user's account balance or by 
    433 # page quota (the default). Quota report doesn't include account balance 
    434 # yet, though. 
    435 # 
    436 # Revision 1.31  2003/04/15 11:30:57  jalet 
    437 # More work done on money print charging. 
    438 # Minor bugs corrected. 
    439 # All tools now access to the storage as priviledged users, repykota excepted. 
    440 # 
    441 # Revision 1.30  2003/04/10 21:47:20  jalet 
    442 # Job history added. Upgrade script neutralized for now ! 
    443 # 
    444 # Revision 1.29  2003/03/29 13:45:27  jalet 
    445 # GPL paragraphs were incorrectly (from memory) copied into the sources. 
    446 # Two README files were added. 
    447 # Upgrade script for PostgreSQL pre 1.01 schema was added. 
    448 # 
    449 # Revision 1.28  2003/03/29 13:08:28  jalet 
    450 # Configuration is now expected to be found in /etc/pykota.conf instead of 
    451 # in /etc/cups/pykota.conf 
    452 # Installation script can move old config files to the new location if needed. 
    453 # Better error handling if configuration file is absent. 
    454 # 
    455 # Revision 1.27  2003/03/15 23:01:28  jalet 
    456 # New mailto option in configuration file added. 
    457 # No time to test this tonight (although it should work). 
    458 # 
    459 # Revision 1.26  2003/03/09 23:58:16  jalet 
    460 # Comment 
    461 # 
    462 # Revision 1.25  2003/03/07 22:56:14  jalet 
    463 # 0.99 is out with some bug fixes. 
    464 # 
    465 # Revision 1.24  2003/02/27 23:48:41  jalet 
    466 # Correctly maps PyKota's log levels to syslog log levels 
    467 # 
    468 # Revision 1.23  2003/02/27 22:55:20  jalet 
    469 # WARN log priority doesn't exist. 
    470 # 
    471 # Revision 1.22  2003/02/27 09:09:20  jalet 
    472 # Added a method to match strings against wildcard patterns 
    473 # 
    474 # Revision 1.21  2003/02/17 23:01:56  jalet 
    475 # Typos 
    476 # 
    477 # Revision 1.20  2003/02/17 22:55:01  jalet 
    478 # More options can now be set per printer or globally : 
    479 # 
    480 #       admin 
    481 #       adminmail 
    482 #       gracedelay 
    483 #       requester 
    484 # 
    485 # the printer option has priority when both are defined. 
    486 # 
    487 # Revision 1.19  2003/02/10 11:28:45  jalet 
    488 # Localization 
    489 # 
    490 # Revision 1.18  2003/02/10 01:02:17  jalet 
    491 # External requester is about to work, but I must sleep 
    492 # 
    493 # Revision 1.17  2003/02/09 13:05:43  jalet 
    494 # Internationalization continues... 
    495 # 
    496 # Revision 1.16  2003/02/09 12:56:53  jalet 
    497 # Internationalization begins... 
    498 # 
    499 # Revision 1.15  2003/02/08 22:09:52  jalet 
    500 # Name check method moved here 
    501 # 
    502 # Revision 1.14  2003/02/07 10:42:45  jalet 
    503 # Indentation problem 
    504 # 
    505 # Revision 1.13  2003/02/07 08:34:16  jalet 
    506 # Test wrt date limit was wrong 
    507 # 
    508 # Revision 1.12  2003/02/06 23:20:02  jalet 
    509 # warnpykota doesn't need any user/group name argument, mimicing the 
    510 # warnquota disk quota tool. 
    511 # 
    512 # Revision 1.11  2003/02/06 22:54:33  jalet 
    513 # warnpykota should be ok 
    514 # 
    515 # Revision 1.10  2003/02/06 15:03:11  jalet 
    516 # added a method to set the limit date 
    517 # 
    518 # Revision 1.9  2003/02/06 10:39:23  jalet 
    519 # Preliminary edpykota work. 
    520 # 
    521 # Revision 1.8  2003/02/06 09:19:02  jalet 
    522 # More robust behavior (hopefully) when the user or printer is not managed 
    523 # correctly by the Quota System : e.g. cupsFilter added in ppd file, but 
    524 # printer and/or user not 'yet?' in storage. 
    525 # 
    526 # Revision 1.7  2003/02/06 00:00:45  jalet 
    527 # Now includes the printer name in email messages 
    528 # 
    529 # Revision 1.6  2003/02/05 23:55:02  jalet 
    530 # Cleaner email messages 
    531 # 
    532 # Revision 1.5  2003/02/05 23:45:09  jalet 
    533 # Better DateTime manipulation wrt grace delay 
    534 # 
    535 # Revision 1.4  2003/02/05 23:26:22  jalet 
    536 # Incorrect handling of grace delay 
    537 # 
    538 # Revision 1.3  2003/02/05 22:16:20  jalet 
    539 # DEVICE_URI is undefined outside of CUPS, i.e. for normal command line tools 
    540 # 
    541 # Revision 1.2  2003/02/05 22:10:29  jalet 
    542 # Typos 
    543 # 
    544 # Revision 1.1  2003/02/05 21:28:17  jalet 
    545 # Initial import into CVS 
    546 # 
    54722# 
    54823#