Index: pykota/trunk/bin/cupspykota
===================================================================
--- pykota/trunk/bin/cupspykota (revision 2146)
+++ pykota/trunk/bin/cupspykota (revision 2147)
@@ -22,318 +22,4 @@
 #
 # $Id$
-#
-# $Log$
-# Revision 1.89  2005/02/16 00:29:33  jalet
-# Fixed the maxdenybanners directive.
-# Introduced the denyduplicates directive.
-# Fixed some database related glitches.
-#
-# Revision 1.88  2005/02/14 23:39:50  jalet
-# Introduces the new 'trustjobsize' directive to workaround some printers
-# generating unstable internal page counter values when queried through SNMP.
-#
-# Revision 1.87  2005/02/14 22:53:44  jalet
-# Now always precomputes the job's size with the internal PDL parser, and not
-# only when 'enforcement: strict' was set in pykota.conf
-#
-# Revision 1.86  2005/02/13 22:48:37  jalet
-# Added the md5sum to the history
-#
-# Revision 1.85  2005/02/13 22:02:28  jalet
-# Big database structure changes. Upgrade script is now included as well as
-# the new LDAP schema.
-# Introduction of the -o | --overcharge command line option to edpykota.
-# The output of repykota is more complete, but doesn't fit in 80 columns anymore.
-# Introduction of the new 'maxdenybanners' directive.
-#
-# Revision 1.84  2005/01/17 08:44:23  jalet
-# Modified copyright years
-#
-# Revision 1.83  2005/01/06 23:23:35  jalet
-# Regain priviledge the time to read the job control file to extract the client
-# hostname
-#
-# Revision 1.82  2005/01/06 22:52:53  jalet
-# Implemented the dropping of priviledges. Beware, beware...
-#
-# Revision 1.81  2004/12/07 16:54:02  jalet
-# Now logs as errors differences between computed and precomputed job's sizes
-#
-# Revision 1.80  2004/11/15 22:12:46  jalet
-# Fix for the Fix !!!
-#
-# Revision 1.79  2004/11/15 22:01:34  jalet
-# Improved banner handling.
-# Fix for raw printing and banners.
-#
-# Revision 1.78  2004/11/15 19:59:34  jalet
-# PyKota banners now basically work !
-#
-# Revision 1.77  2004/11/06 22:40:57  jalet
-# Safer code
-#
-# Revision 1.76  2004/11/06 22:35:58  jalet
-# Added a miniparser for IPP messages (RFC 2910). The job-originating-host-name
-# retrieval is now fiable, unless the CUPS developpers change something...
-#
-# Revision 1.75  2004/11/01 15:45:25  jalet
-# Added many debug messages.
-# Added some code to prevent short writes.
-#
-# Revision 1.74  2004/10/13 20:51:27  jalet
-# Made debugging levels be the same in cupspykota and lprngpykota.
-# Now outputs more information in informational messages : user, printer, jobid
-#
-# Revision 1.73  2004/10/13 16:56:45  jalet
-# Added a space to the pattern to differentiate jobs which id begins with
-# the same digits, like jobs 87 and 879 for example : if printed by same
-# user on same printer, but from a different host this could have broken
-# the result. (In reality this couldn't happen because 879 would be the
-# last line to match anyway because of job ordering, but we never know
-# if the page_log file gets corrupt somewhat)
-#
-# Revision 1.72  2004/09/13 16:02:44  jalet
-# Added fix for incorrect job's size when hardware accounting fails
-#
-# Revision 1.71  2004/09/06 17:05:06  jalet
-# Fix for autodetection of SC_OPEN_MAX
-#
-# Revision 1.70  2004/07/26 09:20:27  jalet
-# Unneeded module
-#
-# Revision 1.69  2004/07/22 22:41:47  jalet
-# Hardware accounting for LPRng should be OK now. UNTESTED.
-#
-# Revision 1.68  2004/07/20 22:19:44  jalet
-# Sanitized a bit + use of gettext
-#
-# Revision 1.67  2004/07/16 12:22:45  jalet
-# LPRng support early version
-#
-# Revision 1.66  2004/07/01 19:56:25  jalet
-# Better dispatching of error messages
-#
-# Revision 1.65  2004/06/22 09:31:17  jalet
-# Always send some debug info to CUPS' back channel stream (stderr) as
-# informationnal messages.
-#
-# Revision 1.64  2004/06/18 13:34:46  jalet
-# Now all tracebacks include PyKota's version number
-#
-# Revision 1.63  2004/06/17 13:26:50  jalet
-# Better exception handling code
-#
-# Revision 1.62  2004/06/16 20:56:34  jalet
-# Smarter initialisation code
-#
-# Revision 1.61  2004/06/08 09:00:04  jalet
-# Fixed problem when username was passed in uppercase from Samba and we
-# tried to find correct line in CUPS page_log to extract the hostname.
-#
-# Revision 1.60  2004/06/03 23:14:08  jalet
-# Now stores the job's size in bytes in the database.
-# Preliminary work on payments storage : database schemas are OK now,
-# but no code to store payments yet.
-# Removed schema picture, not relevant anymore.
-#
-# Revision 1.59  2004/06/03 22:12:53  jalet
-# Now denies empty jobs
-#
-# Revision 1.58  2004/06/03 21:50:33  jalet
-# Improved error logging.
-# crashrecipient directive added.
-# Now exports the job's size in bytes too.
-#
-# Revision 1.57  2004/06/02 22:18:07  jalet
-# I think the bug when cancelling jobs should be fixed right now
-#
-# Revision 1.56  2004/06/02 21:50:56  jalet
-# Moved the sigterm capturing elsewhere
-#
-# Revision 1.55  2004/06/02 14:25:07  jalet
-# Should correctly capture ALL errors now
-#
-# Revision 1.54  2004/05/26 16:44:48  jalet
-# Now logs something when client hostname can't be extracted
-#
-# Revision 1.53  2004/05/26 14:49:35  jalet
-# First try at saving the job-originating-hostname in the database
-#
-# Revision 1.52  2004/05/25 09:15:13  jalet
-# accounter.py : old code deleted
-# the rest : now exports PYKOTAPRECOMPUTEDJOBSIZE and PYKOTAPRECOMPUTEDJOBPRICE
-#
-# Revision 1.51  2004/05/25 08:31:16  jalet
-# Heavy CPU usage seems to be fixed at least !
-#
-# Revision 1.50  2004/05/25 05:17:50  jalet
-# Now precomputes the job's size only if current printer's enforcement
-# is "STRICT"
-#
-# Revision 1.49  2004/05/24 22:45:48  jalet
-# New 'enforcement' directive added
-# Polling loop improvements
-#
-# Revision 1.48  2004/05/24 14:36:24  jalet
-# Revert to old polling loop. Will need optimisations
-#
-# Revision 1.47  2004/05/24 11:59:46  jalet
-# More robust (?) code
-#
-# Revision 1.46  2004/05/21 22:02:51  jalet
-# Preliminary work on pre-accounting
-#
-# Revision 1.45  2004/05/19 07:15:32  jalet
-# Could the 'misterious' bug in my loop be finally fixed ???
-#
-# Revision 1.44  2004/05/18 14:48:47  jalet
-# Big code changes to completely remove the need for "requester" directives,
-# jsut use "hardware(... your previous requester directive's content ...)"
-#
-# Revision 1.43  2004/05/17 11:46:05  jalet
-# First try at cupspykota's main loop rewrite
-#
-# Revision 1.42  2004/05/10 11:22:28  jalet
-# Typo
-#
-# Revision 1.41  2004/05/10 10:07:30  jalet
-# Catches OSError while reading
-#
-# Revision 1.40  2004/05/10 09:29:48  jalet
-# Should be more robust if we receive a SIGTERM during an I/O operation
-#
-# Revision 1.39  2004/05/07 14:44:53  jalet
-# Fix for file handles unregistered twice from the polling object
-#
-# Revision 1.38  2004/04/09 22:24:46  jalet
-# Began work on correct handling of child processes when jobs are cancelled by
-# the user. Especially important when an external requester is running for a
-# long time.
-#
-# Revision 1.37  2004/03/18 19:11:25  jalet
-# Fix for raw jobs in cupspykota
-#
-# Revision 1.36  2004/03/18 14:03:18  jalet
-# Added fsync() calls
-#
-# Revision 1.35  2004/03/16 12:05:01  jalet
-# Small fix for new waitprinter.sh : when job was denied, would wait forever
-# for printer being in printing mode.
-#
-# Revision 1.34  2004/03/15 10:47:56  jalet
-# This time the traceback formatting should be correct !
-#
-# Revision 1.33  2004/03/05 12:46:07  jalet
-# Improve tracebacks
-#
-# Revision 1.32  2004/03/05 12:31:35  jalet
-# Now should output full traceback when crashing
-#
-# Revision 1.31  2004/03/01 14:35:56  jalet
-# PYKOTAPHASE wasn't set soon enough at the start of the job
-#
-# Revision 1.30  2004/03/01 14:34:15  jalet
-# PYKOTAPHASE wasn't set at the right time at the end of data transmission
-# to underlying layer (real backend)
-#
-# Revision 1.29  2004/03/01 11:23:25  jalet
-# Pre and Post hooks to external commands are available in the cupspykota
-# backend. Forthe pykota filter they will be implemented real soon now.
-#
-# Revision 1.28  2004/02/26 14:18:07  jalet
-# Should fix the remaining bugs wrt printers groups and users groups.
-#
-# Revision 1.27  2004/02/04 23:41:27  jalet
-# Should fix the incorrect "backend died abnormally" problem.
-#
-# Revision 1.26  2004/01/30 16:35:03  jalet
-# Fixes stupid software accounting bug in CUPS backend
-#
-# Revision 1.25  2004/01/16 17:51:46  jalet
-# Fuck Fuck Fuck !!!
-#
-# Revision 1.24  2004/01/14 15:52:01  jalet
-# Small fix for job cancelling code.
-#
-# Revision 1.23  2004/01/13 10:48:28  jalet
-# Small streams polling loop modification.
-#
-# Revision 1.22  2004/01/12 22:43:40  jalet
-# New formula to compute a job's price
-#
-# Revision 1.21  2004/01/12 18:17:36  jalet
-# Denied jobs weren't stored into the history anymore, this is now fixed.
-#
-# Revision 1.20  2004/01/11 23:22:42  jalet
-# Major code refactoring, it's way cleaner, and now allows automated addition
-# of printers on first print.
-#
-# Revision 1.19  2004/01/08 14:10:32  jalet
-# Copyright year changed.
-#
-# Revision 1.18  2004/01/07 16:16:32  jalet
-# Better debugging information
-#
-# Revision 1.17  2003/12/27 16:49:25  uid67467
-# Should be ok now.
-#
-# Revision 1.17  2003/12/06 08:54:29  jalet
-# Code simplifications.
-# Added many debugging messages.
-#
-# Revision 1.16  2003/11/26 20:43:29  jalet
-# Inadvertantly introduced a bug, which is fixed.
-#
-# Revision 1.15  2003/11/26 19:17:35  jalet
-# Printing on a printer not present in the Quota Storage now results
-# in the job being stopped or cancelled depending on the system.
-#
-# Revision 1.14  2003/11/25 13:25:45  jalet
-# Boolean problem with old Python, replaced with 0
-#
-# Revision 1.13  2003/11/23 19:01:35  jalet
-# Job price added to history
-#
-# Revision 1.12  2003/11/21 14:28:43  jalet
-# More complete job history.
-#
-# Revision 1.11  2003/11/19 23:19:35  jalet
-# Code refactoring work.
-# Explicit redirection to /dev/null has to be set in external policy now, just
-# like in external mailto.
-#
-# Revision 1.10  2003/11/18 17:54:24  jalet
-# SIGTERMs are now transmitted to original backends.
-#
-# Revision 1.9  2003/11/18 14:11:07  jalet
-# Small fix for bizarre urls
-#
-# Revision 1.8  2003/11/15 14:26:44  jalet
-# General improvements to the documentation.
-# Email address changed in sample configuration file, because
-# I receive low quota messages almost every day...
-#
-# Revision 1.7  2003/11/14 22:05:12  jalet
-# New CUPS backend fully functionnal.
-# Old CUPS configuration method is now officially deprecated.
-#
-# Revision 1.6  2003/11/14 20:13:11  jalet
-# We exit the loop too soon.
-#
-# Revision 1.5  2003/11/14 18:31:27  jalet
-# Not perfect, but seems to work with the poll() loop.
-#
-# Revision 1.4  2003/11/14 17:04:15  jalet
-# More (untested) work on the CUPS backend.
-#
-# Revision 1.3  2003/11/12 23:27:44  jalet
-# More work on new backend. This commit may be unstable.
-#
-# Revision 1.2  2003/11/12 09:33:34  jalet
-# New CUPS backend supports device enumeration
-#
-# Revision 1.1  2003/11/08 16:05:31  jalet
-# CUPS backend added for people to experiment.
-#
 #
 #
