Changeset 2147 for pykota/trunk/pykota
- Timestamp:
- 03/06/05 17:52:43 (19 years ago)
- Location:
- pykota/trunk/pykota
- Files:
-
- 20 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounter.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.21 2004/10/24 12:49:02 jalet25 # Fixed bad indentation26 #27 # Revision 1.20 2004/09/13 16:02:45 jalet28 # Added fix for incorrect job's size when hardware accounting fails29 #30 # Revision 1.19 2004/08/31 23:29:53 jalet31 # Introduction of the new 'onaccountererror' configuration directive.32 # Small fix for software accounter's return code which can't be None anymore.33 # Make software and hardware accounting code look similar : will be factorized34 # later.35 #36 # Revision 1.18 2004/07/22 22:41:48 jalet37 # Hardware accounting for LPRng should be OK now. UNTESTED.38 #39 # Revision 1.17 2004/07/16 12:22:47 jalet40 # LPRng support early version41 #42 # Revision 1.16 2004/05/25 09:15:15 jalet43 # accounter.py : old code deleted44 # the rest : now exports PYKOTAPRECOMPUTEDJOBSIZE and PYKOTAPRECOMPUTEDJOBPRICE45 #46 # Revision 1.15 2004/05/24 22:45:49 jalet47 # New 'enforcement' directive added48 # Polling loop improvements49 #50 # Revision 1.14 2004/05/18 14:49:19 jalet51 # Big code changes to completely remove the need for "requester" directives,52 # jsut use "hardware(... your previous requester directive's content ...)"53 #54 # Revision 1.13 2004/01/12 22:43:40 jalet55 # New formula to compute a job's price56 #57 # Revision 1.12 2004/01/11 23:43:31 jalet58 # Bug wrt number of copies with CUPS should be fixed.59 #60 # Revision 1.11 2004/01/11 23:22:42 jalet61 # Major code refactoring, it's way cleaner, and now allows automated addition62 # of printers on first print.63 #64 # Revision 1.10 2004/01/08 14:10:32 jalet65 # Copyright year changed.66 #67 # Revision 1.9 2003/12/27 16:49:25 uid6746768 # Should be ok now.69 #70 # Revision 1.7 2003/11/25 23:46:40 jalet71 # Don't try to verify if module name is valid, Python does this better than us.72 #73 # Revision 1.6 2003/11/12 23:28:55 jalet74 # More work on new backend. This commit may be unstable.75 #76 # Revision 1.5 2003/10/07 09:07:28 jalet77 # Character encoding added to please latest version of Python78 #79 # Revision 1.4 2003/07/14 14:14:59 jalet80 # Old template81 #82 # Revision 1.3 2003/04/30 19:53:58 jalet83 # 1.0584 #85 # Revision 1.2 2003/04/30 13:36:40 jalet86 # Stupid accounting method was added.87 #88 # Revision 1.1 2003/04/29 18:37:54 jalet89 # Pluggable accounting methods (actually doesn't support external scripts)90 #91 22 # 92 23 # -
pykota/trunk/pykota/accounters/hardware.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.36 2005/02/20 22:58:55 jalet25 # Added some informations from RFC3805 and RFC279026 #27 # Revision 1.35 2005/01/12 22:44:06 jalet28 # Tried to fix a problem with printers which are slow to pass into printing mode.29 #30 # Revision 1.34 2004/11/19 11:57:51 jalet31 # Modified the SNMP fix as hinted by pysnmp's maintainer32 #33 # Revision 1.33 2004/11/19 10:35:37 jalet34 # Catches TypeMismatchError in SNMP answer handling code35 #36 # Revision 1.32 2004/11/16 23:23:40 jalet37 # Fixed internal PJL handling wrt the 35078 PowerSave mode.38 #39 # Revision 1.31 2004/11/01 14:32:26 jalet40 # Fix for unneeded out of band status in pjl_over_tcp/910041 #42 # Revision 1.30 2004/10/05 09:21:34 jalet43 # Removed misleading comments44 #45 # Revision 1.29 2004/10/05 09:20:07 jalet46 # Reduced delay from 2 to 1 seconds in internal SNMP and PJL_over_TCP47 # handlers48 #49 # Revision 1.28 2004/09/27 20:09:30 jalet50 # Lowered timeout delay for PJL queries51 #52 # Revision 1.27 2004/09/27 20:00:35 jalet53 # Typo54 #55 # Revision 1.26 2004/09/27 19:56:27 jalet56 # Added internal handling for PJL queries over port tcp/9100. Now waits57 # for printer being idle before asking, just like with SNMP.58 #59 # Revision 1.25 2004/09/27 09:21:37 jalet60 # Now includes printer's hostname in SNMP error messages61 #62 # Revision 1.24 2004/09/24 21:19:48 jalet63 # Did a pass of PyChecker64 #65 # Revision 1.23 2004/09/23 19:18:12 jalet66 # Now loops when the external hardware accounter fails, until it returns a correct value67 #68 # Revision 1.22 2004/09/22 19:48:01 jalet69 # Logs the looping message as debug instead of as info70 #71 # Revision 1.21 2004/09/22 19:27:41 jalet72 # Bad import statement73 #74 # Revision 1.20 2004/09/22 19:22:27 jalet75 # Just loop in case a network error occur76 #77 # Revision 1.19 2004/09/22 14:29:01 jalet78 # Fixed nasty typo79 #80 # Revision 1.18 2004/09/21 16:00:46 jalet81 # More informational messages82 #83 # Revision 1.17 2004/09/21 13:42:18 jalet84 # Typo85 #86 # Revision 1.16 2004/09/21 13:30:53 jalet87 # First try at full SNMP handling from the Python code.88 #89 # Revision 1.15 2004/09/14 11:38:59 jalet90 # Minor fix91 #92 # Revision 1.14 2004/09/14 06:53:53 jalet93 # Small test added94 #95 # Revision 1.13 2004/09/13 16:02:45 jalet96 # Added fix for incorrect job's size when hardware accounting fails97 #98 # Revision 1.12 2004/09/06 15:42:34 jalet99 # Fix missing import statement for the signal module100 #101 # Revision 1.11 2004/08/31 23:29:53 jalet102 # Introduction of the new 'onaccountererror' configuration directive.103 # Small fix for software accounter's return code which can't be None anymore.104 # Make software and hardware accounting code look similar : will be factorized105 # later.106 #107 # Revision 1.10 2004/08/27 22:49:04 jalet108 # No answer from subprocess now is really a fatal error. Waiting for some109 # time to make this configurable...110 #111 # Revision 1.9 2004/08/25 22:34:39 jalet112 # Now both software and hardware accounting raise an exception when no valid113 # result can be extracted from the subprocess' output.114 # Hardware accounting now reads subprocess' output until an integer is read115 # or data is exhausted : it now behaves just like software accounting in this116 # aspect.117 #118 # Revision 1.8 2004/07/22 22:41:48 jalet119 # Hardware accounting for LPRng should be OK now. UNTESTED.120 #121 # Revision 1.7 2004/07/16 12:22:47 jalet122 # LPRng support early version123 #124 # Revision 1.6 2004/07/01 19:56:42 jalet125 # Better dispatching of error messages126 #127 # Revision 1.5 2004/06/10 22:42:06 jalet128 # Better messages in logs129 #130 # Revision 1.4 2004/05/24 22:45:49 jalet131 # New 'enforcement' directive added132 # Polling loop improvements133 #134 # Revision 1.3 2004/05/24 14:36:40 jalet135 # Revert to old polling loop. Will need optimisations136 #137 # Revision 1.2 2004/05/18 14:49:22 jalet138 # Big code changes to completely remove the need for "requester" directives,139 # jsut use "hardware(... your previous requester directive's content ...)"140 #141 # Revision 1.1 2004/05/13 13:59:30 jalet142 # Code simplifications143 #144 22 # 145 23 # -
pykota/trunk/pykota/accounters/software.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.12 2005/02/19 18:16:06 jalet25 # Optimize print job parsing by avoiding to pass the job's datas through26 # PyKota's internal parser if the special construct "software()" is used27 # with no argument in the 'accounter' directive.28 #29 # Revision 1.11 2004/09/24 21:19:48 jalet30 # Did a pass of PyChecker31 #32 # Revision 1.10 2004/08/31 23:29:53 jalet33 # Introduction of the new 'onaccountererror' configuration directive.34 # Small fix for software accounter's return code which can't be None anymore.35 # Make software and hardware accounting code look similar : will be factorized36 # later.37 #38 # Revision 1.9 2004/08/25 22:34:39 jalet39 # Now both software and hardware accounting raise an exception when no valid40 # result can be extracted from the subprocess' output.41 # Hardware accounting now reads subprocess' output until an integer is read42 # or data is exhausted : it now behaves just like software accounting in this43 # aspect.44 #45 # Revision 1.8 2004/08/22 14:04:47 jalet46 # Tries to fix problem with subprocesses outputting more datas than needed47 #48 # Revision 1.7 2004/08/06 13:45:51 jalet49 # Fixed french translation problem.50 # Fixed problem with group quotas and strict enforcement.51 #52 # Revision 1.6 2004/07/01 19:56:43 jalet53 # Better dispatching of error messages54 #55 # Revision 1.5 2004/06/10 22:42:06 jalet56 # Better messages in logs57 #58 # Revision 1.4 2004/06/02 21:51:14 jalet59 # Moved the sigterm capturing elsewhere60 #61 # Revision 1.3 2004/05/24 22:45:49 jalet62 # New 'enforcement' directive added63 # Polling loop improvements64 #65 # Revision 1.2 2004/05/18 14:49:23 jalet66 # Big code changes to completely remove the need for "requester" directives,67 # jsut use "hardware(... your previous requester directive's content ...)"68 #69 # Revision 1.1 2004/05/13 13:59:30 jalet70 # Code simplifications71 22 # 72 23 # -
pykota/trunk/pykota/cgifuncs.py
r2146 r2147 18 18 # $Id$ 19 19 # 20 # $Log$21 # Revision 1.1 2005/01/08 17:13:01 jalet22 # Move some functions outside of the CGI to allow their use in other CGI scripts23 #24 20 # 25 21 -
pykota/trunk/pykota/config.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.62 2005/02/19 18:16:06 jalet25 # Optimize print job parsing by avoiding to pass the job's datas through26 # PyKota's internal parser if the special construct "software()" is used27 # with no argument in the 'accounter' directive.28 #29 # Revision 1.61 2005/02/16 00:29:33 jalet30 # Fixed the maxdenybanners directive.31 # Introduced the denyduplicates directive.32 # Fixed some database related glitches.33 #34 # Revision 1.60 2005/02/14 23:39:50 jalet35 # Introduces the new 'trustjobsize' directive to workaround some printers36 # generating unstable internal page counter values when queried through SNMP.37 #38 # Revision 1.59 2005/02/13 22:02:29 jalet39 # Big database structure changes. Upgrade script is now included as well as40 # the new LDAP schema.41 # Introduction of the -o | --overcharge command line option to edpykota.42 # The output of repykota is more complete, but doesn't fit in 80 columns anymore.43 # Introduction of the new 'maxdenybanners' directive.44 #45 # Revision 1.58 2004/12/02 22:01:58 jalet46 # TLS is now supported with the LDAP backend47 #48 # Revision 1.57 2004/11/22 21:53:38 jalet49 # Added the reject_unknown directive to pykota.conf to reject user/group50 # creation if user or group is unknown to the system51 #52 # Revision 1.56 2004/11/15 15:23:07 jalet53 # Strips spaces just in case54 #55 # Revision 1.55 2004/11/15 15:14:06 jalet56 # Preliminary integration of Matt's patch for banners.57 #58 # Revision 1.54 2004/10/25 14:12:25 jalet59 # For URGENT legal reasons (Italy), a new "privacy" directive was added to pykota.conf60 # to hide print jobs' title, filename, and options.61 #62 # Revision 1.53 2004/10/06 10:05:47 jalet63 # Minor changes to allow any PyKota administrator to launch enhanced versions64 # of the commands, and not only the root user.65 #66 # Revision 1.52 2004/09/29 20:20:52 jalet67 # Added the winbind_separator directive to pykota.conf to allow the admin to68 # strip out the Samba/Winbind domain name when users print.69 #70 # Revision 1.51 2004/08/31 23:29:53 jalet71 # Introduction of the new 'onaccountererror' configuration directive.72 # Small fix for software accounter's return code which can't be None anymore.73 # Make software and hardware accounting code look similar : will be factorized74 # later.75 #76 # Revision 1.50 2004/07/27 07:07:27 jalet77 # Typo : treshold ==> threshold78 #79 # Revision 1.49 2004/06/03 21:53:24 jalet80 # crashrecipient directive81 #82 # Revision 1.48 2004/05/24 22:45:49 jalet83 # New 'enforcement' directive added84 # Polling loop improvements85 #86 # Revision 1.47 2004/05/18 14:49:20 jalet87 # Big code changes to completely remove the need for "requester" directives,88 # jsut use "hardware(... your previous requester directive's content ...)"89 #90 # Revision 1.46 2004/05/13 13:59:28 jalet91 # Code simplifications92 #93 # Revision 1.45 2004/03/01 10:22:30 jalet94 # Can now extract per printer pre and post hooks from the configuration file95 #96 # Revision 1.44 2004/02/20 14:42:21 jalet97 # Experimental ldapcache directive added98 #99 # Revision 1.43 2004/02/19 14:20:21 jalet100 # maildomain pykota.conf directive added.101 # Small improvements on mail headers quality.102 #103 # Revision 1.42 2004/01/08 14:10:32 jalet104 # Copyright year changed.105 #106 # Revision 1.41 2003/11/29 20:06:20 jalet107 # Added 'utolower' configuration option to convert all usernames to108 # lowercase when printing. All database accesses are still and will109 # remain case sensitive though.110 #111 # Revision 1.40 2003/11/18 23:43:12 jalet112 # Mailto can be any external command now, as usual.113 #114 # Revision 1.39 2003/10/08 21:41:38 jalet115 # External policies for printers works !116 # We can now auto-add users on first print, and do other useful things if needed.117 #118 # Revision 1.38 2003/10/07 22:06:05 jalet119 # Preliminary code to disable job history120 #121 # Revision 1.37 2003/10/07 09:07:28 jalet122 # Character encoding added to please latest version of Python123 #124 # Revision 1.36 2003/10/02 20:23:18 jalet125 # Storage caching mechanism added.126 #127 # Revision 1.35 2003/07/29 09:54:03 jalet128 # Added configurable LDAP mail attribute support129 #130 # Revision 1.34 2003/07/28 09:11:12 jalet131 # PyKota now tries to add its attributes intelligently in existing LDAP132 # directories.133 #134 # Revision 1.33 2003/07/16 21:53:07 jalet135 # Really big modifications wrt new configuration file's location and content.136 #137 # Revision 1.32 2003/07/08 19:43:51 jalet138 # Configurable warning messages.139 # Poor man's treshold value added.140 #141 # Revision 1.31 2003/07/07 11:49:24 jalet142 # Lots of small fixes with the help of PyChecker143 #144 # Revision 1.30 2003/06/25 14:10:01 jalet145 # Hey, it may work (edpykota --reset excepted) !146 #147 # Revision 1.29 2003/06/14 22:44:21 jalet148 # More work on LDAP storage backend.149 #150 # Revision 1.28 2003/06/10 16:37:54 jalet151 # Deletion of the second user which is not needed anymore.152 # Added a debug configuration field in /etc/pykota.conf153 # All queries can now be sent to the logger in debug mode, this will154 # greatly help improve performance when time for this will come.155 #156 # Revision 1.27 2003/05/27 23:00:21 jalet157 # Big rewrite of external accounting methods.158 # Should work well now.159 #160 # Revision 1.26 2003/04/30 19:53:58 jalet161 # 1.05162 #163 # Revision 1.25 2003/04/30 13:36:40 jalet164 # Stupid accounting method was added.165 #166 # Revision 1.24 2003/04/29 18:37:54 jalet167 # Pluggable accounting methods (actually doesn't support external scripts)168 #169 # Revision 1.23 2003/04/24 11:53:48 jalet170 # Default policy for unknown users/groups is to DENY printing instead171 # of the previous default to ALLOW printing. This is to solve an accuracy172 # problem. If you set the policy to ALLOW, jobs printed by in nexistant user173 # (from PyKota's POV) will be charged to the next user who prints on the174 # same printer.175 #176 # Revision 1.22 2003/04/23 22:13:57 jalet177 # Preliminary support for LPRng added BUT STILL UNTESTED.178 #179 # Revision 1.21 2003/03/29 13:45:27 jalet180 # GPL paragraphs were incorrectly (from memory) copied into the sources.181 # Two README files were added.182 # Upgrade script for PostgreSQL pre 1.01 schema was added.183 #184 # Revision 1.20 2003/03/29 13:08:28 jalet185 # Configuration is now expected to be found in /etc/pykota.conf instead of186 # in /etc/cups/pykota.conf187 # Installation script can move old config files to the new location if needed.188 # Better error handling if configuration file is absent.189 #190 # Revision 1.19 2003/03/16 09:56:52 jalet191 # Mailto option now accepts some additional values which all mean that192 # nobody will receive any email message.193 # Mailto option now works. Version 1.01 is now officially out.194 #195 # Revision 1.18 2003/03/16 08:00:50 jalet196 # Default hard coded options are now used if they are not set in the197 # configuration file.198 #199 # Revision 1.17 2003/03/15 23:01:28 jalet200 # New mailto option in configuration file added.201 # No time to test this tonight (although it should work).202 #203 # Revision 1.16 2003/02/17 23:01:56 jalet204 # Typos205 #206 # Revision 1.15 2003/02/17 22:55:01 jalet207 # More options can now be set per printer or globally :208 #209 # admin210 # adminmail211 # gracedelay212 # requester213 #214 # the printer option has priority when both are defined.215 #216 # Revision 1.14 2003/02/17 22:05:50 jalet217 # Storage backend now supports admin and user passwords (untested)218 #219 # Revision 1.13 2003/02/10 11:47:39 jalet220 # Moved some code down into the requesters221 #222 # Revision 1.12 2003/02/10 10:36:33 jalet223 # Small problem wrt external requester224 #225 # Revision 1.11 2003/02/10 08:50:45 jalet226 # External requester seems to be finally ok now227 #228 # Revision 1.10 2003/02/10 08:19:57 jalet229 # tell ConfigParser to return raw data, this allows our own strings230 # interpolations in the requester231 #232 # Revision 1.9 2003/02/10 00:44:38 jalet233 # Typos234 #235 # Revision 1.8 2003/02/10 00:42:17 jalet236 # External requester should be ok (untested)237 # New syntax for configuration file wrt requesters238 #239 # Revision 1.7 2003/02/09 13:05:43 jalet240 # Internationalization continues...241 #242 # Revision 1.6 2003/02/07 22:00:09 jalet243 # Bad cut&paste244 #245 # Revision 1.5 2003/02/06 23:58:05 jalet246 # repykota should be ok247 #248 # Revision 1.4 2003/02/06 09:19:02 jalet249 # More robust behavior (hopefully) when the user or printer is not managed250 # correctly by the Quota System : e.g. cupsFilter added in ppd file, but251 # printer and/or user not 'yet?' in storage.252 #253 # Revision 1.3 2003/02/05 23:26:22 jalet254 # Incorrect handling of grace delay255 #256 # Revision 1.2 2003/02/05 23:09:20 jalet257 # Name conflict258 #259 # Revision 1.1 2003/02/05 21:28:17 jalet260 # Initial import into CVS261 #262 22 # 263 23 # -
pykota/trunk/pykota/dumper.py
r2146 r2147 19 19 # 20 20 # $Id$ 21 #22 # $Log$23 # Revision 1.3 2005/01/19 09:00:54 jalet24 # Small fix for Python2.1 and variables scopes25 #26 # Revision 1.2 2005/01/19 08:49:41 jalet27 # Now dumpykota.cgi behaves like printquota.cgi wrt the REMOTE_USER environment28 # variables if the script is username+password protected.29 # Small fix in printquota.cgi wrt ldap auth with Apache : the workaround was30 # not used everywhere.31 #32 # Revision 1.1 2005/01/08 17:03:07 jalet33 # "--format cups" output more resembling CUPS' page_log.34 # Split into a command line tool and a module, to allow easier coding of35 # a CGI interface.36 #37 21 # 38 22 # -
pykota/trunk/pykota/ipp.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.2 2004/12/03 20:29:33 jalet25 # ipp.py can now be run in standalone mode for testing purposes26 #27 # Revision 1.1 2004/11/06 22:35:58 jalet28 # Added a miniparser for IPP messages (RFC 2910). The job-originating-host-name29 # retrieval is now fiable, unless the CUPS developpers change something...30 22 # 31 23 # -
pykota/trunk/pykota/logger.py
r2146 r2147 21 21 # $Id$ 22 22 # 23 # $Log$24 # Revision 1.12 2004/01/08 14:10:32 jalet25 # Copyright year changed.26 #27 # Revision 1.11 2003/12/27 16:49:25 uid6746728 # Should be ok now.29 #30 # Revision 1.10 2003/11/25 22:37:22 jalet31 # Small code move32 #33 # Revision 1.9 2003/10/07 09:07:28 jalet34 # Character encoding added to please latest version of Python35 #36 # Revision 1.8 2003/07/07 11:49:24 jalet37 # Lots of small fixes with the help of PyChecker38 #39 # Revision 1.7 2003/06/10 16:37:54 jalet40 # Deletion of the second user which is not needed anymore.41 # Added a debug configuration field in /etc/pykota.conf42 # All queries can now be sent to the logger in debug mode, this will43 # greatly help improve performance when time for this will come.44 #45 # Revision 1.6 2003/04/23 22:13:57 jalet46 # Preliminary support for LPRng added BUT STILL UNTESTED.47 #48 # Revision 1.5 2003/03/29 13:45:27 jalet49 # GPL paragraphs were incorrectly (from memory) copied into the sources.50 # Two README files were added.51 # Upgrade script for PostgreSQL pre 1.01 schema was added.52 #53 # Revision 1.4 2003/02/09 13:05:43 jalet54 # Internationalization continues...55 #56 # Revision 1.3 2003/02/05 22:10:29 jalet57 # Typos58 #59 # Revision 1.2 2003/02/05 22:02:22 jalet60 # __import__ statement didn't work as expected61 #62 # Revision 1.1 2003/02/05 21:28:17 jalet63 # Initial import into CVS64 #65 #66 23 # 67 24 -
pykota/trunk/pykota/loggers/stderr.py
r2146 r2147 21 21 # $Id$ 22 22 # 23 # $Log$24 # Revision 1.7 2004/05/24 11:59:49 jalet25 # More robust (?) code26 #27 # Revision 1.6 2004/05/07 14:43:44 jalet28 # Now logs the PID too29 #30 # Revision 1.5 2004/01/08 14:10:33 jalet31 # Copyright year changed.32 #33 # Revision 1.4 2003/10/07 09:07:29 jalet34 # Character encoding added to please latest version of Python35 #36 # Revision 1.3 2003/04/23 22:13:57 jalet37 # Preliminary support for LPRng added BUT STILL UNTESTED.38 #39 # Revision 1.2 2003/03/29 13:45:27 jalet40 # GPL paragraphs were incorrectly (from memory) copied into the sources.41 # Two README files were added.42 # Upgrade script for PostgreSQL pre 1.01 schema was added.43 #44 # Revision 1.1 2003/02/05 21:28:17 jalet45 # Initial import into CVS46 #47 #48 23 # 49 24 -
pykota/trunk/pykota/loggers/system.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.11 2004/05/24 11:59:51 jalet25 # More robust (?) code26 #27 # Revision 1.10 2004/05/07 14:43:46 jalet28 # Now logs the PID too29 #30 # Revision 1.9 2004/01/08 14:10:33 jalet31 # Copyright year changed.32 #33 # Revision 1.8 2003/10/07 09:07:29 jalet34 # Character encoding added to please latest version of Python35 #36 # Revision 1.7 2003/07/07 11:49:24 jalet37 # Lots of small fixes with the help of PyChecker38 #39 # Revision 1.6 2003/04/23 22:13:57 jalet40 # Preliminary support for LPRng added BUT STILL UNTESTED.41 #42 # Revision 1.5 2003/03/29 13:45:27 jalet43 # GPL paragraphs were incorrectly (from memory) copied into the sources.44 # Two README files were added.45 # Upgrade script for PostgreSQL pre 1.01 schema was added.46 #47 # Revision 1.4 2003/02/27 23:48:41 jalet48 # Correctly maps PyKota's log levels to syslog log levels49 #50 # Revision 1.3 2003/02/27 22:55:20 jalet51 # WARN log priority doesn't exist.52 #53 # Revision 1.2 2003/02/05 23:47:54 jalet54 # Forgotten default argument55 #56 # Revision 1.1 2003/02/05 23:09:20 jalet57 # Name conflict58 #59 22 # 60 23 # -
pykota/trunk/pykota/pdlanalyzer.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.52 2005/02/13 21:26:34 jalet25 # Better detection of number of copies in PostScript parser26 #27 # Revision 1.51 2005/01/12 14:44:27 jalet28 # Fixed a fuckingly strange exception by cleverly ignoring it entirely :-)29 #30 # Revision 1.50 2005/01/07 15:53:58 jalet31 # Another fix for PCL3/4/532 #33 # Revision 1.49 2005/01/06 17:41:34 jalet34 # Of course if I forget some files during the commits, the software doesn't35 # work as expected ;-)36 #37 # Revision 1.48 2004/12/16 15:11:00 jalet38 # Added some debugging code to PCL3/4/5 parser39 #40 # Revision 1.47 2004/12/13 20:49:53 jalet41 # Bad typo42 #43 # Revision 1.46 2004/12/13 20:48:33 jalet44 # Outputs debug info to stderr45 #46 # Revision 1.45 2004/12/13 20:39:46 jalet47 # Added a --debug command line option to pkpgcounter, for people interested48 # in seeing what happens, and what will be available in the future :-)49 #50 # Revision 1.44 2004/11/17 15:10:31 jalet51 # Fixed Epson Stylus Photo problem in software accounting52 #53 # Revision 1.43 2004/11/13 20:52:26 jalet54 # Heavy work done on PCL3/4/5 and PCLXL job analyzis55 #56 # Revision 1.42 2004/09/24 21:19:48 jalet57 # Did a pass of PyChecker58 #59 # Revision 1.41 2004/09/04 14:18:55 jalet60 # Support for more laserjet models added.61 #62 # Revision 1.40 2004/09/04 14:01:47 jalet63 # Support for PCL3 (HP Deskjets) added to generic PDL parser64 #65 # Revision 1.39 2004/09/02 23:30:05 jalet66 # Comments67 #68 # Revision 1.38 2004/09/02 22:08:37 jalet69 # First draft of PCL3GUI analyzer.70 #71 # Revision 1.37 2004/09/02 21:22:49 jalet72 # One more PCL tag73 #74 # Revision 1.36 2004/09/01 22:31:49 jalet75 # Some more work on ESC/P2 analyzer to avoid missing \r\n sequences. Not76 # exactly optimal though...77 #78 # Revision 1.35 2004/08/30 23:10:24 jalet79 # Improved the ESC/P2 analyzer so that more GhostScript devices are supported80 #81 # Revision 1.34 2004/08/27 09:08:22 jalet82 # Improvement in PostScript parser to avoid being fooled by clever "students"83 #84 # Revision 1.33 2004/08/27 09:02:34 jalet85 # Forgot to remove some special debugging code...86 #87 # Revision 1.32 2004/08/27 08:58:50 jalet88 # Relax checks for PCL5 header to accomodate strange printer drivers89 #90 # Revision 1.31 2004/08/22 08:25:33 jalet91 # Improved ESC/P2 miniparser thanks to Paulo Silva92 #93 # Revision 1.30 2004/08/21 23:16:57 jalet94 # First draft of ESC/P2 (mini-)parser.95 #96 # Revision 1.29 2004/08/11 16:25:38 jalet97 # Fixed index problem in PCLXL parser when retrieving number of copies for98 # each page99 #100 # Revision 1.28 2004/08/10 23:01:49 jalet101 # Fixed number of copies in PCL5 parser102 #103 # Revision 1.27 2004/08/09 18:14:22 jalet104 # Added workaround for number of copies and some PostScript drivers105 #106 # Revision 1.26 2004/07/22 13:49:51 jalet107 # Added support for binary PostScript through GhostScript if native DSC108 # compliant PostScript analyzer doesn't find any page. This is much109 # slower though, so native analyzer is tried first.110 #111 # Revision 1.25 2004/07/10 14:06:36 jalet112 # Fix for Python2.1 incompatibilities113 #114 # Revision 1.24 2004/07/05 21:00:39 jalet115 # Fix for number of copies for each page in PCLXL parser116 #117 # Revision 1.23 2004/07/03 08:21:59 jalet118 # Testsuite for PDL Analyzer added119 #120 # Revision 1.22 2004/06/29 14:21:41 jalet121 # Smallish optimization122 #123 # Revision 1.21 2004/06/28 23:11:26 jalet124 # Code de-factorization in PCLXL parser125 #126 # Revision 1.20 2004/06/28 22:38:41 jalet127 # Increased speed by a factor of 2 in PCLXL parser128 #129 # Revision 1.19 2004/06/28 21:20:30 jalet130 # PCLXL support now works !131 #132 # Revision 1.18 2004/06/27 22:59:37 jalet133 # More work on PCLXL parser134 #135 # Revision 1.17 2004/06/26 23:20:01 jalet136 # Additionnal speedup for GhostScript generated PCL5 files137 #138 # Revision 1.16 2004/06/26 15:31:00 jalet139 # mmap reintroduced in PCL5 parser140 #141 # Revision 1.15 2004/06/26 14:14:31 jalet142 # Now uses Psyco if it is available143 #144 # Revision 1.14 2004/06/25 09:50:28 jalet145 # More debug info in PCLXL parser146 #147 # Revision 1.13 2004/06/25 08:10:08 jalet148 # Another fix for PCL5 parser149 #150 # Revision 1.12 2004/06/24 23:09:53 jalet151 # Fix for number of copies in PCL5 parser152 #153 # Revision 1.11 2004/06/23 22:07:50 jalet154 # Fixed PCL5 parser according to the sources of rastertohp155 #156 # Revision 1.10 2004/06/18 22:24:03 jalet157 # Removed old comments158 #159 # Revision 1.9 2004/06/18 22:21:27 jalet160 # Native PDF parser greatly improved.161 # GhostScript based PDF parser completely removed because native code162 # is now portable across Python versions.163 #164 # Revision 1.8 2004/06/18 20:49:46 jalet165 # "ERROR:" prefix added166 #167 # Revision 1.7 2004/06/18 17:48:04 jalet168 # Added native fast PDF parsing method169 #170 # Revision 1.6 2004/06/18 14:00:16 jalet171 # Added PDF support in smart PDL analyzer (through GhostScript for now)172 #173 # Revision 1.5 2004/06/18 10:09:05 jalet174 # Resets file pointer to start of file in all cases175 #176 # Revision 1.4 2004/06/18 06:16:14 jalet177 # Fixes PostScript detection code for incorrect drivers178 #179 # Revision 1.3 2004/05/21 20:40:08 jalet180 # All the code for pkpgcounter is now in pdlanalyzer.py181 #182 # Revision 1.2 2004/05/19 19:09:36 jalet183 # Speed improvement184 #185 # Revision 1.1 2004/05/18 09:59:54 jalet186 # pkpgcounter is now just a wrapper around the PDLAnalyzer class187 #188 22 # 189 23 # -
pykota/trunk/pykota/reporter.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.12 2005/02/15 13:13:27 jalet25 # Fixes output when user has got a negative or nul overcharging factor.26 #27 # Revision 1.11 2005/02/13 22:02:29 jalet28 # Big database structure changes. Upgrade script is now included as well as29 # the new LDAP schema.30 # Introduction of the -o | --overcharge command line option to edpykota.31 # The output of repykota is more complete, but doesn't fit in 80 columns anymore.32 # Introduction of the new 'maxdenybanners' directive.33 #34 # Revision 1.10 2004/09/02 10:09:30 jalet35 # Fixed bug in LDAP user deletion code which didn't correctly delete the user's36 # pykotaLastJob entries.37 #38 # Revision 1.9 2004/07/01 17:45:49 jalet39 # Added code to handle the description field for printers40 #41 # Revision 1.8 2004/03/24 15:15:24 jalet42 # Began integration of Henrik Janhagen's work on quota-then-balance43 # and balance-then-quota44 #45 # Revision 1.7 2004/01/08 14:10:32 jalet46 # Copyright year changed.47 #48 # Revision 1.6 2003/12/27 16:49:25 uid6746749 # Should be ok now.50 #51 # Revision 1.4 2003/12/02 14:40:21 jalet52 # Some code refactoring.53 # New HTML reporter added, which is now used in the CGI script for web based54 # print quota reports. It will need some de-uglyfication though...55 #56 # Revision 1.3 2003/11/25 23:46:40 jalet57 # Don't try to verify if module name is valid, Python does this better than us.58 #59 # Revision 1.2 2003/10/07 09:07:28 jalet60 # Character encoding added to please latest version of Python61 #62 # Revision 1.1 2003/06/30 12:46:15 jalet63 # Extracted reporting code.64 #65 22 # 66 23 # -
pykota/trunk/pykota/reporters/html.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.9 2005/02/13 22:02:29 jalet25 # Big database structure changes. Upgrade script is now included as well as26 # the new LDAP schema.27 # Introduction of the -o | --overcharge command line option to edpykota.28 # The output of repykota is more complete, but doesn't fit in 80 columns anymore.29 # Introduction of the new 'maxdenybanners' directive.30 #31 # Revision 1.8 2004/01/12 15:28:45 jalet32 # Now can output the user's history on several printers at the same time.33 #34 # Revision 1.7 2004/01/12 15:12:50 jalet35 # Small fix for history36 #37 # Revision 1.6 2004/01/12 14:35:01 jalet38 # Printing history added to CGI script.39 #40 # Revision 1.5 2004/01/08 14:10:33 jalet41 # Copyright year changed.42 #43 # Revision 1.4 2004/01/06 15:51:46 jalet44 # Code factorization45 #46 # Revision 1.3 2003/12/27 16:49:25 uid6746747 # Should be ok now.48 #49 # Revision 1.1 2003/12/02 14:41:17 jalet50 # And as always, I forgot most of the new files :-)51 #52 22 # 53 23 # -
pykota/trunk/pykota/reporters/text.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.10 2005/02/13 22:02:29 jalet25 # Big database structure changes. Upgrade script is now included as well as26 # the new LDAP schema.27 # Introduction of the -o | --overcharge command line option to edpykota.28 # The output of repykota is more complete, but doesn't fit in 80 columns anymore.29 # Introduction of the new 'maxdenybanners' directive.30 #31 # Revision 1.9 2004/01/08 14:10:33 jalet32 # Copyright year changed.33 #34 # Revision 1.8 2004/01/06 15:51:46 jalet35 # Code factorization36 #37 # Revision 1.7 2003/12/27 16:49:25 uid6746738 # Should be ok now.39 #40 # Revision 1.6 2003/12/02 14:40:21 jalet41 # Some code refactoring.42 # New HTML reporter added, which is now used in the CGI script for web based43 # print quota reports. It will need some de-uglyfication though...44 #45 # Revision 1.5 2003/10/07 09:07:29 jalet46 # Character encoding added to please latest version of Python47 #48 # Revision 1.4 2003/07/07 11:49:24 jalet49 # Lots of small fixes with the help of PyChecker50 #51 # Revision 1.3 2003/07/05 07:46:50 jalet52 # The previous bug fix was incomplete.53 #54 # Revision 1.2 2003/07/02 09:29:12 jalet55 # Bug fixed when wanting a report and an user/group was limited by account balance56 #57 # Revision 1.1 2003/06/30 12:46:15 jalet58 # Extracted reporting code.59 #60 22 # 61 23 # -
pykota/trunk/pykota/storage.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.70 2005/02/16 00:29:33 jalet25 # Fixed the maxdenybanners directive.26 # Introduced the denyduplicates directive.27 # Fixed some database related glitches.28 #29 # Revision 1.69 2005/02/13 22:48:37 jalet30 # Added the md5sum to the history31 #32 # Revision 1.68 2005/02/13 22:02:29 jalet33 # Big database structure changes. Upgrade script is now included as well as34 # the new LDAP schema.35 # Introduction of the -o | --overcharge command line option to edpykota.36 # The output of repykota is more complete, but doesn't fit in 80 columns anymore.37 # Introduction of the new 'maxdenybanners' directive.38 #39 # Revision 1.67 2005/01/18 19:47:50 jalet40 # Big bug fix wrt the datelimit attribute41 #42 # Revision 1.66 2004/12/02 21:24:50 jalet43 # Integrated the patch by Wilson Roberto Afonso and Matt Hyclak to allow44 # edpykota to accept the -U | --used value command line option.45 #46 # Revision 1.65 2004/10/25 14:12:25 jalet47 # For URGENT legal reasons (Italy), a new "privacy" directive was added to pykota.conf48 # to hide print jobs' title, filename, and options.49 #50 # Revision 1.64 2004/10/08 20:19:18 jalet51 # Added ugly workaround for strange locale problem52 #53 # Revision 1.63 2004/10/07 21:14:28 jalet54 # Hopefully final fix for data encoding to and from the database55 #56 # Revision 1.62 2004/09/28 17:45:31 jalet57 # Added the --hardreset command line option to edpykota58 #59 # Revision 1.61 2004/09/24 21:19:48 jalet60 # Did a pass of PyChecker61 #62 # Revision 1.60 2004/09/24 20:21:50 jalet63 # Fixed pykotaAccountBalance object location during creation64 #65 # Revision 1.59 2004/09/10 21:32:52 jalet66 # Small fixes for incomplete entry intialization67 #68 # Revision 1.58 2004/09/02 10:09:30 jalet69 # Fixed bug in LDAP user deletion code which didn't correctly delete the user's70 # pykotaLastJob entries.71 #72 # Revision 1.57 2004/07/22 22:41:48 jalet73 # Hardware accounting for LPRng should be OK now. UNTESTED.74 #75 # Revision 1.56 2004/07/01 17:45:49 jalet76 # Added code to handle the description field for printers77 #78 # Revision 1.55 2004/06/05 22:18:04 jalet79 # Now catches some exceptions earlier.80 # storage.py and ldapstorage.py : removed old comments81 #82 # Revision 1.54 2004/06/05 22:03:49 jalet83 # Payments history is now stored in database84 #85 # Revision 1.53 2004/06/03 23:14:10 jalet86 # Now stores the job's size in bytes in the database.87 # Preliminary work on payments storage : database schemas are OK now,88 # but no code to store payments yet.89 # Removed schema picture, not relevant anymore.90 #91 # Revision 1.52 2004/05/26 14:49:57 jalet92 # First try at saving the job-originating-hostname in the database93 #94 # Revision 1.51 2004/03/24 15:15:24 jalet95 # Began integration of Henrik Janhagen's work on quota-then-balance96 # and balance-then-quota97 #98 # Revision 1.50 2004/03/09 08:05:27 jalet99 # Small fix : only keeps existing quota entries when searching parents100 #101 # Revision 1.49 2004/03/01 15:06:51 jalet102 # Pre and Post hooks should now work in the pykota filter too.103 # The pykota filter doesn't check the last user's quota anymore104 # when delayed hardware accounting is used : this will be checked105 # anyway the next time the last user will print106 #107 # Revision 1.48 2004/02/27 13:50:12 jalet108 # Hopefully the final fix for groups (users and printers)109 #110 # Revision 1.47 2004/02/27 09:30:33 jalet111 # datelimit wasn't reset when modifying soft and hard limits with the LDAP backend112 #113 # Revision 1.46 2004/02/26 14:18:07 jalet114 # Should fix the remaining bugs wrt printers groups and users groups.115 #116 # Revision 1.45 2004/02/26 10:40:40 jalet117 # Fixed nested printer groups accounting.118 #119 # Revision 1.44 2004/02/25 19:09:24 jalet120 # Fix for LDAP problem when job price was 0.121 #122 # Revision 1.43 2004/02/25 12:36:34 jalet123 # Avoids a database query even if caching was disabled.124 #125 # Revision 1.42 2004/02/23 22:53:21 jalet126 # Don't retrieve data when it's not needed, to avoid database queries127 #128 # Revision 1.41 2004/02/04 17:12:33 jalet129 # Removing a printer from a printers group should work now.130 #131 # Revision 1.40 2004/02/04 13:24:41 jalet132 # pkprinters can now remove printers from printers groups.133 #134 # Revision 1.39 2004/02/04 11:16:59 jalet135 # pkprinters command line tool added.136 #137 # Revision 1.38 2004/01/12 22:43:40 jalet138 # New formula to compute a job's price139 #140 # Revision 1.37 2004/01/12 14:35:01 jalet141 # Printing history added to CGI script.142 #143 # Revision 1.36 2004/01/10 09:44:02 jalet144 # Fixed potential accuracy problem if a user printed on several printers at145 # the very same time.146 #147 # Revision 1.35 2004/01/08 16:33:27 jalet148 # Additionnal check to not create a circular printers group.149 #150 # Revision 1.34 2004/01/08 16:24:49 jalet151 # edpykota now supports adding printers to printer groups.152 #153 # Revision 1.33 2004/01/08 14:10:32 jalet154 # Copyright year changed.155 #156 # Revision 1.32 2004/01/06 16:02:57 jalet157 # This time printer groups caching works.158 #159 # Revision 1.31 2004/01/06 15:51:24 jalet160 # Fixed caching of printer groups161 #162 # Revision 1.30 2004/01/06 14:24:59 jalet163 # Printer groups should be cached now, if caching is enabled.164 #165 # Revision 1.29 2003/12/27 16:49:25 uid67467166 # Should be ok now.167 #168 # Revision 1.28 2003/11/25 23:46:40 jalet169 # Don't try to verify if module name is valid, Python does this better than us.170 #171 # Revision 1.27 2003/11/23 19:01:36 jalet172 # Job price added to history173 #174 # Revision 1.26 2003/11/21 14:28:45 jalet175 # More complete job history.176 #177 # Revision 1.25 2003/10/08 21:12:27 jalet178 # Do not cache anymore entries which don't exist.179 #180 # Revision 1.24 2003/10/07 22:06:05 jalet181 # Preliminary code to disable job history182 #183 # Revision 1.23 2003/10/07 09:07:28 jalet184 # Character encoding added to please latest version of Python185 #186 # Revision 1.22 2003/10/06 13:12:27 jalet187 # More work on caching188 #189 # Revision 1.21 2003/10/03 09:02:20 jalet190 # Logs cache store actions too191 #192 # Revision 1.20 2003/10/02 20:23:18 jalet193 # Storage caching mechanism added.194 #195 # Revision 1.19 2003/07/16 21:53:07 jalet196 # Really big modifications wrt new configuration file's location and content.197 #198 # Revision 1.18 2003/07/07 08:33:18 jalet199 # Bug fix due to a typo in LDAP code200 #201 # Revision 1.17 2003/07/05 07:46:50 jalet202 # The previous bug fix was incomplete.203 #204 # Revision 1.16 2003/06/25 19:52:31 jalet205 # Should be ready for testing :-)206 #207 # Revision 1.15 2003/06/25 14:10:58 jalet208 # Exception raising for now.209 #210 # Revision 1.14 2003/06/25 14:10:01 jalet211 # Hey, it may work (edpykota --reset excepted) !212 #213 # Revision 1.13 2003/06/10 16:37:54 jalet214 # Deletion of the second user which is not needed anymore.215 # Added a debug configuration field in /etc/pykota.conf216 # All queries can now be sent to the logger in debug mode, this will217 # greatly help improve performance when time for this will come.218 #219 # Revision 1.12 2003/04/23 22:13:57 jalet220 # Preliminary support for LPRng added BUT STILL UNTESTED.221 #222 # Revision 1.11 2003/04/10 21:47:20 jalet223 # Job history added. Upgrade script neutralized for now !224 #225 # Revision 1.10 2003/03/29 13:45:27 jalet226 # GPL paragraphs were incorrectly (from memory) copied into the sources.227 # Two README files were added.228 # Upgrade script for PostgreSQL pre 1.01 schema was added.229 #230 # Revision 1.9 2003/02/17 22:55:01 jalet231 # More options can now be set per printer or globally :232 #233 # admin234 # adminmail235 # gracedelay236 # requester237 #238 # the printer option has priority when both are defined.239 #240 # Revision 1.8 2003/02/17 22:05:50 jalet241 # Storage backend now supports admin and user passwords (untested)242 #243 # Revision 1.7 2003/02/10 12:07:31 jalet244 # Now repykota should output the recorded total page number for each printer too.245 #246 # Revision 1.6 2003/02/09 13:05:43 jalet247 # Internationalization continues...248 #249 # Revision 1.5 2003/02/08 22:39:46 jalet250 # --reset command line option added251 #252 # Revision 1.4 2003/02/08 09:59:59 jalet253 # Added preliminary base class for all storages254 #255 # Revision 1.3 2003/02/05 22:10:29 jalet256 # Typos257 #258 # Revision 1.2 2003/02/05 22:02:22 jalet259 # __import__ statement didn't work as expected260 #261 # Revision 1.1 2003/02/05 21:28:17 jalet262 # Initial import into CVS263 #264 22 # 265 23 # -
pykota/trunk/pykota/storages/dbistorage.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.2 2004/09/24 21:19:48 jalet25 # Did a pass of PyChecker26 #27 # Revision 1.1 2004/02/02 22:44:15 jalet28 # Preliminary work on Relationnal Database Independance via DB-API 2.029 #30 22 # 31 23 # -
pykota/trunk/pykota/storages/ldapstorage.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.103 2005/02/25 14:47:27 jalet25 # Improved robustness for manually modified LDAP trees26 #27 # Revision 1.102 2005/02/25 14:31:07 jalet28 # Improved robustness29 #30 # Revision 1.101 2005/02/13 22:48:37 jalet31 # Added the md5sum to the history32 #33 # Revision 1.100 2005/02/13 22:02:29 jalet34 # Big database structure changes. Upgrade script is now included as well as35 # the new LDAP schema.36 # Introduction of the -o | --overcharge command line option to edpykota.37 # The output of repykota is more complete, but doesn't fit in 80 columns anymore.38 # Introduction of the new 'maxdenybanners' directive.39 #40 # Revision 1.99 2005/01/24 17:44:17 jalet41 # Same fix for group print quota entries wrt LDAP performance42 #43 # Revision 1.98 2005/01/24 17:35:24 jalet44 # Performance improvement for user print quota entries search45 #46 # Revision 1.97 2005/01/24 17:27:35 jalet47 # typo48 #49 # Revision 1.96 2005/01/24 15:38:51 jalet50 # Fixed some ldap filters51 #52 # Revision 1.95 2005/01/18 19:47:50 jalet53 # Big bug fix wrt the datelimit attribute54 #55 # Revision 1.94 2005/01/01 18:53:27 jalet56 # Implemented in the LDAP backend code the same fix than in PostgreSQL backend57 # code for people who don't use PyKota tools to manage accounts.58 #59 # Revision 1.93 2004/12/31 16:10:57 jalet60 # Fixed recently introduced bugs due to extended userquotabase and groupquotabase61 # directives.62 #63 # Revision 1.92 2004/12/26 14:50:51 jalet64 # Normalized fields names in dumpykota's output so that an LDAP or PostgreSQL65 # dump is parseable the same way.66 #67 # Revision 1.91 2004/12/21 16:46:25 jalet68 # dumpykota's filtering capabilities are now supported within the LDAP69 # backend as well as within the PostgreSQL backend. Untested though since70 # my only PyKota+LDAP setup is on my laptop at work :-)71 #72 # Revision 1.90 2004/12/21 14:45:31 jalet73 # Prepared dumpykota to accept the new --filter command line option. Some74 # additionnal work needs to be done in the backends though.75 #76 # Revision 1.89 2004/12/02 22:27:11 jalet77 # Integrated and extended Stefan Wold's patch to store print quota entries78 # directly below the user or the group object with the LDAP backend79 #80 # Revision 1.88 2004/12/02 22:01:58 jalet81 # TLS is now supported with the LDAP backend82 #83 # Revision 1.87 2004/12/02 12:34:00 jalet84 # Now automates LDAP reconnections if the server dropped the connection due85 # to a timeout.86 #87 # Revision 1.86 2004/10/25 14:12:25 jalet88 # For URGENT legal reasons (Italy), a new "privacy" directive was added to pykota.conf89 # to hide print jobs' title, filename, and options.90 #91 # Revision 1.85 2004/10/24 12:55:09 jalet92 # Missing spaces93 #94 # Revision 1.84 2004/10/12 08:58:53 jalet95 # Now warnpykota only warns users who have already printed, to not confuse96 # users who have just opened their account.97 #98 # Revision 1.83 2004/10/07 21:14:28 jalet99 # Hopefully final fix for data encoding to and from the database100 #101 # Revision 1.82 2004/10/05 09:59:20 jalet102 # Restore compatibility with Python 2.1103 #104 # Revision 1.81 2004/10/04 11:27:57 jalet105 # Finished LDAP support for dumpykota.106 #107 # Revision 1.80 2004/10/03 19:57:57 jalet108 # Dump of payments should work with LDAP backend now.109 #110 # Revision 1.79 2004/10/03 19:52:59 jalet111 # More work done on LDAP and dumpykota112 #113 # Revision 1.78 2004/10/02 05:48:56 jalet114 # Should now correctly deal with charsets both when storing into databases and when115 # retrieving datas. Works with both PostgreSQL and LDAP.116 #117 # Revision 1.77 2004/09/28 14:29:00 jalet118 # dumpykota for LDAP backend is almost there.119 #120 # Revision 1.76 2004/09/28 09:11:56 jalet121 # Fix for accented chars in print job's title, filename, and options122 #123 # Revision 1.75 2004/09/24 20:21:50 jalet124 # Fixed pykotaAccountBalance object location during creation125 #126 # Revision 1.74 2004/09/02 10:09:30 jalet127 # Fixed bug in LDAP user deletion code which didn't correctly delete the user's128 # pykotaLastJob entries.129 #130 # Revision 1.73 2004/07/17 20:37:27 jalet131 # Missing file... Am I really stupid ?132 #133 # Revision 1.72 2004/07/01 19:56:43 jalet134 # Better dispatching of error messages135 #136 # Revision 1.71 2004/07/01 17:45:49 jalet137 # Added code to handle the description field for printers138 #139 # Revision 1.70 2004/06/10 20:50:25 jalet140 # Better log message141 #142 # Revision 1.69 2004/06/05 22:18:04 jalet143 # Now catches some exceptions earlier.144 # storage.py and ldapstorage.py : removed old comments145 #146 # Revision 1.68 2004/06/05 22:03:50 jalet147 # Payments history is now stored in database148 #149 # Revision 1.67 2004/06/03 23:14:10 jalet150 # Now stores the job's size in bytes in the database.151 # Preliminary work on payments storage : database schemas are OK now,152 # but no code to store payments yet.153 # Removed schema picture, not relevant anymore.154 #155 # Revision 1.66 2004/05/28 20:56:45 jalet156 # Extended syntax for LDAP specific newuser and newgroup directives. Untested.157 #158 # Revision 1.65 2004/05/27 12:52:12 jalet159 # More useful error message in case of misconfiguration of an LDAP search base160 # in pykota.conf161 #162 # Revision 1.64 2004/05/26 14:50:01 jalet163 # First try at saving the job-originating-hostname in the database164 #165 # Revision 1.63 2004/05/06 12:37:46 jalet166 # pkpgcounter : comments167 # pkprinters : when --add is used, existing printers are now skipped.168 #169 # Revision 1.62 2004/03/05 14:31:58 jalet170 # Improvement on strange history entries171 #172 # Revision 1.61 2004/03/05 13:19:53 jalet173 # Code safer wrt entries created in other tools174 #175 # Revision 1.60 2004/03/02 14:39:02 jalet176 # Final fix for printers searching177 #178 # Revision 1.59 2004/03/02 14:35:46 jalet179 # Missing test when searching printer objects when these objects were manually180 # created and don't contain the pykotaPrinterName attribute181 #182 # Revision 1.58 2004/02/27 09:30:33 jalet183 # datelimit wasn't reset when modifying soft and hard limits with the LDAP backend184 #185 # Revision 1.57 2004/02/26 14:18:07 jalet186 # Should fix the remaining bugs wrt printers groups and users groups.187 #188 # Revision 1.56 2004/02/25 16:52:39 jalet189 # Small fix wrt empty user groups190 #191 # Revision 1.55 2004/02/23 22:53:21 jalet192 # Don't retrieve data when it's not needed, to avoid database queries193 #194 # Revision 1.54 2004/02/20 16:38:39 jalet195 # ldapcache directive marked as experimental196 #197 # Revision 1.53 2004/02/20 14:42:21 jalet198 # Experimental ldapcache directive added199 #200 # Revision 1.52 2004/02/17 23:41:48 jalet201 # Preliminary work on low-level LDAP specific cache.202 #203 # Revision 1.51 2004/02/04 13:24:41 jalet204 # pkprinters can now remove printers from printers groups.205 #206 # Revision 1.50 2004/02/04 11:17:00 jalet207 # pkprinters command line tool added.208 #209 # Revision 1.49 2004/01/29 22:35:45 jalet210 # Small fix from Matt.211 #212 # Revision 1.48 2004/01/12 14:35:02 jalet213 # Printing history added to CGI script.214 #215 # Revision 1.47 2004/01/10 09:44:02 jalet216 # Fixed potential accuracy problem if a user printed on several printers at217 # the very same time.218 #219 # Revision 1.46 2004/01/08 16:33:27 jalet220 # Additionnal check to not create a circular printers group.221 #222 # Revision 1.45 2004/01/08 16:24:49 jalet223 # edpykota now supports adding printers to printer groups.224 #225 # Revision 1.44 2004/01/08 14:10:33 jalet226 # Copyright year changed.227 #228 # Revision 1.43 2004/01/06 14:24:59 jalet229 # Printer groups should be cached now, if caching is enabled.230 #231 # Revision 1.42 2003/12/29 14:12:48 uid67467232 # Tries to workaround possible integrity violations when retrieving printer groups233 #234 # Revision 1.41 2003/12/27 16:49:25 uid67467235 # Should be ok now.236 #237 # Revision 1.40 2003/11/29 22:02:14 jalet238 # Don't try to retrieve the user print quota information if current printer239 # doesn't exist.240 #241 # Revision 1.39 2003/11/26 23:35:32 jalet242 # Added a bit of code to support the setting of the user's email address243 # which was ignored during writes for now.244 #245 # Revision 1.38 2003/11/24 09:54:06 jalet246 # Small fix for LDAP when pykotaOptions attribute wasn't present.247 #248 # Revision 1.37 2003/11/23 19:01:37 jalet249 # Job price added to history250 #251 # Revision 1.36 2003/11/21 14:28:46 jalet252 # More complete job history.253 #254 # Revision 1.35 2003/11/12 13:06:37 jalet255 # Bug fix wrt no user/group name command line argument to edpykota256 #257 # Revision 1.34 2003/10/24 08:37:55 jalet258 # More complete messages in case of LDAP failure.259 # LDAP database connection is now unbound on exit too.260 #261 # Revision 1.33 2003/10/08 07:01:20 jalet262 # Job history can be disabled.263 # Some typos in README.264 # More messages in setup script.265 #266 # Revision 1.32 2003/10/07 14:23:25 jalet267 # More work on cache268 #269 # Revision 1.31 2003/10/07 09:07:30 jalet270 # Character encoding added to please latest version of Python271 #272 # Revision 1.30 2003/10/06 14:42:36 jalet273 # LDAP group access will be slower when cache is disabled, but at least code274 # is consistent with the rest of the caching mechanis, but at least code275 # is consistent with the rest of the caching mechanism276 #277 # Revision 1.29 2003/10/06 13:12:28 jalet278 # More work on caching279 #280 # Revision 1.28 2003/10/03 12:27:02 jalet281 # Several optimizations, especially with LDAP backend282 #283 # Revision 1.27 2003/10/03 08:57:55 jalet284 # Caching mechanism now caches all that's cacheable.285 #286 # Revision 1.26 2003/10/02 20:23:18 jalet287 # Storage caching mechanism added.288 #289 # Revision 1.25 2003/08/20 15:56:24 jalet290 # Better user and group deletion291 #292 # Revision 1.24 2003/07/29 20:55:17 jalet293 # 1.14 is out !294 #295 # Revision 1.23 2003/07/29 19:52:32 jalet296 # Forgot to read the email field from LDAP297 #298 # Revision 1.22 2003/07/29 09:54:03 jalet299 # Added configurable LDAP mail attribute support300 #301 # Revision 1.21 2003/07/28 09:11:12 jalet302 # PyKota now tries to add its attributes intelligently in existing LDAP303 # directories.304 #305 # Revision 1.20 2003/07/25 10:41:30 jalet306 # Better documentation.307 # pykotme now displays the current user's account balance.308 # Some test changed in ldap module.309 #310 # Revision 1.19 2003/07/14 14:18:16 jalet311 # Wrong documentation strings312 #313 # Revision 1.18 2003/07/11 14:23:13 jalet314 # When adding an user only adds one object containing both the user and315 # its account balance instead of two objects.316 #317 # Revision 1.17 2003/07/07 12:51:07 jalet318 # Small fix319 #320 # Revision 1.16 2003/07/07 12:11:13 jalet321 # Small fix322 #323 # Revision 1.15 2003/07/07 11:49:24 jalet324 # Lots of small fixes with the help of PyChecker325 #326 # Revision 1.14 2003/07/07 08:33:18 jalet327 # Bug fix due to a typo in LDAP code328 #329 # Revision 1.13 2003/07/05 07:46:50 jalet330 # The previous bug fix was incomplete.331 #332 # Revision 1.12 2003/06/30 13:54:21 jalet333 # Sorts by user / group name334 #335 # Revision 1.11 2003/06/25 14:10:01 jalet336 # Hey, it may work (edpykota --reset excepted) !337 #338 # Revision 1.10 2003/06/16 21:55:15 jalet339 # More work on LDAP, again. Problem detected.340 #341 # Revision 1.9 2003/06/16 11:59:09 jalet342 # More work on LDAP343 #344 # Revision 1.8 2003/06/15 22:26:52 jalet345 # More work on LDAP346 #347 # Revision 1.7 2003/06/14 22:44:21 jalet348 # More work on LDAP storage backend.349 #350 # Revision 1.6 2003/06/13 19:07:57 jalet351 # Two big bugs fixed, time to release something ;-)352 #353 # Revision 1.5 2003/06/10 16:37:54 jalet354 # Deletion of the second user which is not needed anymore.355 # Added a debug configuration field in /etc/pykota.conf356 # All queries can now be sent to the logger in debug mode, this will357 # greatly help improve performance when time for this will come.358 #359 # Revision 1.4 2003/06/10 10:45:32 jalet360 # Not implemented methods now raise an exception when called.361 #362 # Revision 1.3 2003/06/06 20:49:15 jalet363 # Very latest schema. UNTESTED.364 #365 # Revision 1.2 2003/06/06 14:21:08 jalet366 # New LDAP schema.367 # Small bug fixes.368 #369 # Revision 1.1 2003/06/05 11:19:13 jalet370 # More good work on LDAP storage.371 #372 22 # 373 23 # -
pykota/trunk/pykota/storages/pgstorage.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.39 2005/01/19 08:56:30 jalet25 # Convert PygreSQL's new exception into a string before re-raising it26 #27 # Revision 1.38 2005/01/19 08:48:17 jalet28 # Fix exception's name wrt newer versions of PygreSQL29 #30 # Revision 1.37 2004/09/14 22:29:12 jalet31 # First version of dumpykota. Works fine but only with PostgreSQL backend32 # for now.33 #34 # Revision 1.36 2004/06/03 23:14:11 jalet35 # Now stores the job's size in bytes in the database.36 # Preliminary work on payments storage : database schemas are OK now,37 # but no code to store payments yet.38 # Removed schema picture, not relevant anymore.39 #40 # Revision 1.35 2004/02/02 22:44:16 jalet41 # Preliminary work on Relationnal Database Independance via DB-API 2.042 #43 # Revision 1.34 2004/01/12 15:12:50 jalet44 # Small fix for history45 #46 # Revision 1.33 2004/01/12 14:44:47 jalet47 # Missing space in SQL query48 #49 # Revision 1.32 2004/01/12 14:35:02 jalet50 # Printing history added to CGI script.51 #52 # Revision 1.31 2004/01/10 09:44:02 jalet53 # Fixed potential accuracy problem if a user printed on several printers at54 # the very same time.55 #56 # Revision 1.30 2004/01/08 16:33:27 jalet57 # Additionnal check to not create a circular printers group.58 #59 # Revision 1.29 2004/01/08 16:24:49 jalet60 # edpykota now supports adding printers to printer groups.61 #62 # Revision 1.28 2004/01/08 14:10:33 jalet63 # Copyright year changed.64 #65 # Revision 1.27 2004/01/06 14:24:59 jalet66 # Printer groups should be cached now, if caching is enabled.67 #68 # Revision 1.26 2003/12/29 14:12:48 uid6746769 # Tries to workaround possible integrity violations when retrieving printer groups70 #71 # Revision 1.25 2003/12/27 16:49:25 uid6746772 # Should be ok now.73 #74 # Revision 1.24 2003/11/29 22:02:14 jalet75 # Don't try to retrieve the user print quota information if current printer76 # doesn't exist.77 #78 # Revision 1.23 2003/11/23 19:01:37 jalet79 # Job price added to history80 #81 # Revision 1.22 2003/11/21 14:28:46 jalet82 # More complete job history.83 #84 # Revision 1.21 2003/11/12 13:06:38 jalet85 # Bug fix wrt no user/group name command line argument to edpykota86 #87 # Revision 1.20 2003/10/09 21:25:26 jalet88 # Multiple printer names or wildcards can be passed on the command line89 # separated with commas.90 # Beta phase.91 #92 # Revision 1.19 2003/10/08 07:01:20 jalet93 # Job history can be disabled.94 # Some typos in README.95 # More messages in setup script.96 #97 # Revision 1.18 2003/10/07 09:07:30 jalet98 # Character encoding added to please latest version of Python99 #100 # Revision 1.17 2003/10/06 13:12:28 jalet101 # More work on caching102 #103 # Revision 1.16 2003/10/03 18:01:49 jalet104 # Nothing interesting...105 #106 # Revision 1.15 2003/10/03 12:27:03 jalet107 # Several optimizations, especially with LDAP backend108 #109 # Revision 1.14 2003/10/03 08:57:55 jalet110 # Caching mechanism now caches all that's cacheable.111 #112 # Revision 1.13 2003/10/02 20:23:18 jalet113 # Storage caching mechanism added.114 #115 # Revision 1.12 2003/08/17 14:20:25 jalet116 # Bug fix by Oleg Biteryakov117 #118 # Revision 1.11 2003/07/29 20:55:17 jalet119 # 1.14 is out !120 #121 # Revision 1.10 2003/07/16 21:53:08 jalet122 # Really big modifications wrt new configuration file's location and content.123 #124 # Revision 1.9 2003/07/14 17:20:15 jalet125 # Bug in postgresql storage when modifying the prices for a printer126 #127 # Revision 1.8 2003/07/14 14:18:17 jalet128 # Wrong documentation strings129 #130 # Revision 1.7 2003/07/09 20:17:07 jalet131 # Email field added to PostgreSQL schema132 #133 # Revision 1.6 2003/07/07 11:49:24 jalet134 # Lots of small fixes with the help of PyChecker135 #136 # Revision 1.5 2003/07/07 08:33:19 jalet137 # Bug fix due to a typo in LDAP code138 #139 # Revision 1.4 2003/06/30 13:54:21 jalet140 # Sorts by user / group name141 #142 # Revision 1.3 2003/06/25 14:10:01 jalet143 # Hey, it may work (edpykota --reset excepted) !144 #145 # Revision 1.2 2003/06/12 21:09:57 jalet146 # wrongly placed code.147 #148 # Revision 1.1 2003/06/10 16:37:54 jalet149 # Deletion of the second user which is not needed anymore.150 # Added a debug configuration field in /etc/pykota.conf151 # All queries can now be sent to the logger in debug mode, this will152 # greatly help improve performance when time for this will come.153 #154 #155 22 # 156 23 # -
pykota/trunk/pykota/storages/sql.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.67 2005/02/16 00:29:33 jalet25 # Fixed the maxdenybanners directive.26 # Introduced the denyduplicates directive.27 # Fixed some database related glitches.28 #29 # Revision 1.66 2005/02/13 22:48:38 jalet30 # Added the md5sum to the history31 #32 # Revision 1.65 2005/02/13 22:02:29 jalet33 # Big database structure changes. Upgrade script is now included as well as34 # the new LDAP schema.35 # Introduction of the -o | --overcharge command line option to edpykota.36 # The output of repykota is more complete, but doesn't fit in 80 columns anymore.37 # Introduction of the new 'maxdenybanners' directive.38 #39 # Revision 1.64 2005/01/18 19:47:50 jalet40 # Big bug fix wrt the datelimit attribute41 #42 # Revision 1.63 2005/01/01 08:16:17 jalet43 # Fixed a problem which occured when 'limitby' was unset in the PostgreSQL44 # database45 #46 # Revision 1.62 2004/12/21 16:19:44 jalet47 # Fixed the problem with dumpykota's filtering of printers groups membership48 #49 # Revision 1.61 2004/12/21 15:49:59 jalet50 # The dumpykota command now supports extended filtering capabilities with51 # the PostgreSQL backend. LDAP doesn't yet support such possibilities.52 #53 # Revision 1.60 2004/12/21 14:45:31 jalet54 # Prepared dumpykota to accept the new --filter command line option. Some55 # additionnal work needs to be done in the backends though.56 #57 # Revision 1.59 2004/10/25 14:12:25 jalet58 # For URGENT legal reasons (Italy), a new "privacy" directive was added to pykota.conf59 # to hide print jobs' title, filename, and options.60 #61 # Revision 1.58 2004/10/12 08:58:53 jalet62 # Now warnpykota only warns users who have already printed, to not confuse63 # users who have just opened their account.64 #65 # Revision 1.57 2004/10/10 10:12:21 jalet66 # Improved SQL queries for groups. Same work has to be done for groups print quotas.67 #68 # Revision 1.56 2004/10/07 21:14:28 jalet69 # Hopefully final fix for data encoding to and from the database70 #71 # Revision 1.55 2004/10/07 09:37:53 jalet72 # Fixes recently introduced bug wrt users groups (was it three days ago ?)73 #74 # Revision 1.54 2004/10/05 10:05:04 jalet75 # UnicodeEncodeError isn't defined in Python2.176 #77 # Revision 1.53 2004/10/05 09:59:20 jalet78 # Restore compatibility with Python 2.179 #80 # Revision 1.52 2004/10/04 22:23:54 jalet81 # Charset conversions for dumps from the PostgreSQL backend82 #83 # Revision 1.51 2004/10/04 16:11:38 jalet84 # Now outputs page counters when dumping user groups quotas85 #86 # Revision 1.50 2004/10/04 16:01:15 jalet87 # More complete dumps for groups and groups quotas88 #89 # Revision 1.49 2004/10/02 13:33:13 jalet90 # Some work done of user's charset handling in database dumps.91 #92 # Revision 1.48 2004/10/02 05:48:56 jalet93 # Should now correctly deal with charsets both when storing into databases and when94 # retrieving datas. Works with both PostgreSQL and LDAP.95 #96 # Revision 1.47 2004/09/15 07:26:20 jalet97 # Data dumps are now ordered by entry creation date if applicable.98 # Now dumpykota exits with a message when there's a broken pipe like99 # in dumpykota --data history | head -3100 #101 # Revision 1.46 2004/09/15 06:58:25 jalet102 # User groups membership and printer groups membership can now be dumped too103 #104 # Revision 1.45 2004/09/14 22:29:13 jalet105 # First version of dumpykota. Works fine but only with PostgreSQL backend106 # for now.107 #108 # Revision 1.44 2004/09/10 21:32:54 jalet109 # Small fixes for incomplete entry intialization110 #111 # Revision 1.43 2004/07/01 17:45:49 jalet112 # Added code to handle the description field for printers113 #114 # Revision 1.42 2004/06/08 17:44:43 jalet115 # Payment now gets deleted when the user is deleted116 #117 # Revision 1.41 2004/06/05 22:03:50 jalet118 # Payments history is now stored in database119 #120 # Revision 1.40 2004/06/03 23:14:11 jalet121 # Now stores the job's size in bytes in the database.122 # Preliminary work on payments storage : database schemas are OK now,123 # but no code to store payments yet.124 # Removed schema picture, not relevant anymore.125 #126 # Revision 1.39 2004/05/26 14:50:12 jalet127 # First try at saving the job-originating-hostname in the database128 #129 # Revision 1.38 2004/05/06 12:37:47 jalet130 # pkpgcounter : comments131 # pkprinters : when --add is used, existing printers are now skipped.132 #133 # Revision 1.37 2004/02/23 22:53:21 jalet134 # Don't retrieve data when it's not needed, to avoid database queries135 #136 # Revision 1.36 2004/02/04 13:24:41 jalet137 # pkprinters can now remove printers from printers groups.138 #139 # Revision 1.35 2004/02/04 11:17:00 jalet140 # pkprinters command line tool added.141 #142 # Revision 1.34 2004/02/02 22:44:16 jalet143 # Preliminary work on Relationnal Database Independance via DB-API 2.0144 #145 22 # 146 23 # -
pykota/trunk/pykota/tool.py
r2146 r2147 20 20 # 21 21 # $Id$ 22 #23 # $Log$24 # Revision 1.151 2005/02/22 17:56:58 jalet25 # Now logs the type of user running the command : mere mortal vs PyKota Admin26 #27 # Revision 1.150 2005/02/14 22:53:44 jalet28 # Now always precomputes the job's size with the internal PDL parser, and not29 # only when 'enforcement: strict' was set in pykota.conf30 #31 # Revision 1.149 2005/02/13 22:02:29 jalet32 # Big database structure changes. Upgrade script is now included as well as33 # 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 jalet39 # Regain priviledge the time to open the job's data file when printing in40 # raw mode with CUPS.41 #42 # Revision 1.147 2005/01/06 22:52:53 jalet43 # Implemented the dropping of priviledges. Beware, beware...44 #45 # Revision 1.146 2004/12/09 23:03:57 jalet46 # 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 jalet49 # Now PyKota searches its configuration files first in system user pykota's50 # home directory51 #52 # Revision 1.144 2004/11/18 06:01:53 jalet53 # Fix for the fix54 #55 # Revision 1.143 2004/11/18 05:54:15 jalet56 # Fix problem with spaces at the end of filenames in LPRng57 #58 # Revision 1.142 2004/11/16 23:15:05 jalet59 # Fix for LPRng job's file detection code60 #61 # Revision 1.141 2004/11/15 22:01:34 jalet62 # Improved banner handling.63 # Fix for raw printing and banners.64 #65 # Revision 1.140 2004/11/15 19:59:34 jalet66 # PyKota banners now basically work !67 #68 # Revision 1.139 2004/11/15 15:54:03 jalet69 # Continued integration of Matt's patch for banners70 #71 # Revision 1.138 2004/11/12 23:46:44 jalet72 # Heavy work on pkbanner. Not finished yet though, but mostly works.73 #74 # Revision 1.137 2004/11/01 16:21:17 jalet75 # Little change for locale+gettext76 #77 # Revision 1.136 2004/10/24 09:06:46 jalet78 # Added debug messages for LPRng support possible problem ???79 #80 # Revision 1.135 2004/10/20 14:29:30 jalet81 # Now logs something when locale settings are incorrect.82 #83 # Revision 1.134 2004/10/20 08:12:27 jalet84 # Another fix for charset detection and Python2.385 #86 # Revision 1.133 2004/10/19 22:24:00 jalet87 # Should fix the printer's hostname or IP address detection code.88 #89 # Revision 1.132 2004/10/19 21:45:25 jalet90 # Now correctly logs command line arguments91 #92 # Revision 1.131 2004/10/19 21:37:57 jalet93 # Fixes recently introduced bug94 #95 # Revision 1.130 2004/10/19 15:21:48 jalet96 # Fixed incorrect setting of the user's locale97 #98 # Revision 1.129 2004/10/13 20:51:27 jalet99 # Made debugging levels be the same in cupspykota and lprngpykota.100 # Now outputs more information in informational messages : user, printer, jobid101 #102 # Revision 1.128 2004/10/11 22:53:06 jalet103 # Postponed string interpolation to help message's output method104 #105 # Revision 1.127 2004/10/11 12:48:38 jalet106 # Adds fake translation marker107 #108 # Revision 1.126 2004/10/05 09:41:13 jalet109 # Small fix for errors caused by unknown locale110 #111 # Revision 1.125 2004/10/04 11:18:10 jalet112 # Now exports the MD5 sum of the job's datas as an hexadecimal digest113 #114 # Revision 1.124 2004/10/02 05:48:56 jalet115 # Should now correctly deal with charsets both when storing into databases and when116 # retrieving datas. Works with both PostgreSQL and LDAP.117 #118 # Revision 1.123 2004/09/29 20:20:52 jalet119 # Added the winbind_separator directive to pykota.conf to allow the admin to120 # strip out the Samba/Winbind domain name when users print.121 #122 # Revision 1.122 2004/09/28 21:38:56 jalet123 # 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 jalet127 # Re-Extends the list of invalid characters in names to prevent128 # people from adding user "*" for example, or to prevent129 # print administrators to hijack the system by putting dangerous130 # datas into the database which would cause commands later run by root131 # to compromise the system.132 #133 # Revision 1.120 2004/09/02 13:26:29 jalet134 # Small fix for old versions of LPRng135 #136 # Revision 1.119 2004/09/02 13:09:58 jalet137 # Now exports PYKOTAPRINTERHOSTNAME138 #139 # Revision 1.118 2004/08/06 20:46:45 jalet140 # Finished group quota fix for balance when no user in group has a balance141 #142 # Revision 1.117 2004/08/06 13:45:51 jalet143 # Fixed french translation problem.144 # Fixed problem with group quotas and strict enforcement.145 #146 # Revision 1.116 2004/07/24 20:20:29 jalet147 # Unitialized variable148 #149 # Revision 1.115 2004/07/21 09:35:48 jalet150 # Software accounting seems to be OK with LPRng support now151 #152 # Revision 1.114 2004/07/20 22:19:45 jalet153 # Sanitized a bit + use of gettext154 #155 # Revision 1.113 2004/07/17 20:37:27 jalet156 # Missing file... Am I really stupid ?157 #158 # Revision 1.112 2004/07/16 12:22:47 jalet159 # LPRng support early version160 #161 # Revision 1.111 2004/07/06 18:09:42 jalet162 # Reduced the set of invalid characters in names163 #164 # Revision 1.110 2004/07/01 19:56:42 jalet165 # Better dispatching of error messages166 #167 # Revision 1.109 2004/07/01 17:45:49 jalet168 # Added code to handle the description field for printers169 #170 # Revision 1.108 2004/06/24 23:09:30 jalet171 # Also prints read size on last block172 #173 # Revision 1.107 2004/06/23 13:03:28 jalet174 # Catches accounter configuration errors earlier175 #176 # Revision 1.106 2004/06/22 09:31:18 jalet177 # Always send some debug info to CUPS' back channel stream (stderr) as178 # informationnal messages.179 #180 # Revision 1.105 2004/06/21 08:17:38 jalet181 # Added version number in subject message for directive crashrecipient.182 #183 # Revision 1.104 2004/06/18 13:34:49 jalet184 # Now all tracebacks include PyKota's version number185 #186 # Revision 1.103 2004/06/18 13:17:26 jalet187 # Now includes PyKota's version number in messages sent by the crashrecipient188 # directive.189 #190 # Revision 1.102 2004/06/17 13:26:51 jalet191 # Better exception handling code192 #193 # Revision 1.101 2004/06/16 20:56:34 jalet194 # Smarter initialisation code195 #196 # Revision 1.100 2004/06/11 08:16:03 jalet197 # More exceptions catched in case of very early failure.198 #199 # Revision 1.99 2004/06/11 07:07:38 jalet200 # Now detects and logs configuration syntax errors instead of failing without201 # any notice message.202 #203 # Revision 1.98 2004/06/08 19:27:12 jalet204 # Doesn't ignore SIGCHLD anymore205 #206 # Revision 1.97 2004/06/07 22:45:35 jalet207 # Now accepts a job when enforcement is STRICT and predicted account balance208 # is equal to 0.0 : since the job hasn't been printed yet, only its printing209 # 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 jalet212 # Now catches some exceptions earlier.213 # storage.py and ldapstorage.py : removed old comments214 #215 # Revision 1.95 2004/06/03 21:50:34 jalet216 # 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 jalet221 # logs job's size in bytes now222 #223 # Revision 1.93 2004/06/02 21:51:02 jalet224 # Moved the sigterm capturing elsewhere225 #226 # Revision 1.92 2004/06/02 13:21:38 jalet227 # Debug message added228 #229 # Revision 1.91 2004/05/25 05:17:52 jalet230 # Now precomputes the job's size only if current printer's enforcement231 # is "STRICT"232 #233 # Revision 1.90 2004/05/24 22:45:49 jalet234 # New 'enforcement' directive added235 # Polling loop improvements236 #237 # Revision 1.89 2004/05/21 22:02:52 jalet238 # Preliminary work on pre-accounting239 #240 # Revision 1.88 2004/05/18 14:49:20 jalet241 # 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 jalet245 # Now catches SIGPIPE and SIGCHLD246 #247 # Revision 1.86 2004/05/13 13:59:28 jalet248 # Code simplifications249 #250 # Revision 1.85 2004/05/11 08:26:27 jalet251 # Now catches connection problems to SMTP server252 #253 # Revision 1.84 2004/04/21 08:36:32 jalet254 # Exports the PYKOTASTATUS environment variable when SIGTERM is received.255 #256 # Revision 1.83 2004/04/16 17:03:49 jalet257 # The list of printers groups the current printer is a member of is258 # now exported in the PYKOTAPGROUPS environment variable259 #260 # Revision 1.82 2004/04/13 09:38:03 jalet261 # More work on correct child processes handling262 #263 # Revision 1.81 2004/04/09 22:24:47 jalet264 # Began work on correct handling of child processes when jobs are cancelled by265 # the user. Especially important when an external requester is running for a266 # long time.267 #268 # Revision 1.80 2004/04/06 12:00:21 jalet269 # uninitialized values caused problems270 #271 # Revision 1.79 2004/03/28 21:01:29 jalet272 # PYKOTALIMITBY environment variable is now exported too273 #274 # Revision 1.78 2004/03/08 20:13:25 jalet275 # Allow names to begin with a digit276 #277 # Revision 1.77 2004/03/03 13:10:35 jalet278 # Now catches all smtplib exceptions when there's a problem sending messages279 #280 # Revision 1.76 2004/03/01 14:34:15 jalet281 # PYKOTAPHASE wasn't set at the right time at the end of data transmission282 # to underlying layer (real backend)283 #284 # Revision 1.75 2004/03/01 11:23:25 jalet285 # Pre and Post hooks to external commands are available in the cupspykota286 # backend. Forthe pykota filter they will be implemented real soon now.287 #288 # Revision 1.74 2004/02/26 14:18:07 jalet289 # Should fix the remaining bugs wrt printers groups and users groups.290 #291 # Revision 1.73 2004/02/19 14:20:21 jalet292 # maildomain pykota.conf directive added.293 # Small improvements on mail headers quality.294 #295 # Revision 1.72 2004/01/14 15:51:19 jalet296 # Docstring added.297 #298 # Revision 1.71 2004/01/11 23:22:42 jalet299 # Major code refactoring, it's way cleaner, and now allows automated addition300 # of printers on first print.301 #302 # Revision 1.70 2004/01/08 14:10:32 jalet303 # Copyright year changed.304 #305 # Revision 1.69 2004/01/05 16:02:18 jalet306 # Dots in user, groups and printer names should be allowed.307 #308 # Revision 1.68 2004/01/02 17:38:40 jalet309 # This time it should be better...310 #311 # Revision 1.67 2004/01/02 17:37:09 jalet312 # I'm completely stupid !!! Better to not talk while coding !313 #314 # Revision 1.66 2004/01/02 17:31:26 jalet315 # Forgot to remove some code316 #317 # Revision 1.65 2003/12/06 08:14:38 jalet318 # Added support for CUPS device uris which contain authentication information.319 #320 # Revision 1.64 2003/11/29 22:03:17 jalet321 # Some code refactoring work. New code is not used at this time.322 #323 # Revision 1.63 2003/11/29 20:06:20 jalet324 # Added 'utolower' configuration option to convert all usernames to325 # lowercase when printing. All database accesses are still and will326 # remain case sensitive though.327 #328 # Revision 1.62 2003/11/25 22:37:22 jalet329 # Small code move330 #331 # Revision 1.61 2003/11/25 22:03:28 jalet332 # No more message on stderr when the translation is not available.333 #334 # Revision 1.60 2003/11/25 21:54:05 jalet335 # updated FAQ336 #337 # Revision 1.59 2003/11/25 13:33:43 jalet338 # Puts 'root' instead of '' when printing from CUPS web interface (which339 # gives an empty username)340 #341 # Revision 1.58 2003/11/21 14:28:45 jalet342 # More complete job history.343 #344 # Revision 1.57 2003/11/19 23:19:38 jalet345 # Code refactoring work.346 # Explicit redirection to /dev/null has to be set in external policy now, just347 # like in external mailto.348 #349 # Revision 1.56 2003/11/19 07:40:20 jalet350 # Missing import statement.351 # Better documentation for mailto: external(...)352 #353 # Revision 1.55 2003/11/18 23:43:12 jalet354 # Mailto can be any external command now, as usual.355 #356 # Revision 1.54 2003/10/24 21:52:46 jalet357 # Now can force language when coming from CGI script.358 #359 # Revision 1.53 2003/10/08 21:41:38 jalet360 # 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 jalet364 # Character encoding added to please latest version of Python365 #366 # Revision 1.51 2003/10/06 14:21:41 jalet367 # Test reversed to not retrieve group members when no messages for them.368 #369 # Revision 1.50 2003/10/02 20:23:18 jalet370 # Storage caching mechanism added.371 #372 # Revision 1.49 2003/07/29 20:55:17 jalet373 # 1.14 is out !374 #375 # Revision 1.48 2003/07/21 23:01:56 jalet376 # Modified some messages aout soft limit377 #378 # Revision 1.47 2003/07/16 21:53:08 jalet379 # Really big modifications wrt new configuration file's location and content.380 #381 # Revision 1.46 2003/07/09 20:17:07 jalet382 # Email field added to PostgreSQL schema383 #384 # Revision 1.45 2003/07/08 19:43:51 jalet385 # Configurable warning messages.386 # Poor man's treshold value added.387 #388 # Revision 1.44 2003/07/07 11:49:24 jalet389 # Lots of small fixes with the help of PyChecker390 #391 # Revision 1.43 2003/07/04 09:06:32 jalet392 # Small bug fix wrt undefined "LimitBy" field.393 #394 # Revision 1.42 2003/06/30 12:46:15 jalet395 # Extracted reporting code.396 #397 # Revision 1.41 2003/06/25 14:10:01 jalet398 # Hey, it may work (edpykota --reset excepted) !399 #400 # Revision 1.40 2003/06/10 16:37:54 jalet401 # Deletion of the second user which is not needed anymore.402 # Added a debug configuration field in /etc/pykota.conf403 # All queries can now be sent to the logger in debug mode, this will404 # greatly help improve performance when time for this will come.405 #406 # Revision 1.39 2003/04/29 18:37:54 jalet407 # Pluggable accounting methods (actually doesn't support external scripts)408 #409 # Revision 1.38 2003/04/24 11:53:48 jalet410 # Default policy for unknown users/groups is to DENY printing instead411 # of the previous default to ALLOW printing. This is to solve an accuracy412 # problem. If you set the policy to ALLOW, jobs printed by in nexistant user413 # (from PyKota's POV) will be charged to the next user who prints on the414 # same printer.415 #416 # Revision 1.37 2003/04/24 08:08:27 jalet417 # Debug message forgotten418 #419 # Revision 1.36 2003/04/24 07:59:40 jalet420 # LPRng support now works !421 #422 # Revision 1.35 2003/04/23 22:13:57 jalet423 # Preliminary support for LPRng added BUT STILL UNTESTED.424 #425 # Revision 1.34 2003/04/17 09:26:21 jalet426 # repykota now reports account balances too.427 #428 # Revision 1.33 2003/04/16 12:35:49 jalet429 # Groups quota work now !430 #431 # Revision 1.32 2003/04/16 08:53:14 jalet432 # Printing can now be limited either by user's account balance or by433 # page quota (the default). Quota report doesn't include account balance434 # yet, though.435 #436 # Revision 1.31 2003/04/15 11:30:57 jalet437 # 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 jalet442 # Job history added. Upgrade script neutralized for now !443 #444 # Revision 1.29 2003/03/29 13:45:27 jalet445 # 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 jalet450 # Configuration is now expected to be found in /etc/pykota.conf instead of451 # in /etc/cups/pykota.conf452 # 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 jalet456 # 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 jalet460 # Comment461 #462 # Revision 1.25 2003/03/07 22:56:14 jalet463 # 0.99 is out with some bug fixes.464 #465 # Revision 1.24 2003/02/27 23:48:41 jalet466 # Correctly maps PyKota's log levels to syslog log levels467 #468 # Revision 1.23 2003/02/27 22:55:20 jalet469 # WARN log priority doesn't exist.470 #471 # Revision 1.22 2003/02/27 09:09:20 jalet472 # Added a method to match strings against wildcard patterns473 #474 # Revision 1.21 2003/02/17 23:01:56 jalet475 # Typos476 #477 # Revision 1.20 2003/02/17 22:55:01 jalet478 # More options can now be set per printer or globally :479 #480 # admin481 # adminmail482 # gracedelay483 # requester484 #485 # the printer option has priority when both are defined.486 #487 # Revision 1.19 2003/02/10 11:28:45 jalet488 # Localization489 #490 # Revision 1.18 2003/02/10 01:02:17 jalet491 # External requester is about to work, but I must sleep492 #493 # Revision 1.17 2003/02/09 13:05:43 jalet494 # Internationalization continues...495 #496 # Revision 1.16 2003/02/09 12:56:53 jalet497 # Internationalization begins...498 #499 # Revision 1.15 2003/02/08 22:09:52 jalet500 # Name check method moved here501 #502 # Revision 1.14 2003/02/07 10:42:45 jalet503 # Indentation problem504 #505 # Revision 1.13 2003/02/07 08:34:16 jalet506 # Test wrt date limit was wrong507 #508 # Revision 1.12 2003/02/06 23:20:02 jalet509 # warnpykota doesn't need any user/group name argument, mimicing the510 # warnquota disk quota tool.511 #512 # Revision 1.11 2003/02/06 22:54:33 jalet513 # warnpykota should be ok514 #515 # Revision 1.10 2003/02/06 15:03:11 jalet516 # added a method to set the limit date517 #518 # Revision 1.9 2003/02/06 10:39:23 jalet519 # Preliminary edpykota work.520 #521 # Revision 1.8 2003/02/06 09:19:02 jalet522 # More robust behavior (hopefully) when the user or printer is not managed523 # correctly by the Quota System : e.g. cupsFilter added in ppd file, but524 # printer and/or user not 'yet?' in storage.525 #526 # Revision 1.7 2003/02/06 00:00:45 jalet527 # Now includes the printer name in email messages528 #529 # Revision 1.6 2003/02/05 23:55:02 jalet530 # Cleaner email messages531 #532 # Revision 1.5 2003/02/05 23:45:09 jalet533 # Better DateTime manipulation wrt grace delay534 #535 # Revision 1.4 2003/02/05 23:26:22 jalet536 # Incorrect handling of grace delay537 #538 # Revision 1.3 2003/02/05 22:16:20 jalet539 # DEVICE_URI is undefined outside of CUPS, i.e. for normal command line tools540 #541 # Revision 1.2 2003/02/05 22:10:29 jalet542 # Typos543 #544 # Revision 1.1 2003/02/05 21:28:17 jalet545 # Initial import into CVS546 #547 22 # 548 23 #