Index: pkpgcounter/trunk/BUGS
===================================================================
--- pkpgcounter/trunk/BUGS (revision 564)
+++ pkpgcounter/trunk/BUGS (revision 3436)
@@ -20,5 +20,5 @@
 
 pkpgcounter BUGS :
-   
+
   - All parsers need more testing, especially those which allow the number
     of copies to be specified as part of the data streams, as well as those
Index: pkpgcounter/trunk/tests/gstests.py
===================================================================
--- pkpgcounter/trunk/tests/gstests.py (revision 564)
+++ pkpgcounter/trunk/tests/gstests.py (revision 3436)
@@ -1,4 +1,4 @@
 #! /usr/bin/env python
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
 #
 # pkpgcounter : a generic Page Description Language parser
@@ -9,10 +9,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -43,11 +43,11 @@
         self.md5sum = self.computeChecksum()
         self.mastersize = None
-        
-    def __del__(self) :    
+
+    def __del__(self) :
         """Remove temporary file, if any."""
         if self.tmp is not None :
             self.tmp.close()
-            
-    def computeChecksum(self) :    
+
+    def computeChecksum(self) :
         """Computes an MD5 checksum for the input file's content."""
         checksum = md5.new()
@@ -60,25 +60,25 @@
             infile = sys.stdin
             istemp = True
-        else :    
+        else :
             infile = open(self.inputfile, "rb")
-            
+
         while True :
             data = infile.read(MEGABYTE)
             if not data :
                 break
-            if istemp :    
+            if istemp :
                 self.tmp.write(data)
             checksum.update(data)
-            
-        if istemp :    
-            self.tmp.flush()    
+
+        if istemp :
+            self.tmp.flush()
         else :
             infile.close()
-            
-        return checksum.hexdigest()    
-        
+
+        return checksum.hexdigest()
+
     def getAvailableDevices(self) :
         """Returns a list of available GhostScript devices.
-        
+
            The list is returned without any x11, bbox, nor ijs related device.
         """
@@ -93,14 +93,14 @@
                                            and (not dev == "/nullpage") \
                                            and (not dev == "/bbox") ]
-                devices.sort()                           
+                devices.sort()
                 return devices
         return []
-            
+
     def getAvailableIJSPrintClasses(self) :
         """Returns a list of available IJS Print Classes.
-        
+
            Currently the list is a static one and doesn't contain all the available print classes.
         """
-        return [ "DJ3600", "DJ3320", "DJ9xx", "DJGenericVIP", "LJColor", 
+        return [ "DJ3600", "DJ3320", "DJ9xx", "DJGenericVIP", "LJColor",
                  "DJ850", "DJ890", "DJ9xxVIP", "DJ8xx", "DJ540", "DJ660",
                  "DJ6xx", "DJ350", "DJ6xxPhoto", "DJ630", "DJ8x5", "DJ4100",
@@ -108,5 +108,5 @@
                  "Postscript", "LJJetReady", "LJMono", "LJFastRaster",
                  "LJZjsMono", ]
-            
+
     def batchGeneration(self, infilename, devices, root, command) :
         """Loops over a set of devices calling a particular command."""
@@ -121,16 +121,16 @@
             if os.path.exists(outfilename) and os.stat(outfilename).st_size :
                 sys.stdout.write("Skipping %(outfilename)s : already exists.\n" % locals())
-            else :    
+            else :
                 sys.stdout.write("Generating %(outfilename)s " % locals())
                 sys.stdout.flush()
                 os.system(cmd)
                 sys.stdout.write("\n")
-                
+
             if not os.path.exists(outfilename) :
                 sys.stderr.write("ERROR : During the generation of %(outfilename)s\n" % locals())
-            elif not os.stat(outfilename).st_size :    
+            elif not os.stat(outfilename).st_size :
                 sys.stderr.write("ERROR : Unsupported driver, impossible to generate %(outfilename)s\n" % locals())
                 os.remove(outfilename)
-            else :    
+            else :
                 self.results[outfilename] = { "command" : cmd,
                                               "device" : "%s" % (devprefix + device),
@@ -138,32 +138,32 @@
                                               "details" : None,
                                             }
-                
+
     def genTestSuite(self) :
         """Generate the testsuite."""
         root = "testsuite.%s" % self.md5sum
-        self.batchGeneration(self.inputfile, self.getAvailableDevices(), 
-                                        root, 
+        self.batchGeneration(self.inputfile, self.getAvailableDevices(),
+                                        root,
                                         'gs -dQUIET -dBATCH -dNOPAUSE -dPARANOIDSAFER -sOutputFile="%(outfilename)s" -sDEVICE="%(device)s" "%(infilename)s"')
-                                    
-        self.batchGeneration(self.inputfile, self.getAvailableIJSPrintClasses(), 
-                                        "%(root)s.hpijs" % locals(), 
+
+        self.batchGeneration(self.inputfile, self.getAvailableIJSPrintClasses(),
+                                        "%(root)s.hpijs" % locals(),
                                         'gs -dBATCH -dQUIET -dPARANOIDSAFER -dNOPAUSE -sDEVICE=ijs -sIjsServer=hpijs -dIjsUseOutputFD -sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="%(device)s" -sOutputFile="%(outfilename)s" "%(infilename)s"')
-                
-    def runPipe(self, cmd) :            
+
+    def runPipe(self, cmd) :
         """Runs a command in a pipe, returns the command's output as a string."""
         answerfd = os.popen(cmd, "r")
         try :
             return answerfd.read().strip()
-        finally :        
+        finally :
             answerfd.close()
-        
-    def computeSize(self, filename) :    
+
+    def computeSize(self, filename) :
         """Computes the size in pages of a file in the testsuite."""
         answer = self.runPipe('pkpgcounter "%(filename)s" 2>/dev/null' % locals())
         try :
             return int(answer)
-        except (ValueError, TypeError) :    
+        except (ValueError, TypeError) :
             return 0
-        
+
     def runTests(self) :
         """Launches the page counting tests against the testsuite."""
@@ -172,5 +172,5 @@
         if not mastersize :
             raise RuntimeError, "Unable to compute the size of the testsuite's master file %(masterfilename)s" % locals()
-        else :    
+        else :
             sys.stdout.write("Master file's contains %(mastersize)i pages.\n" % locals())
         testsuite = glob.glob("testsuite.*")
@@ -181,9 +181,9 @@
             if len(parts) > 3 :
                 devname = ".".join(parts[2:])
-            else :    
+            else :
                 devname = parts[-1]
-            result = self.results.setdefault(testfname, { "command" : "See above", 
-                                                          "device" : devname, 
-                                                          "result" : None, 
+            result = self.results.setdefault(testfname, { "command" : "See above",
+                                                          "device" : devname,
+                                                          "result" : None,
                                                           "details" : None })
             sys.stdout.write("Testing %(testfname)s ... " % locals())
@@ -194,15 +194,15 @@
                     result["result"] = "UNSUPPORTED"
                     result["details"] = "Unsupported file format"
-                else :    
+                else :
                     result["result"] = "FAILED"
                     result["details"] = "Found %(size)i pages instead of %(mastersize)i\n" % locals()
-            else :    
+            else :
                 result["result"] = "SUPPORTED"
                 result["details"] = None
-            sys.stdout.write("%s\n" % result["result"])    
+            sys.stdout.write("%s\n" % result["result"])
         self.supportedpct = 100.0 * len([True for r in self.results.values() if r["result"] == "SUPPORTED"]) / nbtests
         self.failedpct = 100.0 * len([True for r in self.results.values() if r["result"] == "FAILED"]) / nbtests
         self.unsupportedpct = 100.0 * len([True for r in self.results.values() if r["result"] == "UNSUPPORTED"]) / nbtests
-        
+
     def genHTMLReport(self, filename) :
         """Generates an HTML report."""
@@ -232,15 +232,15 @@
         for key in keys :
             value = self.results[key]
-            linecount += 1    
-            if not (linecount % 2) :    
+            linecount += 1
+            if not (linecount % 2) :
                 linecolor = "#DEDEDE"
-            else :    
+            else :
                 linecolor = "#FFFFFF"
-            out.write('<tr bgcolor="%s">\n' % linecolor)    
+            out.write('<tr bgcolor="%s">\n' % linecolor)
             if value["result"] == "SUPPORTED" :
                 color = "#00FF00"
-            elif value["result"] == "UNSUPPORTED" :    
+            elif value["result"] == "UNSUPPORTED" :
                 color = "#FF0000"
-            else :    
+            else :
                 color = "orange"
             out.write('<td bgcolor="%s"><strong>%s</strong></td>\n' % (color, value["device"]))
@@ -250,6 +250,6 @@
         out.write("</table></body></html>\n")
         out.close()
-        
-def main() :        
+
+def main() :
     """Main function."""
     try :
@@ -259,13 +259,13 @@
             sys.stderr.write("usage : %s [inputfile.ps]\n" % sys.argv[0])
             sys.exit(-1)
-        else :    
+        else :
             testsuite = TestSuite(sys.argv[1])
             testsuite.genTestSuite()
             testsuite.runTests()
             testsuite.genHTMLReport("%s.html" % testsuite.md5sum)
-    except KeyboardInterrupt :        
+    except KeyboardInterrupt :
         sys.stderr.write("Interrupted at user's request !\n")
-        
+
 if __name__ == "__main__" :
     sys.exit(main())
-        
+
Index: pkpgcounter/trunk/tests/README
===================================================================
--- pkpgcounter/trunk/tests/README (revision 463)
+++ pkpgcounter/trunk/tests/README (revision 3436)
@@ -19,21 +19,21 @@
 ====================================================================
 
-This directory contains a gzipped PostScript file, master.ps.gz, 
-obtained by printing to a file a part of the SlashDot.org website 
-from the Galeon web browser on July 2nd 2004. 
+This directory contains a gzipped PostScript file, master.ps.gz,
+obtained by printing to a file a part of the SlashDot.org website
+from the Galeon web browser on July 2nd 2004.
 
-When uncompressed, this 16 pages file can be used to test the 
-accuracy of the generic Page Description Language analyzer included 
-in pkpgcounter for different conversion outputs of gs. 
+When uncompressed, this 16 pages file can be used to test the
+accuracy of the generic Page Description Language analyzer included
+in pkpgcounter for different conversion outputs of gs.
 
 To see if it works, simply launch :
 
         $ ./runtests.sh
-        
-It should report 16 pages for each document. If it doesn't then 
-there's a bug in the generic Page Description Language analyzer. 
+
+It should report 16 pages for each document. If it doesn't then
+there's a bug in the generic Page Description Language analyzer.
 Please report this to : alet@librelogiciel.com
 
 This script will also launch the test for the computation of
-ink coverage. Look at the file colors.pdf to see what the 
+ink coverage. Look at the file colors.pdf to see what the
 results should look like.
Index: pkpgcounter/trunk/tests/runcolors.py
===================================================================
--- pkpgcounter/trunk/tests/runcolors.py (revision 564)
+++ pkpgcounter/trunk/tests/runcolors.py (revision 3436)
@@ -1,4 +1,4 @@
 #! /usr/bin/env python
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
 #
 # pkpgcounter : a generic Page Description Language parser
@@ -9,10 +9,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -52,5 +52,5 @@
         pkpgcounter --colorspace $cspace colors.pdf ;
         echo ;
-    done    
+    done
 
 Please report any problem to : alet@librelogiciel.com
@@ -115,5 +115,5 @@
     from reportlab.lib.units import cm
     from reportlab.pdfgen import canvas
-except ImportError :    
+except ImportError :
     sys.stderr.write("Please download and install ReportLab\n\tfrom http://www.reportlab.org\n")
     sys.exit(-1)
@@ -124,5 +124,5 @@
     xbase = 2*cm
     ybase = height - 2*cm
-    
+
     # First we output the explanations on the first page.
     canv.setFont("Courier", 14)
@@ -131,14 +131,14 @@
         ybase -= 18
     canv.showPage()
-    
+
     # Then we output each page
     for color in (colors.Color(1, 0, 0),        # Red
                   colors.Color(0, 1, 0),        # Green
                   colors.Color(0, 0, 1)) :      # Blue
-        canv.setStrokeColorRGB(*color.rgb())          
-        canv.setFillColorRGB(*color.rgb())          
+        canv.setStrokeColorRGB(*color.rgb())
+        canv.setFillColorRGB(*color.rgb())
         canv.rect(0, 0, width, height, fill=1)
         canv.showPage()
-        
+
     for color in (colors.CMYKColor(1, 0, 0, 0), # Cyan
                   colors.CMYKColor(0, 1, 0, 0), # Magenta
@@ -146,9 +146,9 @@
                   colors.CMYKColor(0, 0, 0, 1), # Black
                   colors.CMYKColor(0, 0, 0, 0)) : # White
-        canv.setStrokeColorCMYK(*color.cmyk())          
-        canv.setFillColorCMYK(*color.cmyk())          
+        canv.setStrokeColorCMYK(*color.cmyk())
+        canv.setFillColorCMYK(*color.cmyk())
         canv.rect(0, 0, width, height, fill=1)
         canv.showPage()
-        
+
     # Finally outputs the expected results.
     canv.setFont("Helvetica-Bold", 16)
@@ -160,4 +160,4 @@
         ybase -= 14
     canv.showPage()
-        
-    canv.save()        
+
+    canv.save()
Index: pkpgcounter/trunk/tests/runtest.sh
===================================================================
--- pkpgcounter/trunk/tests/runtest.sh (revision 564)
+++ pkpgcounter/trunk/tests/runtest.sh (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -19,7 +19,7 @@
 echo "Analyzing colors..."
 if ! [ -f "colors.pdf" ]  ; then
-   python ./runcolors.py ; 
+   python ./runcolors.py ;
 fi ;
-echo 
+echo
 
 for cspace in BW RGB CMY CMYK GC ; do
@@ -27,5 +27,5 @@
     pkpgcounter --colorspace $cspace colors.pdf ;
     echo ;
-done    
+done
 
 echo "Generating testsuite..."
Index: pkpgcounter/trunk/pkpgpdls/tiff.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/tiff.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/tiff.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -34,5 +34,5 @@
     required = [ "cp" ]
     format = "TIFF"
-    def isValid(self) :        
+    def isValid(self) :
         """Returns True if data is TIFF, else False."""
         littleendian = (chr(0x49)*2) + chr(0x2a) + chr(0)
@@ -40,14 +40,14 @@
         if self.firstblock[:4] in (littleendian, bigendian) :
             return True
-        else :    
+        else :
             return False
-    
+
     def getJobSize(self) :
         """Counts pages in a TIFF document.
-        
+
            Algorithm by Jerome Alet.
-           
+
            The documentation used for this was :
-           
+
            http://www.ee.cooper.edu/courses/course_pages/past_courses/EE458/TIFF/
         """
@@ -63,9 +63,9 @@
             integerbyteorder = ">I"
             shortbyteorder = ">H"
-        else :    
+        else :
             raise pdlparser.PDLParserError, "Unknown file endianness."
-        pos = 4    
+        pos = 4
         try :
-            try :    
+            try :
                 nextifdoffset = unpack(integerbyteorder, minfile[pos : pos + 4])[0]
                 while nextifdoffset :
@@ -74,7 +74,7 @@
                     nextifdoffset = unpack(integerbyteorder, minfile[pos : pos + 4])[0]
                     pagecount += 1
-            except IndexError :            
+            except IndexError :
                 pass
-        finally :        
+        finally :
             minfile.close()
         return pagecount
Index: pkpgcounter/trunk/pkpgpdls/bj.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/bj.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/bj.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -30,18 +30,18 @@
     """A parser for Canon BJ documents."""
     format = "Canon BJ/BJC"
-    def isValid(self) :        
+    def isValid(self) :
         """Returns True if data is BJ/BJC, else False."""
         if self.firstblock.startswith("\033[K\002\000") :
             return True
-        else :    
+        else :
             return False
-            
+
     def getJobSize(self) :
         """Counts pages in a Canon BJ document.
-        
+
            Algorithm by Jerome Alet.
-           
+
            The documentation used for this was :
-         
+
            ghostscript-8.60/src/gdevbj*.c
         """
@@ -57,5 +57,5 @@
                         # through the Set Initial Condition command
                         pageheader = minfile[pos:pos+7]
-                        if pageheader in ("\033[K\002\000\000\017", 
+                        if pageheader in ("\033[K\002\000\000\017",
                                           "\033[K\002\000\000\044",
                                           "\033[K\002\000\004\044") :
@@ -65,5 +65,5 @@
             except IndexError : # EOF ?
                 pass
-        finally :        
+        finally :
             minfile.close() # reached EOF
         return pagecount
Index: pkpgcounter/trunk/pkpgpdls/pdlparser.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/pdlparser.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/pdlparser.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -25,6 +25,6 @@
 import os
 
-KILOBYTE = 1024    
-MEGABYTE = 1024 * KILOBYTE    
+KILOBYTE = 1024
+MEGABYTE = 1024 * KILOBYTE
 FIRSTBLOCKSIZE = 16 * KILOBYTE
 LASTBLOCKSIZE = int(KILOBYTE / 4)
@@ -38,5 +38,5 @@
         return self.message
     __str__ = __repr__
-        
+
 class PDLParser :
     """Generic PDL parser."""
@@ -56,11 +56,11 @@
         if not self.isValid() :
             raise PDLParserError, "Invalid file format !"
-        else :    
+        else :
             self.logdebug("Input file is in the '%s' file format." % self.format)
         try :
-            import psyco 
-        except ImportError :    
+            import psyco
+        except ImportError :
             pass # Psyco is not installed
-        else :    
+        else :
             # Psyco is installed, tell it to compile
             # the CPU intensive methods : PCL and PCLXL
@@ -69,10 +69,10 @@
         self.infile = open(self.filename, self.openmode)
         # self.logdebug("Opened %s in '%s' mode." % (self.filename, self.openmode))
-            
+
     def __del__(self) :
         """Ensures the input file gets closed."""
         if self.infile :
             self.infile.close()
-            
+
     def findExecutable(self, command) :
         """Finds an executable in the PATH and returns True if found else False."""
@@ -83,7 +83,7 @@
                     return True
         return False
-        
-    def isMissing(self, commands) :    
-        """Returns True if some required commands are missing, else False.""" 
+
+    def isMissing(self, commands) :
+        """Returns True if some required commands are missing, else False."""
         howmanythere = 0
         for command in commands :
@@ -91,28 +91,28 @@
                 sys.stderr.write("ERROR: %(command)s is missing or not executable. You MUST install it for pkpgcounter to be able to do what you want.\n" % locals())
                 sys.stderr.flush()
-            else :    
+            else :
                 howmanythere += 1
         if howmanythere == len(commands) :
             return False
-        else :   
+        else :
             return True
-        
-    def logdebug(self, message) :       
+
+    def logdebug(self, message) :
         """Logs a debug message if needed."""
         if self.parent.options.debug :
             sys.stderr.write("%s\n" % message)
-            
-    def isValid(self) :    
+
+    def isValid(self) :
         """Returns True if data is in the expected format, else False."""
         raise RuntimeError, "Not implemented !"
-        
-    def getJobSize(self) :    
+
+    def getJobSize(self) :
         """Counts pages in a document."""
         raise RuntimeError, "Not implemented !"
-        
+
     def convertToTiffMultiPage24NC(self, outfname, dpi) :
         """Converts the input file to TIFF format, X dpi, 24 bits per pixel, uncompressed.
            Writes TIFF datas to the file named by outfname.
-        """   
+        """
         if self.totiffcommands :
             if self.isMissing(self.required) :
@@ -127,5 +127,5 @@
                     if os.WEXITSTATUS(status) :
                         error = True
-                else :        
+                else :
                     error = True
                 if not os.path.exists(outfname) :
@@ -133,9 +133,9 @@
                 elif not os.stat(outfname).st_size :
                     error = True
-                else :        
+                else :
                     break       # Conversion worked fine it seems.
                 sys.stderr.write("Command failed : %s\n" % repr(commandline))
             if error :
                 raise PDLParserError, "Problem during conversion to TIFF."
-        else :        
+        else :
             raise PDLParserError, "Impossible to compute ink coverage for this file format."
Index: pkpgcounter/trunk/pkpgpdls/ooo.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/ooo.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/ooo.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -32,5 +32,5 @@
     required = [ "xvfb-run", "xauth", "abiword", "gs" ]
     format = "ISO/IEC DIS 26300"
-    def isValid(self) :        
+    def isValid(self) :
         """Returns True if data is OpenDocument, else False."""
         if self.firstblock[:2] == "PK" :
@@ -39,14 +39,14 @@
                 self.contentxml = self.archive.read("content.xml")
                 self.metaxml = self.archive.read("meta.xml")
-            except :    
+            except :
                 return False
             else :
                 return True
-        else :    
+        else :
             return False
-            
+
     def getJobSize(self) :
         """Counts pages in an OpenOffice.org document.
-        
+
            Algorithm by Jerome Alet.
         """
Index: pkpgcounter/trunk/pkpgpdls/lidil.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/lidil.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/lidil.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -22,6 +22,6 @@
 """This modules implements a page counter for HP LIDIL format.
 
-   Documentation used : 
-   
+   Documentation used :
+
         hplip-2.7.10/prnt/ldl.py
         hplip-2.7.10/prnt/hpijs/ldlencap.h
@@ -52,5 +52,5 @@
     """A parser for HP LIDIL documents."""
     format = "Hewlett-Packard LIDIL"
-    def isValid(self) :    
+    def isValid(self) :
         """Returns True if data is LIDIL, else False."""
         # Beginning Of File marker is a Sync packet, followed with
@@ -61,11 +61,11 @@
         # with a Reset packet. We ignore the preceding Sync packet
         # for simplicity's sake.
-        EOFMarker = "$\x00\x10\x00\x08\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff$$\x00\x10\x00\x06\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff$" 
+        EOFMarker = "$\x00\x10\x00\x08\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff$$\x00\x10\x00\x06\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff$"
         if self.firstblock.startswith(BOFMarker) \
            and self.lastblock.endswith(EOFMarker) :
             return True
-        else :    
+        else :
             return False
-        
+
     def getJobSize(self) :
         """Computes the number of pages in a HP LIDIL document."""
@@ -80,5 +80,5 @@
                     # Invalid header or no Frame Sync byte.
                     raise pdlparser.PDLParserError, "This file doesn't seem to be valid Hewlett-Packard LIDIL datas."
-                (framesync,     
+                (framesync,
                  cmdlength,
                  dummy,
@@ -93,7 +93,7 @@
                         ejectpage += 1
                 self.infile.seek(cmdlength + datalength - len(header), 1) # relative seek
-        except struct.error :    
+        except struct.error :
             raise pdlparser.PDLParserError, "This file doesn't seem to be valid Hewlett-Packard LIDIL datas."
-            
+
         # Number of page eject commands should be sufficient,
         # but we never know : someone could try to cheat the printer
Index: pkpgcounter/trunk/pkpgpdls/inkcoverage.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/inkcoverage.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/inkcoverage.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -28,5 +28,5 @@
 try :
     from PIL import Image
-except ImportError :    
+except ImportError :
     sys.stderr.write("ERROR: You MUST install the Python Imaging Library (python-imaging) for pkpgcounter to work.\n")
     raise pdlparser.PDLParserError, "The Python Imaging Library is missing."
@@ -34,16 +34,16 @@
 def getPercent(img, nbpix) :
     """Extracts the percents per color component from a picture.
-      
+
        Faster without Psyco on my own machine.
     """
-    result = {}     
+    result = {}
     bands = img.split()
     for (i, bandname) in enumerate(img.getbands()) :
         result[bandname] = 100.0 * (reduce(lambda current, next: current + (next[1] * next[0]), enumerate(bands[i].histogram()), 0) / 255.0) / nbpix
-    return result    
-    
+    return result
+
 def getPercentCMYK(img, nbpix) :
     """Extracts the percents of Cyan, Magenta, Yellow, and Black from a picture.
-     
+
        PIL doesn't produce useable CMYK for our algorithm, so we use the algorithm from PrintBill.
        Psyco speeds this function up by around 2.5 times on my computer.
@@ -51,9 +51,9 @@
     if img.mode != "RGB" :
         img = img.convert("RGB")
-    cyan = magenta = yellow = black = 0    
+    cyan = magenta = yellow = black = 0
     for (r, g, b) in img.getdata() :
         if r == g == b :
             black += 255 - r
-        else :    
+        else :
             cyan += 255 - r
             magenta += 255 - g
@@ -64,6 +64,6 @@
              "K" : 100.0 * (black / 255.0) / nbpix,
            }
-        
-def getPercentGC(img, nbpix) :        
+
+def getPercentGC(img, nbpix) :
     """Determines if a page is in grayscale or colour mode."""
     if img.mode != "RGB" :
@@ -75,5 +75,5 @@
             return { "G" : 0.0, "C" : 100.0 }
     return { "G" : 100.0, "C" : 0.0 }
-    
+
 def getPercentBW(img, nbpix) :
     """Extracts the percents of Black from a picture, once converted to gray levels."""
@@ -81,11 +81,11 @@
         img = img.convert("L")
     return { "B" : 100.0 - getPercent(img, nbpix)["L"] }
-    
+
 def getPercentRGB(img, nbpix) :
     """Extracts the percents of Red, Green, Blue from a picture, once converted to RGB."""
     if img.mode != "RGB" :
         img = img.convert("RGB")
-    return getPercent(img, nbpix)    
-    
+    return getPercent(img, nbpix)
+
 def getPercentCMY(img, nbpix) :
     """Extracts the percents of Cyan, Magenta, and Yellow from a picture once converted to RGB."""
@@ -95,8 +95,8 @@
              "Y" : 100.0 - result["B"],
            }
-    
+
 def getInkCoverage(fname, colorspace) :
-    """Returns a list of dictionnaries containing for each page, 
-       for each color component, the percent of ink coverage on 
+    """Returns a list of dictionnaries containing for each page,
+       for each color component, the percent of ink coverage on
        that particular page.
     """
@@ -107,22 +107,22 @@
         try :
             import psyco
-        except ImportError :    
+        except ImportError :
             pass
-        else :    
+        else :
             psyco.bind(getPercentCMYK)
-    
+
     index = 0
     try :
         image = Image.open(fname)
-    except (IOError, OverflowError), msg :   
+    except (IOError, OverflowError), msg :
         raise pdlparser.PDLParserError, "%s (%s)" % (msg, fname)
-    else :    
+    else :
         try :
             while True :
                 nbpixels = image.size[0] * image.size[1]
                 result.append(computation(image, nbpixels))
-                index += 1              
+                index += 1
                 image.seek(index)
-        except EOFError :        
+        except EOFError :
             pass
         return (colorspace, result)
Index: pkpgcounter/trunk/pkpgpdls/escpages03.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/escpages03.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/escpages03.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -33,15 +33,15 @@
     """A parser for ESC/PageS03 documents."""
     format = "ESC/PageS03"
-    def isValid(self) :        
+    def isValid(self) :
         """Returns True if data is TIFF, else False."""
         if self.firstblock.startswith("\033\1@EJL") and \
             (self.firstblock.find("=ESC/PAGES03\n") != -1) :
             return True
-        else :    
+        else :
             return False
-    
+
     def getJobSize(self) :
         """Counts pages in an ESC/PageS03 document.
-        
+
            Algorithm by Jerome Alet.
            Reverse engineered the file format.
@@ -61,5 +61,5 @@
         lgendsequence = len(endsequence)
         try :
-            try :    
+            try :
                 while True :
                     if minfile[startpos] == startsequence :
@@ -82,12 +82,12 @@
                             if pagecount.startswith('"') and pagecount.endswith('"') :
                                 pagecount = pagecount[1:-1]
-                            pagecount = int(pagecount)    
+                            pagecount = int(pagecount)
                             if pagecount <= 0 :
                                 pagecount = 1 # TODO : 0 or 1000000 ??? ;-)
                             break
-                        startpos += 1    
-            except IndexError :            
+                        startpos += 1
+            except IndexError :
                 pass
-        finally :        
+        finally :
             minfile.close()
         return pagecount
Index: pkpgcounter/trunk/pkpgpdls/__init__.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/__init__.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/__init__.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
Index: pkpgcounter/trunk/pkpgpdls/zjstream.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/zjstream.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/zjstream.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -28,25 +28,25 @@
 class Parser(pdlparser.PDLParser) :
     """A parser for ZjStream documents."""
-    def isValid(self) :    
+    def isValid(self) :
         """Returns True if data is ZjStream, else False."""
         if self.firstblock[:4] == "ZJZJ" :
             self.format = "Zenographics ZjStream (little endian)"
             return self.littleEndian()
-        elif self.firstblock[:4] == "JZJZ" :    
+        elif self.firstblock[:4] == "JZJZ" :
             self.format = "Zenographics ZjStream (big endian)"
             return self.bigEndian()
-        else :    
+        else :
             return False
-        
+
     def littleEndian(self) :
         """Toggles to little endianness."""
         self.unpackHeader = "<IIIHH"
         return True
-        
+
     def bigEndian(self) :
         """Toggles to big endianness."""
         self.unpackHeader = ">IIIHH"
         return True
-        
+
     def getJobSize(self) :
         """Computes the number of pages in a ZjStream document."""
@@ -66,5 +66,5 @@
                  signature) = unpack(unpackHeader, header)
                 self.infile.seek(totalChunkSize - len(header), 1)
-                if chunkType == 2 :    
+                if chunkType == 2 :
                     #self.logdebug("startPage")
                     startpagecount += 1
@@ -74,7 +74,7 @@
                 #elif chunkType == 0 :
                 #    self.logdebug("startDoc")
-                #elif chunkType == 1 :    
+                #elif chunkType == 1 :
                 #    self.logdebug("endDoc")
-                #    
+                #
                 #self.logdebug("Chunk size : %s" % totalChunkSize)
                 #self.logdebug("Chunk type : 0x%08x" % chunkType)
@@ -85,5 +85,5 @@
         except struct.error :
             raise pdlparser.PDLParserError, "This file doesn't seem to be valid ZjStream datas."
-            
+
         # Number of endpage commands should be sufficient,
         # but we never know : someone could try to cheat the printer
Index: pkpgcounter/trunk/pkpgpdls/qpdl.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/qpdl.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/qpdl.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -33,5 +33,5 @@
     """A parser for QPDL (aka SPL2) documents."""
     format = "QPDL (aka SPL2)"
-    mediasizes = { 
+    mediasizes = {
                     # The first values are identical to that of PCLXL
                     0 : "Letter",
@@ -57,7 +57,7 @@
                     23 : "C6",
                     24 : "Folio",
-                 }   
-                 
-    mediasources = {             
+                 }
+
+    mediasources = {
                      # Again, values are identical to that of PCLXL
                      0 : "Default",
@@ -70,6 +70,6 @@
                      7 : "ThirdCassette",
                    }
-            
-    def isValid(self) :    
+
+    def isValid(self) :
         """Returns True if data is QPDL aka SPL2, else False."""
         if ((self.firstblock[:128].find("\033%-12345X") != -1) and \
@@ -77,24 +77,24 @@
               (self.firstblock.find("LANGUAGE = QPDL") != -1))) :
             return True
-        else :    
+        else :
             return False
-            
+
     def beginPage(self, nextpos) :
         """Indicates the beginning of a new page, and extracts media information."""
         self.pagecount += 1
-        
+
         copies = unpack(self.unpackShort, self.minfile[nextpos+1:nextpos+3])[0]
         mediasize = ord(self.minfile[nextpos+3])
         mediasource = ord(self.minfile[nextpos+8])
         duplexmode = unpack(self.unpackShort, self.minfile[nextpos+10:nextpos+12])[0]
-        
-        self.pages[self.pagecount] = { "copies" : copies, 
+
+        self.pages[self.pagecount] = { "copies" : copies,
                                        "mediasize" : self.mediasizes.get(mediasize, str(mediasize)),
                                        "mediasource" : self.mediasources.get(mediasource, str(mediasource)),
                                        "duplex" : duplexmode,
-                                     } 
+                                     }
         return 16       # Length of a page header
-        
-    def endPage(self, nextpos) :    
+
+    def endPage(self, nextpos) :
         """Indicates the end of a page."""
         epcopies = unpack(self.unpackShort, self.minfile[nextpos:nextpos+2])[0]
@@ -103,10 +103,10 @@
             self.logdebug("ERROR: discrepancy between beginPage (%i) and endPage (%i) copies" % (bpcopies, epcopies))
         return 2        # Length of a page footer
-        
+
     def beginBand(self, nextpos) :
         """Indicates the beginning of a new band."""
         bandlength = unpack(self.unpackLong, self.minfile[nextpos+6:nextpos+10])[0]
         return bandlength + 10 # Length of a band header - length of checksum
-        
+
     def littleEndian(self) :
         """Toggles to little endianness."""
@@ -115,5 +115,5 @@
         self.unpackLong = self.unpackType[4]
         return 0
-        
+
     def bigEndian(self) :
         """Toggles to big endianness."""
@@ -122,6 +122,6 @@
         self.unpackLong = self.unpackType[4]
         return 0
-    
-    def escape(self, nextpos) :    
+
+    def escape(self, nextpos) :
         """Handles the ESC code."""
         pos = endpos = nextpos
@@ -137,6 +137,6 @@
                     quotes += 1
                 endpos += 1
-                
-            # Store this in a per page mapping.    
+
+            # Store this in a per page mapping.
             # NB : First time will be at page 0 (i.e. **before** page 1) !
             stuff = self.escapedStuff.setdefault(self.pagecount, [])
@@ -144,19 +144,19 @@
             self.logdebug("Escaped datas : [%s]" % repr(minfile[pos : endpos]))
         return endpos - pos
-        
-    def maybeEOF(self, nextpos) :    
+
+    def maybeEOF(self, nextpos) :
         """Tries to detect the EOF marker."""
         if self.minfile[nextpos:nextpos+9] == self.eofmarker :
             return 9
-        else :    
+        else :
             return 0
-        
+
     def getJobSize(self) :
         """Counts pages in a QPDL (SPL2) document.
-        
+
            Algorithm by Jerome Alet.
-           
+
            The documentation used for this was :
-         
+
            Sp�fication Technique (documentation non officielle)
            Le Language SPL2
@@ -165,5 +165,5 @@
         """
         # Initialize table of tags
-        self.tags = [ lambda pos : 0 ] * 256    
+        self.tags = [ lambda pos : 0 ] * 256
         self.tags[0x00] = self.beginPage
         self.tags[0x01] = self.endPage
@@ -171,16 +171,16 @@
         self.tags[0x0c] = self.beginBand
         self.tags[0x1b] = self.escape # The escape code
-        
+
         self.eofmarker = "\033%-12345X"
-        
+
         infileno = self.infile.fileno()
-        self.pages = { 0 : { "copies" : 1, 
-                             "orientation" : "Default", 
-                             "mediatype" : "Plain", 
-                             "mediasize" : "Default", 
-                             "mediasource" : "Default", 
+        self.pages = { 0 : { "copies" : 1,
+                             "orientation" : "Default",
+                             "mediatype" : "Plain",
+                             "mediasize" : "Default",
+                             "mediasource" : "Default",
                              "duplex" : None,
-                           } 
-                     }      
+                           }
+                     }
         self.minfile = minfile = mmap.mmap(infileno, os.fstat(infileno)[6], prot=mmap.PROT_READ, flags=mmap.MAP_SHARED)
         self.pagecount = 0
@@ -195,12 +195,12 @@
                     pos += 1
                     pos += tags[tag](pos)
-            except IndexError : # EOF ?            
+            except IndexError : # EOF ?
                 pass
         finally :
             self.minfile.close()
-            
+
         defaultduplexmode = "Simplex"
         defaultpapersize = ""
-        defaultpjlcopies = 1    
+        defaultpjlcopies = 1
         oldpjlcopies = -1
         oldduplexmode = ""
@@ -208,5 +208,5 @@
         for pnum in range(1, self.pagecount + 1) :
             # NB : is number of copies is 0, the page won't be output
-            # but the formula below is still correct : we want 
+            # but the formula below is still correct : we want
             # to decrease the total number of pages in this case.
             page = self.pages.get(pnum, self.pages.get(1, { "copies" : 1, "mediasize" : "Default", "duplex" : None }))
@@ -227,16 +227,16 @@
                     pjlcopies = nbqty
                 else :
-                    if oldpjlcopies == -1 :    
+                    if oldpjlcopies == -1 :
                         pjlcopies = defaultpjlcopies
-                    else :    
-                        pjlcopies = oldpjlcopies    
-                if page["duplex"] :        
+                    else :
+                        pjlcopies = oldpjlcopies
+                if page["duplex"] :
                     duplexmode = page["duplex"]
-                else :    
+                else :
                     defaultdm = pjlparser.default_variables.get("DUPLEX", "")
                     if defaultdm :
                         if defaultdm.upper() == "ON" :
                             defaultduplexmode = "Duplex"
-                        else :    
+                        else :
                             defaultduplexmode = "Simplex"
                     envdm = pjlparser.environment_variables.get("DUPLEX", "")
@@ -244,10 +244,10 @@
                         if envdm.upper() == "ON" :
                             duplexmode = "Duplex"
-                        else :    
+                        else :
                             duplexmode = "Simplex"
-                    else :        
+                    else :
                         if not oldduplexmode :
                             duplexmode = defaultduplexmode
-                        else :    
+                        else :
                             duplexmode = oldduplexmode
                 defaultps = pjlparser.default_variables.get("PAPER", "")
@@ -257,21 +257,21 @@
                 if envps :
                     papersize = envps
-                else :    
+                else :
                     if not oldpapersize :
                         papersize = defaultpapersize
-                    else :    
+                    else :
                         papersize = oldpapersize
-            else :        
+            else :
                 if oldpjlcopies == -1 :
                     pjlcopies = defaultpjlcopies
-                else :    
+                else :
                     pjlcopies = oldpjlcopies
                 if not oldduplexmode :
                     duplexmode = defaultduplexmode
-                else :    
+                else :
                     duplexmode = oldduplexmode
-                if not oldpapersize :    
+                if not oldpapersize :
                     papersize = defaultpapersize
-                else :    
+                else :
                     papersize = oldpapersize
                 duplexmode = oldduplexmode
@@ -279,14 +279,14 @@
             if page["mediasize"] != "Default" :
                 papersize = page["mediasize"]
-            if not duplexmode :    
+            if not duplexmode :
                 duplexmode = oldduplexmode or defaultduplexmode
-            oldpjlcopies = pjlcopies    
+            oldpjlcopies = pjlcopies
             oldduplexmode = duplexmode
             oldpapersize = papersize
             copies = max(pjlcopies, page["copies"]) # Was : pjlcopies * page["copies"]
             self.pagecount += (copies - 1)
-            self.logdebug("%s*%s*%s*%s" % (copies, 
-                                           papersize, 
-                                           page["mediasource"], 
+            self.logdebug("%s*%s*%s*%s" % (copies,
+                                           papersize,
+                                           page["mediasource"],
                                            duplexmode))
         return self.pagecount
Index: pkpgcounter/trunk/pkpgpdls/plain.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/plain.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/plain.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -29,15 +29,15 @@
     totiffcommands = [ 'enscript --quiet --portrait --no-header --columns 1 --output - "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r"%(dpi)i" -sOutputFile="%(outfname)s" -',
                        'a2ps --borders 0 --quiet --portrait --no-header --columns 1 --output - "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r"%(dpi)i" -sOutputFile="%(outfname)s" -',
-                     ]  
+                     ]
     required = [ "a2ps | enscript", "gs" ]
-    openmode = "rU"                 
+    openmode = "rU"
     format = "plain text"
-    def isValid(self) :    
+    def isValid(self) :
         """Returns True if data is plain text, else False.
-        
+
            It's hard to detect a plain text file, so we just try to
            extract lines from the first block (sufficiently large).
            If it's impossible to find one we consider it's not plain text.
-        """   
+        """
         lines = self.firstblock.split("\r\n")
         if len(lines) == 1 :
@@ -47,7 +47,7 @@
         if len(lines) > 1 :
             return True
-        else :    
+        else :
             return False
-            
+
     def getJobSize(self) :
         """Counts pages in a plain text document."""
@@ -58,14 +58,14 @@
         for line in self.infile :
             if line.endswith("\n") :
-                linecount += 1    
+                linecount += 1
                 if (linecount > pagesize) :
                     pagecount += 1
                     linecount = 0
-                else :    
+                else :
                     cnt = line.count("\f")
                     if cnt :
                         pagecount += cnt
                         linecount = 0
-            else :        
+            else :
                 raise pdlparser.PDLParserError, "Unsupported file format. Please send the file to %s" % version.__authoremail__
         return pagecount + 1    # NB : empty files are catched in isValid()
Index: pkpgcounter/trunk/pkpgpdls/pnmascii.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/pnmascii.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/pnmascii.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -26,14 +26,14 @@
 class Parser(pdlparser.PDLParser) :
     """A parser for PNM (ascii) documents."""
-    openmode = "rU"                 
+    openmode = "rU"
     format = "PNM (ascii)"
-    def isValid(self) :    
+    def isValid(self) :
         """Returns True if data is ASCII PNM, else False."""
         if self.firstblock.split()[0] in ("P1", "P2", "P3") :
             self.marker = self.firstblock[:2]
             return True
-        else :    
+        else :
             return False
-            
+
     def getJobSize(self) :
         """Counts pages in a PNM (ascii) document."""
@@ -47,10 +47,10 @@
                 # Special case of cmyk map
                 divby = 4
-            # Unfortunately any whitespace is valid, 
+            # Unfortunately any whitespace is valid,
             # so we do it the slow way...
             pagecount += line.split().count(marker)
-            
-        if not (pagecount % divby) :    
+
+        if not (pagecount % divby) :
             return pagecount // divby
-        else :    
+        else :
             return pagecount
Index: pkpgcounter/trunk/pkpgpdls/pdf.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/pdf.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/pdf.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -37,5 +37,5 @@
 PDFDELIMITERS = r"()<>[]{}/%"
 PDFMEDIASIZE = "/MediaBox [xmin ymin xmax ymax]" # an example. MUST be present in Page objects
-        
+
 class Parser(pdlparser.PDLParser) :
     """A parser for PDF documents."""
@@ -44,5 +44,5 @@
     openmode = "rU"
     format = "PDF"
-    def isValid(self) :    
+    def isValid(self) :
         """Returns True if data is PDF, else False."""
         if self.firstblock.startswith("%PDF-") or \
@@ -51,10 +51,10 @@
            (self.firstblock.find("%PDF-") != -1) :
             return True
-        else :    
+        else :
             return False
-        
-    def veryFastAndNotAlwaysCorrectgetJobSize(self) :    
+
+    def veryFastAndNotAlwaysCorrectgetJobSize(self) :
         """Counts pages in a PDF document.
-        
+
            This method works great in the general case,
            and is around 30 times faster than the active
@@ -70,10 +70,10 @@
     def getJobSize(self) :
         """Counts pages in a PDF document.
-        
+
            A faster way seems to be possible by extracting the
            "/Type/Pages/Count xxxx" value where there's no /Parent
            (i.e. the root of the page tree)
            Unfortunately I can't make a regexp work for this currently.
-           
+
            At least the actual method below is accurate, even if 25%
            slower than the old one. But we will be able to extract
@@ -84,12 +84,12 @@
         oregexp = re.compile(r"\s+(\d+)\s+(\d+)\s+(obj\s*.+?\s*?endobj)", \
                              re.DOTALL)
-                             
+
         # Regular expression indicating a new page
         npregexp = re.compile(r"/Type\s*/Page[/>\s]")
-        
-        # Regular expression indicating an empty page 
+
+        # Regular expression indicating an empty page
         # (usually to delete an existing one with a lower minor number)
-        epregexp = re.compile(r"obj\s*<<\s*/Type\s*/Page\s*>>\s*endobj") 
-        
+        epregexp = re.compile(r"obj\s*<<\s*/Type\s*/Page\s*>>\s*endobj")
+
         # First we build a mapping of objects to keep because
         # if two objects with the same major number are found,
@@ -109,6 +109,6 @@
                 #else :
                 #    self.logdebug("Object %i.%i OK" % (major, minor))
-                
-        # Now that we have deleted all unneeded objects, we        
+
+        # Now that we have deleted all unneeded objects, we
         # can count the ones which are new pages, minus the ones
         # which are empty and not displayed pages (in fact pages
Index: pkpgcounter/trunk/pkpgpdls/hbp.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/hbp.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/hbp.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -32,20 +32,20 @@
     """A parser for HBP documents."""
     format = "Brother HBP"
-    def isValid(self) :        
+    def isValid(self) :
         """Returns True if data is HBP, else False."""
         if self.firstblock.find("@PJL ENTER LANGUAGE = HBP\n") != -1 :
             return True
-        else :    
+        else :
             return False
-            
+
     def getJobSize(self) :
         """Counts pages in a HBP document.
-        
+
            Algorithm by Jerome Alet.
-           
+
            The documentation used for this was :
-         
+
            http://sf.net/projects/hbp-for-brother/
-           
+
            IMPORTANT : this may not work since @F should be sufficient,
            but the documentation really is unclear and I don't know
@@ -55,5 +55,5 @@
         minfile = mmap.mmap(infileno, os.fstat(infileno)[6], prot=mmap.PROT_READ, flags=mmap.MAP_SHARED)
         pagecount = 0
-        
+
         formfeed = "@G" + chr(0) + chr(0) + chr(1) + chr(0xff) + "@F"
         fflen = len(formfeed)
@@ -66,9 +66,9 @@
                         pagecount += 1
                         pos += fflen
-                    else :        
+                    else :
                         pos += 1
             except IndexError : # EOF ?
                 pass
-        finally :        
+        finally :
             minfile.close() # reached EOF
         return pagecount
Index: pkpgcounter/trunk/pkpgpdls/pcl345.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/pcl345.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/pcl345.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -38,5 +38,5 @@
 class Parser(pdlparser.PDLParser) :
     """A parser for PCL3, PCL4, PCL5 documents."""
-    totiffcommands = [ 'pcl6 -sDEVICE=pdfwrite -r"%(dpi)i" -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -sOutputFile=- "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r%(dpi)i -sOutputFile="%(outfname)s" -', 
+    totiffcommands = [ 'pcl6 -sDEVICE=pdfwrite -r"%(dpi)i" -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -sOutputFile=- "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r%(dpi)i -sOutputFile="%(outfname)s" -',
                        'pcl6 -sDEVICE=pswrite -r"%(dpi)i" -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -sOutputFile=- "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r%(dpi)i -sOutputFile="%(outfname)s" -',
                      ]
@@ -48,5 +48,5 @@
                     2 : "Letter",
                     3 : "Legal",
-                    6 : "Ledger", 
+                    6 : "Ledger",
                     25 : "A5",
                     26 : "A4",
@@ -62,6 +62,6 @@
                     100 : "B5Envelope",
                     101 : "Custom",
-                 }   
-                 
+                 }
+
     mediasources = { # ESC&l####H
                      0 : "Default",
@@ -75,5 +75,5 @@
                      8 : "Tray1",
                    }
-                   
+
     orientations = { # ESC&l####O
                      0 : "Portrait",
@@ -82,5 +82,5 @@
                      3 : "ReverseLandscape",
                    }
-                   
+
     mediatypes = { # ESC&l####M
                      0 : "Plain",
@@ -90,6 +90,6 @@
                      4 : "Transparent",
                    }
-        
-    def isValid(self) :    
+
+    def isValid(self) :
         """Returns True if data is PCL3/4/5, else False."""
         try :
@@ -97,7 +97,7 @@
             while self.firstblock[pos] == chr(0) :
                 pos += 1
-        except IndexError :        
+        except IndexError :
             return False
-        else :    
+        else :
             firstblock = self.firstblock[pos:]
             if firstblock.startswith("\033E\033") or \
@@ -111,26 +111,26 @@
                (firstblock.startswith(chr(0xcd)+chr(0xca)) and (firstblock.find("\033E\033") != -1)) :
                 return True
-            else :    
+            else :
                 return False
-        
+
     def setPageDict(self, attribute, value) :
         """Initializes a page dictionnary."""
         dic = self.pages.setdefault(self.pagecount, { "linescount" : 1,
-                                                      "copies" : 1, 
-                                                      "mediasource" : "Main", 
-                                                      "mediasize" : "Default", 
-                                                      "mediatype" : "Plain", 
-                                                      "orientation" : "Portrait", 
-                                                      "escaped" : "", 
+                                                      "copies" : 1,
+                                                      "mediasource" : "Main",
+                                                      "mediasize" : "Default",
+                                                      "mediatype" : "Plain",
+                                                      "orientation" : "Portrait",
+                                                      "escaped" : "",
                                                       "duplex": 0 })
         dic[attribute] = value
-        
-    def readByte(self) :    
+
+    def readByte(self) :
         """Reads a byte from the input stream."""
         tag = ord(self.minfile[self.pos])
         self.pos += 1
         return tag
-        
-    def endPage(self) :    
+
+    def endPage(self) :
         """Handle the FF marker."""
         #self.logdebug("FORMFEED %i at %08x" % (self.pagecount, self.pos-1))
@@ -138,6 +138,6 @@
             # Increments page count only if we are not inside an HPGL2 block
             self.pagecount += 1
-        
-    def escPercent(self) :    
+
+    def escPercent(self) :
         """Handles the ESC% sequence."""
         if self.minfile[self.pos : self.pos+7] == r"-12345X" :
@@ -147,5 +147,5 @@
             quotes = 0
             char = chr(self.readByte())
-            while ((char < ASCIILIMIT) or (quotes % 2)) and (char not in (FORMFEED, ESCAPE, NUL)) :  
+            while ((char < ASCIILIMIT) or (quotes % 2)) and (char not in (FORMFEED, ESCAPE, NUL)) :
                 buffer.append(char)
                 if char == '"' :
@@ -155,5 +155,5 @@
             #self.logdebug("ESCAPED : %s" % "".join(buffer))
             self.pos -= 1   # Adjust position
-        else :    
+        else :
             while 1 :
                 (value, end) = self.getInteger()
@@ -162,57 +162,57 @@
                     while self.minfile[self.pos] != ESCAPE :
                         self.pos += 1
-                    self.pos -= 1    
-                    return 
-                elif end == 'A' :    
+                    self.pos -= 1
+                    return
+                elif end == 'A' :
                     self.exitHPGL2()
                     return
-                elif end is None :    
+                elif end is None :
                     return
-        
-    def enterHPGL2(self) :    
+
+    def enterHPGL2(self) :
         """Enters HPGL2 mode."""
         #self.logdebug("ENTERHPGL2 %08x" % self.pos)
         self.hpgl2 = True
-        
-    def exitHPGL2(self) :    
+
+    def exitHPGL2(self) :
         """Exits HPGL2 mode."""
         #self.logdebug("EXITHPGL2 %08x" % self.pos)
         self.hpgl2 = False
-        
-    def handleTag(self, tagtable) :    
+
+    def handleTag(self, tagtable) :
         """Handles tags."""
         tagtable[self.readByte()]()
-        
-    def escape(self) :    
+
+    def escape(self) :
         """Handles the ESC character."""
         #self.logdebug("ESCAPE")
         self.handleTag(self.esctags)
-        
-    def escAmp(self) :    
+
+    def escAmp(self) :
         """Handles the ESC& sequence."""
         #self.logdebug("AMP")
         self.handleTag(self.escamptags)
-        
-    def escStar(self) :    
+
+    def escStar(self) :
         """Handles the ESC* sequence."""
         #self.logdebug("STAR")
         self.handleTag(self.escstartags)
-        
-    def escLeftPar(self) :    
+
+    def escLeftPar(self) :
         """Handles the ESC( sequence."""
         #self.logdebug("LEFTPAR")
         self.handleTag(self.escleftpartags)
-        
-    def escRightPar(self) :    
+
+    def escRightPar(self) :
         """Handles the ESC( sequence."""
         #self.logdebug("RIGHTPAR")
         self.handleTag(self.escrightpartags)
-        
-    def escE(self) :    
+
+    def escE(self) :
         """Handles the ESCE sequence."""
         #self.logdebug("RESET")
         self.resets += 1
-        
-    def escAmpl(self) :    
+
+    def escAmpl(self) :
         """Handles the ESC&l sequence."""
         while 1 :
@@ -244,5 +244,5 @@
                 self.setPageDict("copies", value)
                 #self.logdebug("COPIES %i" % value)
-            elif end == 'F' :    
+            elif end == 'F' :
                 self.linesperpagevalues.append(value)
                 self.linesperpage = value
@@ -250,6 +250,6 @@
             #else :
             #    self.logdebug("Unexpected end <%s> and value <%s>" % (end, value))
-                
-    def escAmpa(self) :    
+
+    def escAmpa(self) :
         """Handles the ESC&a sequence."""
         while 1 :
@@ -257,10 +257,10 @@
             if value is None :
                 return
-            if end == 'G' :    
+            if end == 'G' :
                 #self.logdebug("BACKSIDES %i" % value)
                 self.backsides.append(value)
                 self.setPageDict("duplex", value)
-                
-    def escAmpp(self) :    
+
+    def escAmpp(self) :
         """Handles the ESC&p sequence."""
         while 1 :
@@ -268,9 +268,9 @@
             if value is None :
                 return
-            if end == 'X' :    
+            if end == 'X' :
                 self.pos += value
                 #self.logdebug("SKIPTO %08x" % self.pos)
-                
-    def escStarb(self) :    
+
+    def escStarb(self) :
         """Handles the ESC*b sequence."""
         while 1 :
@@ -278,9 +278,9 @@
             if (end is None) and (value is None) :
                 return
-            if end in ('V', 'W', 'v', 'w') :    
+            if end in ('V', 'W', 'v', 'w') :
                 self.pos += (value or 0)
                 #self.logdebug("SKIPTO %08x" % self.pos)
-                
-    def escStarr(self) :    
+
+    def escStarr(self) :
         """Handles the ESC*r sequence."""
         while 1 :
@@ -289,9 +289,9 @@
                 if end is None :
                     return
-                elif end in ('B', 'C') :        
+                elif end in ('B', 'C') :
                     #self.logdebug("EndGFX")
                     if self.startgfx :
                         self.endgfx.append(1)
-                    else :    
+                    else :
                         #self.logdebug("EndGFX found before StartGFX, ignored.")
                         pass
@@ -299,6 +299,6 @@
                 #self.logdebug("StartGFX %i" % value)
                 self.startgfx.append(value)
-                
-    def escStaroptAmpu(self) :    
+
+    def escStaroptAmpu(self) :
         """Handles the ESC*o ESC*p ESC*t and ESC&u sequences."""
         while 1 :
@@ -306,6 +306,6 @@
             if value is None :
                 return
-        
-    def escSkipSomethingW(self) :    
+
+    def escSkipSomethingW(self) :
         """Handles the ESC???###W sequences."""
         while 1 :
@@ -313,22 +313,22 @@
             if value is None :
                 return
-            if end == 'W' :    
+            if end == 'W' :
                 self.pos += value
                 #self.logdebug("SKIPTO %08x" % self.pos)
-                
-    def newLine(self) :            
+
+    def newLine(self) :
         """Handles new lines markers."""
         if not self.hpgl2 :
             dic = self.pages.get(self.pagecount, None)
             if dic is None :
-                self.setPageDict("linescount", 1)                              
+                self.setPageDict("linescount", 1)
                 dic = self.pages.get(self.pagecount)
-            nblines = dic["linescount"]    
-            self.setPageDict("linescount", nblines + 1)                              
+            nblines = dic["linescount"]
+            self.setPageDict("linescount", nblines + 1)
             if (self.linesperpage is not None) \
                and (dic["linescount"] > self.linesperpage) :
                 self.pagecount += 1
-        
-    def getInteger(self) :    
+
+    def getInteger(self) :
         """Returns an integer value and the end character."""
         sign = 1
@@ -346,13 +346,13 @@
                 else :
                     return (value, char)
-            else :    
-                value = ((value or 0) * 10) + int(char)    
-        
-    def skipByte(self) :    
+            else :
+                value = ((value or 0) * 10) + int(char)
+
+    def skipByte(self) :
         """Skips a byte."""
         #self.logdebug("SKIPBYTE %08x ===> %02x" % (self.pos, ord(self.minfile[self.pos])))
         self.pos += 1
-        
-    def handleImageRunner(self) :    
+
+    def handleImageRunner(self) :
         """Handles Canon ImageRunner tags."""
         tag = self.readByte()
@@ -367,22 +367,22 @@
         else :
             self.pos -= 1 # Adjust position
-                
-    def getJobSize(self) :     
+
+    def getJobSize(self) :
         """Count pages in a PCL5 document.
-         
+
            Should also work for PCL3 and PCL4 documents.
-           
+
            Algorithm from pclcount
-           (c) 2003, by Eduardo Gielamo Oliveira & Rodolfo Broco Manin 
+           (c) 2003, by Eduardo Gielamo Oliveira & Rodolfo Broco Manin
            published under the terms of the GNU General Public Licence v2.
-          
+
            Backported from C to Python by Jerome Alet, then enhanced
            with more PCL tags detected. I think all the necessary PCL tags
            are recognized to correctly handle PCL5 files wrt their number
            of pages. The documentation used for this was :
-         
+
            HP PCL/PJL Reference Set
            PCL5 Printer Language Technical Quick Reference Guide
-           http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13205/bpl13205.pdf 
+           http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13205/bpl13205.pdf
         """
         infileno = self.infile.fileno()
@@ -405,5 +405,5 @@
         self.imagerunnermarker2 = chr(0x10) + chr(0x02)
         self.isimagerunner = (minfile[:2] == self.imagerunnermarker1)
-        
+
         tags = [ lambda : None] * 256
         tags[ord(LINEFEED)] = self.newLine
@@ -412,5 +412,5 @@
         tags[ord(ASCIILIMIT)] = self.skipByte
         tags[ord(self.imagerunnermarker1[0])] = self.handleImageRunner
-        
+
         self.esctags = [ lambda : None ] * 256
         self.esctags[ord('%')] = self.escPercent
@@ -420,5 +420,5 @@
         self.esctags[ord(')')] = self.escRightPar
         self.esctags[ord('E')] = self.escE
-        
+
         self.escamptags = [lambda : None ] * 256
         self.escamptags[ord('a')] = self.escAmpa
@@ -428,5 +428,5 @@
         self.escamptags[ord('n')] = self.escSkipSomethingW
         self.escamptags[ord('u')] = self.escStaroptAmpu
-        
+
         self.escstartags = [ lambda : None ] * 256
         self.escstartags[ord('b')] = self.escStarb
@@ -441,12 +441,12 @@
         self.escstartags[ord('m')] = self.escSkipSomethingW
         self.escstartags[ord('v')] = self.escSkipSomethingW
-        
+
         self.escleftpartags = [ lambda : None ] * 256
         self.escleftpartags[ord('s')] = self.escSkipSomethingW
         self.escleftpartags[ord('f')] = self.escSkipSomethingW
-        
+
         self.escrightpartags = [ lambda : None ] * 256
         self.escrightpartags[ord('s')] = self.escSkipSomethingW
-        
+
         self.pos = 0
         try :
@@ -454,9 +454,9 @@
                 while 1 :
                     tags[self.readByte()]()
-            except IndexError : # EOF ?            
+            except IndexError : # EOF ?
                 pass
         finally :
             self.minfile.close()
-        
+
         self.logdebug("Pagecount : \t\t\t%i" % self.pagecount)
         self.logdebug("Resets : \t\t\t%i" % self.resets)
@@ -482,9 +482,9 @@
         self.logdebug("NbBackSides : \t\t\t%i" % nbbacksides)
         self.logdebug("IsImageRunner : \t\t\t%s" % self.isimagerunner)
-        
+
         if self.isimagerunner :
             self.logdebug("Adjusting PageCount : +1")
             self.pagecount += 1      # ImageRunner adjustment
-        elif self.linesperpage is not None :    
+        elif self.linesperpage is not None :
             self.logdebug("Adjusting PageCount : +1")
             self.pagecount += 1      # Adjusts for incomplete last page
@@ -507,12 +507,12 @@
             self.logdebug("Adjusting PageCount : -1")
             self.pagecount -= 1
-                    
+
         self.pagecount = self.pagecount or nbmediasourcesdefault or nbmediasizes or nborientations or self.resets
-        
+
         if not self.pagecount :
             if self.resets == len(self.startgfx) :
-                self.pagecount = self.resets 
-        
-        defaultpjlcopies = 1    
+                self.pagecount = self.resets
+
+        defaultpjlcopies = 1
         defaultduplexmode = "Simplex"
         defaultpapersize = ""
@@ -539,16 +539,16 @@
                     pjlcopies = nbqty
                 else :
-                    if oldpjlcopies == -1 :    
+                    if oldpjlcopies == -1 :
                         pjlcopies = defaultpjlcopies
-                    else :    
-                        pjlcopies = oldpjlcopies    
-                if page["duplex"] :        
+                    else :
+                        pjlcopies = oldpjlcopies
+                if page["duplex"] :
                     duplexmode = "Duplex"
-                else :    
+                else :
                     defaultdm = pjlparser.default_variables.get("DUPLEX", "")
                     if defaultdm :
                         if defaultdm.upper() == "ON" :
                             defaultduplexmode = "Duplex"
-                        else :    
+                        else :
                             defaultduplexmode = "Simplex"
                     envdm = pjlparser.environment_variables.get("DUPLEX", "")
@@ -556,7 +556,7 @@
                         if envdm.upper() == "ON" :
                             duplexmode = "Duplex"
-                        else :    
+                        else :
                             duplexmode = "Simplex"
-                    else :        
+                    else :
                         duplexmode = oldduplexmode or defaultduplexmode
                 defaultps = pjlparser.default_variables.get("PAPER", "")
@@ -566,26 +566,26 @@
                 if envps :
                     papersize = envps
-                else :    
+                else :
                     if not oldpapersize :
                         papersize = defaultpapersize
-                    else :    
+                    else :
                         papersize = oldpapersize
-            else :        
+            else :
                 if oldpjlcopies == -1 :
                     pjlcopies = defaultpjlcopies
-                else :    
+                else :
                     pjlcopies = oldpjlcopies
-                
+
                 duplexmode = (page["duplex"] and "Duplex") or oldduplexmode or defaultduplexmode
-                if not oldpapersize :    
+                if not oldpapersize :
                     papersize = defaultpapersize
-                else :    
+                else :
                     papersize = oldpapersize
                 papersize = oldpapersize or page["mediasize"]
             if page["mediasize"] != "Default" :
                 papersize = page["mediasize"]
-            if not duplexmode :    
+            if not duplexmode :
                 duplexmode = oldduplexmode or defaultduplexmode
-            oldpjlcopies = pjlcopies    
+            oldpjlcopies = pjlcopies
             oldduplexmode = duplexmode
             oldpapersize = papersize
@@ -598,4 +598,4 @@
                                               page["mediasource"], \
                                               duplexmode))
-        
+
         return self.pagecount
Index: pkpgcounter/trunk/pkpgpdls/postscript.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/postscript.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/postscript.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -34,5 +34,5 @@
     openmode = "rU"
     format = "PostScript"
-    def isValid(self) :    
+    def isValid(self) :
         """Returns True if data is PostScript, else False."""
         if self.firstblock.startswith("%!") or \
@@ -45,7 +45,7 @@
               (self.firstblock.find("%!PS-Adobe") != -1) :
             return True
-        else :    
+        else :
             return False
-        
+
     def throughGhostScript(self) :
         """Get the count through GhostScript, useful for non-DSC compliant PS files."""
@@ -62,20 +62,20 @@
             except (IOError, OSError, AttributeError, ValueError), msg :
                 raise pdlparser.PDLParserError, "Problem during analysis of Binary PostScript document : %s" % msg
-        finally :        
+        finally :
             if fromchild.close() is not None :
                 raise pdlparser.PDLParserError, "Problem during analysis of Binary PostScript document"
-        self.logdebug("GhostScript said : %s pages" % pagecount)    
+        self.logdebug("GhostScript said : %s pages" % pagecount)
         return pagecount * self.copies
-        
-    def setcopies(self, pagenum, txtvalue) :    
+
+    def setcopies(self, pagenum, txtvalue) :
         """Tries to extract a number of copies from a textual value and set the instance attributes accordingly."""
         try :
             number = int(txtvalue)
-        except (ValueError, TypeError) :     
+        except (ValueError, TypeError) :
             pass
-        else :    
+        else :
             if number > self.pages[pagenum]["copies"] :
                 self.pages[pagenum]["copies"] = number
-                
+
     def natively(self) :
         """Count pages in a DSC compliant PostScript document."""
@@ -94,9 +94,9 @@
             if nbparts >= 1 :
                 part0 = parts[0]
-            else :    
+            else :
                 part0 = ""
             if part0 == r"%ADOPrintSettings:" :
                 acrobatmarker = True
-            elif part0 == "!R!" :    
+            elif part0 == "!R!" :
                 prescribe = True
             elif part0 == r"%%Pages:" :
@@ -119,5 +119,5 @@
                 if nbparts > 1 :
                     self.setcopies(pagecount, parts[1])
-            elif part0 == r"%RBINumCopies:" :   
+            elif part0 == r"%RBINumCopies:" :
                 if nbparts > 1 :
                     self.setcopies(pagecount, parts[1])
@@ -135,7 +135,7 @@
                     # treats both "%%Page: x x" and "%%Page: (x-y) z" (probably N-up mode)
                     newpagenum = int(line.split(']')[0].split()[-1])
-                except :    
+                except :
                     notinteger = True # It seems that sometimes it's not an integer but an EPS file name
-                else :    
+                else :
                     notinteger = False
                     if newpagenum == oldpagenum :
@@ -143,5 +143,5 @@
                     else :
                         oldpagenum = newpagenum
-                if proceed and not notinteger :        
+                if proceed and not notinteger :
                     pagecount += 1
                     self.pages[pagecount] = { "copies" : self.pages[pagecount-1]["copies"] }
@@ -155,11 +155,11 @@
                 self.setcopies(pagecount, part0)
             previousline = line
-            
-        # extract max number of copies to please the ghostscript parser, just    
+
+        # extract max number of copies to please the ghostscript parser, just
         # in case we will use it later
         self.copies = max([ v["copies"] for (k, v) in self.pages.items() ])
-        
+
         # now apply the number of copies to each page
-        if not pagecount and pagescomment :    
+        if not pagecount and pagescomment :
             pagecount = pagescomment
         for pnum in range(1, pagecount + 1) :
@@ -168,9 +168,9 @@
             pagecount += (copies - 1)
             self.logdebug("%s * page #%s" % (copies, pnum))
-            
+
         self.logdebug("Internal parser said : %s pages" % pagecount)
         return (pagecount, notrust)
-        
-    def getJobSize(self) :    
+
+    def getJobSize(self) :
         """Count pages in PostScript document."""
         self.copies = 1
@@ -182,3 +182,3 @@
             except pdlparser.PDLParserError, msg :
                 self.logdebug(msg)
-        return max(nbpages, newnbpages)    
+        return max(nbpages, newnbpages)
Index: pkpgcounter/trunk/pkpgpdls/escp2.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/escp2.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/escp2.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -29,5 +29,5 @@
     """A parser for ESC/P2 documents."""
     format = "ESC/P2"
-    def isValid(self) :        
+    def isValid(self) :
         """Returns True if data is ESC/P2, else False."""
         if self.firstblock.startswith("\033@") or \
@@ -36,13 +36,13 @@
            self.firstblock.startswith("\0\0\0\033\1@EJL") : # ESC/P Raster ??? Seen on Stylus Photo 1284
             return True
-        else :    
+        else :
             return False
-            
-    def getJobSize(self) :    
+
+    def getJobSize(self) :
         """Counts pages in an ESC/P2 document."""
         # with Gimpprint, at least, for each page there
         # are two Reset Printer sequences (ESC + @)
         marker1 = "\033@"
-        
+
         # with other software or printer driver, we
         # may prefer to search for "\r\n\fESCAPE"
@@ -50,13 +50,13 @@
         marker2r = "\r\f\033"
         marker2rn = "\r\n\f\033"
-        
+
         # and ghostscript's stcolor for example seems to
         # output ESC + @ + \f for each page plus one
         marker3 = "\033@\f"
-        
+
         # while ghostscript's escp driver outputs instead
         # \f + ESC + @
         marker4 = "\f\033@"
-        
+
         data = self.infile.read()
         pagecount1 = data.count(marker1)
@@ -64,11 +64,11 @@
         pagecount3 = data.count(marker3)
         pagecount4 = data.count(marker4)
-            
-        if pagecount2 :    
+
+        if pagecount2 :
             return pagecount2
-        elif pagecount3 > 1 :     
+        elif pagecount3 > 1 :
             return pagecount3 - 1
-        elif pagecount4 :    
+        elif pagecount4 :
             return pagecount4
-        else :    
-            return int(pagecount1 / 2)       
+        else :
+            return int(pagecount1 / 2)
Index: pkpgcounter/trunk/pkpgpdls/spl1.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/spl1.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/spl1.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -34,5 +34,5 @@
     """A parser for SPL1 documents."""
     format = "SPL1 (aka GDI)"
-    def isValid(self) :    
+    def isValid(self) :
         """Returns True if data is SPL1, else False."""
         if ((self.firstblock[:128].find("\033%-12345X") != -1) and \
@@ -41,7 +41,7 @@
               (self.firstblock.find("LANGUAGE = SMART") != -1))) :
             return True
-        else :    
+        else :
             return False
-            
+
     def littleEndian(self) :
         """Toggles to little endianness."""
@@ -51,5 +51,5 @@
         # self.logdebug("Little Endian")
         return 0
-        
+
     def bigEndian(self) :
         """Toggles to big endianness."""
@@ -59,6 +59,6 @@
         # self.logdebug("Big Endian")
         return 0
-    
-    def escape(self, nextpos) :    
+
+    def escape(self, nextpos) :
         """Handles the ESC code."""
         self.isbitmap = False
@@ -67,7 +67,7 @@
         if minfile[pos : pos+8] == r"%-12345X" :
             endpos = pos + 9
-        elif minfile[pos-1] in ESCAPECHARS :    
+        elif minfile[pos-1] in ESCAPECHARS :
             endpos = pos
-        else :    
+        else :
             return 0
         endmark = (chr(0x1b), chr(0x00))
@@ -79,6 +79,6 @@
                 quotes += 1
             endpos += 1
-            
-        # Store this in a per page mapping.    
+
+        # Store this in a per page mapping.
         # NB : First time will be at page 0 (i.e. **before** page 1) !
         stuff = self.escapedStuff.setdefault(self.pagecount, [])
@@ -90,8 +90,8 @@
         self.logdebug("Escaped datas : [%s]" % repr(datas))
         return endpos - pos + 1
-        
+
     def getJobSize(self) :
         """Counts pages in an SPL1 document.
-        
+
            Algorithm by Jerome Alet.
         """
@@ -110,5 +110,5 @@
                     if tag in ESCAPECHARS :
                         pos += self.escape(pos+1)
-                    else :    
+                    else :
                         if not self.isbitmap :
                             raise pdlparser.PDLParserError, "Unfortunately SPL1 is incompletely recognized. Parsing aborted. Please report the problem to %s" % version.__authoremail__
@@ -116,11 +116,11 @@
                          seqnum) = unpack(">IH", minfile[pos:pos+6])
                         # self.logdebug("Offset : %i      Sequence Number : %i" % (offset, seqnum))
-                        if not seqnum : 
+                        if not seqnum :
                             # Sequence number resets to 0 for each new page.
                             self.pagecount += 1
                         pos += 4 + offset
-            except struct.error, msg :     
+            except struct.error, msg :
                 raise pdlparser.PDLParserError, "Unfortunately SPL1 is incompletely recognized (%s). Parsing aborted. Please report the problem to %s" % (msg, version.__authoremail__)
-            except IndexError : # EOF ?            
+            except IndexError : # EOF ?
                 pass
         finally :
Index: pkpgcounter/trunk/pkpgpdls/cfax.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/cfax.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/cfax.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -29,18 +29,18 @@
     """A parser for Structured Fax documents."""
     format = "Structured Fax"
-    def isValid(self) :        
+    def isValid(self) :
         """Returns True if data is Structured Fax, else False."""
         if self.firstblock.startswith("Sfff") :
             return True
-        else :    
+        else :
             return False
-            
+
     def getJobSize(self) :
         """Counts pages in a Structured Fax document.
-        
+
            Algorithm by Jerome Alet.
-           
+
            The documentation used for this was :
-         
+
            http://delphi.pjh2.de/articles/graphic/sff_format.php
         """
@@ -57,10 +57,10 @@
              offsetlastpage,
              offsetdocumentend) = unpack("<4sBBHHHII", docheader)
-            self.infile.seek(offsetfirstpage - len(docheader), 1)     
+            self.infile.seek(offsetfirstpage - len(docheader), 1)
             while True :
                 headerid = self.infile.read(1)
                 if not headerid :
                     break
-                headerid = ord(headerid)    
+                headerid = ord(headerid)
                 if 1 <= headerid <= 216 : # Normal record header
                     self.infile.seek(headerid, 1)
@@ -69,18 +69,18 @@
                     if not additionalbyte :
                         break
-                    additionalbyte = ord(additionalbyte)    
+                    additionalbyte = ord(additionalbyte)
                     if 1 <= additionalbyte <= 255 :
                         # Skip additional user information (reserved)
                         self.infile.seek(additionalbyte, 1)
-                elif not headerid :        
+                elif not headerid :
                     # Record with more than 216 MH-coded bytes
                     recordlen = self.infile.read(2)
                     if not recordlen :
                         break
-                    recordlen = unpack("<H", recordlen)[0]    
+                    recordlen = unpack("<H", recordlen)[0]
                     self.infile.seek(recordlen, 1)
                 elif headerid == 254 : # Page header
                     pageheader = self.infile.read(17)
-                    if not pageheader : 
+                    if not pageheader :
                         break
                     headerlen = ord(pageheader[0])
@@ -95,9 +95,9 @@
                      offsetpreviouspage,
                      offsetnextpage) = unpack("<4BHHII", pageheader[1:])
-                    pagecount += 1    
+                    pagecount += 1
                     if (offsetnextpage == 1) or (vres == 255) :
                         break # End Of Document
-                    self.infile.seek(offsetnextpage, 1)    
-        except struct.error :     
+                    self.infile.seek(offsetnextpage, 1)
+        except struct.error :
              raise pdlparser.PDLParserError, "Invalid Structured Fax datas"
-        return max(docpagecount, pagecount)     
+        return max(docpagecount, pagecount)
Index: pkpgcounter/trunk/pkpgpdls/pclxl.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/pclxl.py (revision 3409)
+++ pkpgcounter/trunk/pkpgpdls/pclxl.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -32,10 +32,10 @@
 class Parser(pdlparser.PDLParser) :
     """A parser for PCLXL (aka PCL6) documents."""
-    totiffcommands = [ 'pcl6 -sDEVICE=pdfwrite -r"%(dpi)i" -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -sOutputFile=- "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r"%(dpi)i" -sOutputFile="%(outfname)s" -', 
+    totiffcommands = [ 'pcl6 -sDEVICE=pdfwrite -r"%(dpi)i" -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -sOutputFile=- "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r"%(dpi)i" -sOutputFile="%(outfname)s" -',
                        'pcl6 -sDEVICE=pswrite -r"%(dpi)i" -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -sOutputFile=- "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r"%(dpi)i" -sOutputFile="%(outfname)s" -',
                      ]
     required = [ "pcl6", "gs" ]
     format = "PCLXL (aka PCL6)"
-    mediasizes = { 
+    mediasizes = {
                     0 : "Letter",
                     1 : "Legal",
@@ -61,7 +61,7 @@
                     21 : "JISExec",
                     96 : "Default",
-                 }   
-                 
-    mediasources = {             
+                 }
+
+    mediasources = {
                      0 : "Default",
                      1 : "Auto",
@@ -73,6 +73,6 @@
                      7 : "ThirdCassette",
                    }
-                   
-    orientations = {               
+
+    orientations = {
                      0 : "Portrait",
                      1 : "Landscape",
@@ -81,6 +81,6 @@
                      4 : "Default",
                    }
-            
-    def isValid(self) :    
+
+    def isValid(self) :
         """Returns True if data is HP PCLXL aka PCL6, or Brother's' XL2HB, else False."""
         if (((self.firstblock[:128].find("\033%-12345X") != -1) and \
@@ -94,12 +94,12 @@
             self.format = "XL2HB"
             return True
-        else :    
+        else :
             return False
-            
+
     def beginPage(self, nextpos) :
         """Indicates the beginning of a new page, and extracts media information."""
         # self.logdebug("BeginPage at %x" % nextpos)
         self.pagecount += 1
-        
+
         # Default values
         mediatypelabel = "Plain"
@@ -108,5 +108,5 @@
         orientationlabel = "Portrait"
         duplexmode = None
-        
+
         # Now go upstream to decode media type, size, source, and orientation
         # this saves time because we don't need a complete parser !
@@ -117,5 +117,5 @@
             if val in (0x44, 0x48, 0x41) : # if previous endPage or openDataSource or beginSession (first page)
                 break
-            if val == 0x26 :    
+            if val == 0x26 :
                 mediasource = ord(minfile[pos - 2])
                 mediasourcelabel = self.mediasources.get(mediasource, str(mediasource))
@@ -132,57 +132,57 @@
                         mediasizelabel = minfile[pos+2:pos+2+arraylength].title()
                         pos -= 1
-                    else :    
+                    else :
                         # if we just found an ubyte, then the media
                         # size is known by its index
                         mediasize = ord(minfile[pos+1])
                         mediasizelabel = self.mediasizes.get(mediasize, str(mediasize))
-                    pos -= 1 
+                    pos -= 1
                     # self.logdebug("Media size : %s" % mediasizelabel)
-            elif val == 0x28 :    
+            elif val == 0x28 :
                 orientation = ord(minfile[pos - 2])
                 orientationlabel = self.orientations.get(orientation, str(orientation))
                 pos -= 4
-            elif val == 0x27 :    
+            elif val == 0x27 :
                 savepos = pos
                 pos -= 1
-                startpos = size = None 
+                startpos = size = None
                 while pos > 0 : # safety check : don't go back to far !
                     val = ord(minfile[pos])
-                    pos -= 1    
+                    pos -= 1
                     if val == 0xc8 :
                         length = self.tags[ord(minfile[pos+2])] # will probably always be a byte or uint16
-                        if length == 1 :    
+                        if length == 1 :
                             startpos = pos + 4
                             size = unpack("B", self.minfile[pos+3:startpos])[0]
-                        elif length == 2 :    
+                        elif length == 2 :
                             startpos = pos + 5
                             size = unpack(self.unpackShort, self.minfile[pos+3:startpos])[0]
-                        elif length == 4 :    
+                        elif length == 4 :
                             startpos = pos + 7
                             size = unpack(self.unpackLong, self.minfile[pos+3:startpos])[0]
-                        else :    
+                        else :
                             raise pdlparser.PDLParserError, "Error on size at %s : %s" % (pos+2, length)
                         break
                 mediatypelabel = minfile[startpos:startpos+size]
                 # self.logdebug("Media type : %s" % mediatypelabel)
-            elif val == 0x34 :    
+            elif val == 0x34 :
                 duplexmode = "Simplex"
                 pos -= 2
-            elif val in (0x35, 0x36) :    
+            elif val in (0x35, 0x36) :
                 duplexmode = "Duplex"
                 pos -= 2
-            # else : TODO : CUSTOM MEDIA SIZE AND UNIT ! 
-            else :    
+            # else : TODO : CUSTOM MEDIA SIZE AND UNIT !
+            else :
                 pos -= 1  # ignored
-        self.pages[self.pagecount] = { "copies" : 1, 
-                                       "orientation" : orientationlabel, 
-                                       "mediatype" : mediatypelabel, 
+        self.pages[self.pagecount] = { "copies" : 1,
+                                       "orientation" : orientationlabel,
+                                       "mediatype" : mediatypelabel,
                                        "mediasize" : mediasizelabel,
                                        "mediasource" : mediasourcelabel,
                                        "duplex" : duplexmode,
-                                     } 
+                                     }
         return 0
-        
-    def endPage(self, nextpos) :    
+
+    def endPage(self, nextpos) :
         """Indicates the end of a page."""
         # self.logdebug("EndPage at %x" % nextpos)
@@ -198,14 +198,14 @@
                 # self.logdebug("Number of copies : %i" % nbcopies)
                 self.pages[self.pagecount]["copies"] = nbcopies
-            except KeyError :    
+            except KeyError :
                 self.logdebug("It looks like this PCLXL file is corrupted.")
         return 0
-        
-    def setColorSpace(self, nextpos) :    
+
+    def setColorSpace(self, nextpos) :
         """Changes the color space."""
         if self.minfile[nextpos-4:nextpos-1] == self.RGBColorSpace : # TODO : doesn't seem to handle all cases !
             self.iscolor = True
         return 0
-            
+
     def array_Generic(self, nextpos, size) :
         """Handles all arrays."""
@@ -220,13 +220,13 @@
         except KeyError :
             raise pdlparser.PDLParserError, "Error on array size at %x" % nextpos
-            
-    def array_8(self, nextpos) :    
+
+    def array_8(self, nextpos) :
         """Handles byte arrays."""
         return self.array_Generic(nextpos, 1)
-        
+
     def array_16(self, nextpos) :
         """Handles 16 bits arrays."""
         return self.array_Generic(nextpos, 2)
-        
+
     def array_32(self, nextpos) :
         """Handles 32 bits arrays and Canon ImageRunner tags."""
@@ -243,18 +243,18 @@
                 toskip += length
             # self.logdebug("Canon ImageRunner skip until %x" % (nextpos+toskip))
-            return toskip    
+            return toskip
         else :
             # This is a normal PCLXL array
             return self.array_Generic(nextpos, 4)
-        
+
     def embeddedDataSmall(self, nextpos) :
         """Handle small amounts of data."""
         return 1 + ord(self.minfile[nextpos])
-        
+
     def embeddedData(self, nextpos) :
         """Handle normal amounts of data."""
         return 4 + unpack(self.unpackLong, self.minfile[nextpos:nextpos+4])[0]
-        
-    def skipHPPCLXL(self, nextpos) :    
+
+    def skipHPPCLXL(self, nextpos) :
         """Skip the 'HP-PCL XL' statement if needed."""
         minfile = self.minfile
@@ -265,10 +265,10 @@
             while minfile[pos] != '\n' :
                 pos += 1
-            length = (pos - nextpos + 1)    
-            # self.logdebug("Skip HP PCLXL statement until %x" % (nextpos + length))  
+            length = (pos - nextpos + 1)
+            # self.logdebug("Skip HP PCLXL statement until %x" % (nextpos + length))
             return length
-        else :    
+        else :
             return 0
-        
+
     def littleEndian(self, nextpos) :
         """Toggles to little endianness."""
@@ -278,5 +278,5 @@
         # self.logdebug("LittleEndian at %x" % (nextpos - 1))
         return self.skipHPPCLXL(nextpos)
-        
+
     def bigEndian(self, nextpos) :
         """Toggles to big endianness."""
@@ -286,10 +286,10 @@
         # self.logdebug("BigEndian at %x" % (nextpos - 1))
         return self.skipHPPCLXL(nextpos)
-    
+
     def reservedForFutureUse(self, nextpos) :
         """Outputs something when a reserved byte is encountered."""
         self.logdebug("Byte at %x is out of the PCLXL Protocol Class 2.0 Specification" % nextpos)
-        return 0    
-        
+        return 0
+
     def x46_class3(self, nextpos) :
         """Undocumented tag 0x46 in class 3.0 streams."""
@@ -301,8 +301,8 @@
             try :
                 offset = self.x46_functions[funcid]
-            except KeyError :    
+            except KeyError :
                 self.logdebug("Unexpected subfunction 0x%02x for undocumented tag 0x46 at %x" % (funcid, nextpos))
                 break
-            else :    
+            else :
                 pos -= offset
                 length = self.tags[ord(self.minfile[pos])]
@@ -315,7 +315,7 @@
                         raise pdlparser.PDLParserError, "Error on size '%s' at %x" % (length, pos+1)
             val = ord(minfile[pos])
-        return 0    
-        
-    def escape(self, nextpos) :    
+        return 0
+
+    def escape(self, nextpos) :
         """Handles the ESC code."""
         pos = endpos = nextpos
@@ -331,6 +331,6 @@
                     quotes += 1
                 endpos += 1
-                
-            # Store this in a per page mapping.    
+
+            # Store this in a per page mapping.
             # NB : First time will be at page 0 (i.e. **before** page 1) !
             stuff = self.escapedStuff.setdefault(self.pagecount, [])
@@ -338,5 +338,5 @@
             self.logdebug("Escaped datas : [%s]" % repr(minfile[pos : endpos]))
         return endpos - pos
-        
+
     def skipKyoceraPrescribe(self, nextpos) :
         """Skips Kyocera Prescribe commands."""
@@ -351,32 +351,32 @@
                     self.logdebug("Prescribe commands : [%s]" % repr(minfile[nextpos-1:pos]))
                     break
-                pos += 1    
+                pos += 1
             return (pos - nextpos)
         else :
             return 0
-            
+
     def getJobSize(self) :
         """Counts pages in a PCLXL (PCL6) document.
-        
+
            Algorithm by Jerome Alet.
-           
+
            The documentation used for this was :
-         
+
            HP PCL XL Feature Reference
            Protocol Class 2.0
-           http://www.hpdevelopersolutions.com/downloads/64/358/xl_ref20r22.pdf 
-           
+           http://www.hpdevelopersolutions.com/downloads/64/358/xl_ref20r22.pdf
+
            Protocol Class 2.1 Supplement
            xl_ref21.pdf
-           
+
            Protocol Class 3.0 Supplement
            xl_refsup30r089.pdf
         """
-        
+
         infileno = self.infile.fileno()
         self.minfile = minfile = mmap.mmap(infileno, os.fstat(infileno)[6], prot=mmap.PROT_READ, flags=mmap.MAP_SHARED)
-        
+
         self.iscolor = False
-        
+
         found = False
         while not found :
@@ -392,35 +392,35 @@
                 if endian == 0x29 :
                     self.littleEndian(0)
-                elif endian == 0x28 :    
+                elif endian == 0x28 :
                     self.bigEndian(0)
                 # elif endian == 0x27 : # TODO : This is the ASCII binding code : what does it do exactly ?
-                # 
-                else :    
+                #
+                else :
                     raise pdlparser.PDLParserError, "Unknown endianness marker 0x%02x at start !" % endian
         if not found :
             raise pdlparser.PDLParserError, "This file doesn't seem to be PCLXL (aka PCL6)"
-            
+
         # Initialize Media Sources
         for i in range(8, 256) :
             self.mediasources[i] = "ExternalTray%03i" % (i - 7)
-            
+
         # Initialize table of tags
-        self.tags = [ 0 ] * 256    
-        
+        self.tags = [ 0 ] * 256
+
         self.tags[0x1b] = self.escape # The escape code
-        
+
         self.tags[0x21] = self.skipKyoceraPrescribe # 0x21 is not normally used
-        
+
         # GhostScript's sources tell us that HP printers
         # only accept little endianness, but we can handle both.
         self.tags[0x28] = self.bigEndian    # BigEndian
         self.tags[0x29] = self.littleEndian # LittleEndian
-        
+
         self.tags[0x43] = self.beginPage    # BeginPage
         self.tags[0x44] = self.endPage      # EndPage
         self.tags[0x45] = self.reservedForFutureUse # reserved
-        
-        self.tags[0x46] = self.x46_class3 
-        
+
+        self.tags[0x46] = self.x46_class3
+
         self.tags[0x4a] = self.reservedForFutureUse # reserved
         self.tags[0x4b] = self.reservedForFutureUse # reserved
@@ -428,21 +428,21 @@
         self.tags[0x4d] = self.reservedForFutureUse # reserved
         self.tags[0x4e] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0x56] = self.reservedForFutureUse # TODO : documentation not clear about reserved status
-        
+
         self.tags[0x57] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0x59] = self.reservedForFutureUse # reserved
         self.tags[0x5a] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0x6a] = self.setColorSpace    # to detect color/b&w mode
-        
+
         self.tags[0x87] = self.reservedForFutureUse # reserved
         self.tags[0x88] = self.reservedForFutureUse # reserved
         self.tags[0x89] = self.reservedForFutureUse # reserved
         self.tags[0x8a] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0x8b] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0x8c] = self.reservedForFutureUse # reserved
         self.tags[0x8d] = self.reservedForFutureUse # reserved
@@ -450,13 +450,13 @@
         self.tags[0x8f] = self.reservedForFutureUse # reserved
         self.tags[0x90] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0x9a] = self.reservedForFutureUse # reserved
         self.tags[0x9c] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xa4] = self.reservedForFutureUse # reserved
         self.tags[0xa5] = self.reservedForFutureUse # reserved
         self.tags[0xa6] = self.reservedForFutureUse # reserved
         self.tags[0xa7] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xaa] = self.reservedForFutureUse # reserved
         self.tags[0xab] = self.reservedForFutureUse # reserved
@@ -465,7 +465,7 @@
         self.tags[0xae] = self.reservedForFutureUse # reserved
         self.tags[0xaf] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xb7] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xba] = self.reservedForFutureUse # reserved
         self.tags[0xbb] = self.reservedForFutureUse # reserved
@@ -473,7 +473,7 @@
         self.tags[0xbd] = self.reservedForFutureUse # reserved
         self.tags[0xbe] = self.reservedForFutureUse # reserved
-        
+
         # self.tags[0xbf] = self.passThrough # PassThrough mode should already be taken care of automatically
-        
+
         self.tags[0xc0] = 1 # ubyte
         self.tags[0xc1] = 2 # uint16
@@ -482,8 +482,8 @@
         self.tags[0xc4] = 4 # sint32
         self.tags[0xc5] = 4 # real32
-        
+
         self.tags[0xc6] = self.reservedForFutureUse # reserved
         self.tags[0xc7] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xc8] = self.array_8  # ubyte_array
         self.tags[0xc9] = self.array_16 # uint16_array
@@ -492,8 +492,8 @@
         self.tags[0xcc] = self.array_32 # sint32_array
         self.tags[0xcd] = self.array_32 # real32_array and unfortunately Canon ImageRunner
-        
+
         self.tags[0xce] = self.reservedForFutureUse # reserved
         self.tags[0xcf] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xd0] = 2 # ubyte_xy
         self.tags[0xd1] = 4 # uint16_xy
@@ -512,5 +512,5 @@
         self.tags[0xde] = self.reservedForFutureUse # reserved
         self.tags[0xdf] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xe0] = 4  # ubyte_box
         self.tags[0xe1] = 8  # uint16_box
@@ -529,5 +529,5 @@
         self.tags[0xee] = self.reservedForFutureUse # reserved
         self.tags[0xef] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xf0] = self.reservedForFutureUse # reserved
         self.tags[0xf1] = self.reservedForFutureUse # reserved
@@ -538,24 +538,24 @@
         self.tags[0xf6] = self.reservedForFutureUse # reserved
         self.tags[0xf7] = self.reservedForFutureUse # reserved
-        
+
         self.tags[0xf8] = 1 # attr_ubyte
         self.tags[0xf9] = 2 # attr_uint16
-        
+
         self.tags[0xfa] = self.embeddedData      # dataLength
         self.tags[0xfb] = self.embeddedDataSmall # dataLengthByte
-        
+
         self.tags[0xfc] = self.reservedForFutureUse # reserved
         self.tags[0xfd] = self.reservedForFutureUse # reserved
         self.tags[0xfe] = self.reservedForFutureUse # reserved
         self.tags[0xff] = self.reservedForFutureUse # reserved
-            
-        # color spaces    
+
+        # color spaces
         self.BWColorSpace = "".join([chr(0x00), chr(0xf8), chr(0x03)])
         self.GrayColorSpace = "".join([chr(0x01), chr(0xf8), chr(0x03)])
         self.RGBColorSpace = "".join([chr(0x02), chr(0xf8), chr(0x03)])
-        
+
         # set number of copies
-        self.setNumberOfCopies = "".join([chr(0xf8), chr(0x31)]) 
-        
+        self.setNumberOfCopies = "".join([chr(0xf8), chr(0x31)])
+
         # subcodes for undocumented tag 0x46 and the negative
         # offset to grab the value from.
@@ -569,17 +569,17 @@
                                0x98 : 2,
                              }
-                             
+
         # Markers for Canon ImageRunner printers
         self.imagerunnermarker1 = chr(0xcd) + chr(0xca) + chr(0x10) + chr(0x00)
         self.imagerunnermarker2 = chr(0xcd) + chr(0xca) + chr(0x10) + chr(0x02)
-                             
-        self.pages = { 0 : { "copies" : 1, 
-                             "orientation" : "Default", 
-                             "mediatype" : "Plain", 
-                             "mediasize" : "Default", 
-                             "mediasource" : "Default", 
+
+        self.pages = { 0 : { "copies" : 1,
+                             "orientation" : "Default",
+                             "mediatype" : "Plain",
+                             "mediasize" : "Default",
+                             "mediasource" : "Default",
                              "duplex" : None,
-                           } 
-                     }      
+                           }
+                     }
         tags = self.tags
         self.pagecount = 0
@@ -592,27 +592,27 @@
                     try :
                         tag = ord(minfile[pos])
-                    except OverflowError :    
+                    except OverflowError :
                         pos = oldpos + 1
                     pos += 1
                     length = tags[tag]
                     if length :
-                        if callable(length) :    
+                        if callable(length) :
                             length = length(pos)
-                        oldpos = pos    
-                        pos += length    
-            except IndexError : # EOF ?            
+                        oldpos = pos
+                        pos += length
+            except IndexError : # EOF ?
                 pass
         finally :
             self.minfile.close()
-            
+
         # now handle number of copies for each page (may differ).
         if self.iscolor :
             colormode = "Color"
-        else :    
+        else :
             colormode = "BW"
-            
+
         defaultduplexmode = "Simplex"
         defaultpapersize = ""
-        defaultpjlcopies = 1    
+        defaultpjlcopies = 1
         oldpjlcopies = -1
         oldduplexmode = ""
@@ -622,5 +622,5 @@
             # in PCLXL documentation.
             # NB : is number of copies is 0, the page won't be output
-            # but the formula below is still correct : we want 
+            # but the formula below is still correct : we want
             # to decrease the total number of pages in this case.
             page = self.pages.get(pnum, self.pages.get(1, { "copies" : 1, "mediasize" : "Default", "duplex" : None }))
@@ -641,16 +641,16 @@
                     pjlcopies = nbqty
                 else :
-                    if oldpjlcopies == -1 :    
+                    if oldpjlcopies == -1 :
                         pjlcopies = defaultpjlcopies
-                    else :    
-                        pjlcopies = oldpjlcopies    
-                if page["duplex"] :        
+                    else :
+                        pjlcopies = oldpjlcopies
+                if page["duplex"] :
                     duplexmode = page["duplex"]
-                else :    
+                else :
                     defaultdm = pjlparser.default_variables.get("DUPLEX", "")
                     if defaultdm :
                         if defaultdm.upper() == "ON" :
                             defaultduplexmode = "Duplex"
-                        else :    
+                        else :
                             defaultduplexmode = "Simplex"
                     envdm = pjlparser.environment_variables.get("DUPLEX", "")
@@ -658,10 +658,10 @@
                         if envdm.upper() == "ON" :
                             duplexmode = "Duplex"
-                        else :    
+                        else :
                             duplexmode = "Simplex"
-                    else :        
+                    else :
                         if not oldduplexmode :
                             duplexmode = defaultduplexmode
-                        else :    
+                        else :
                             duplexmode = oldduplexmode
                 defaultps = pjlparser.default_variables.get("PAPER", "")
@@ -671,21 +671,21 @@
                 if envps :
                     papersize = envps
-                else :    
+                else :
                     if not oldpapersize :
                         papersize = defaultpapersize
-                    else :    
+                    else :
                         papersize = oldpapersize
-            else :        
+            else :
                 if oldpjlcopies == -1 :
                     pjlcopies = defaultpjlcopies
-                else :    
+                else :
                     pjlcopies = oldpjlcopies
                 if not oldduplexmode :
                     duplexmode = defaultduplexmode
-                else :    
+                else :
                     duplexmode = oldduplexmode
-                if not oldpapersize :    
+                if not oldpapersize :
                     papersize = defaultpapersize
-                else :    
+                else :
                     papersize = oldpapersize
                 duplexmode = oldduplexmode
@@ -693,17 +693,17 @@
             if page["mediasize"] != "Default" :
                 papersize = page["mediasize"]
-            if not duplexmode :    
+            if not duplexmode :
                 duplexmode = oldduplexmode or defaultduplexmode
-            oldpjlcopies = pjlcopies    
+            oldpjlcopies = pjlcopies
             oldduplexmode = duplexmode
             oldpapersize = papersize
             copies = max(pjlcopies, page["copies"]) # Was : pjlcopies * page["copies"]
             self.pagecount += (copies - 1)
-            self.logdebug("%s*%s*%s*%s*%s*%s*%s" % (copies, 
-                                                 page["mediatype"], 
-                                                 papersize, 
-                                                 page["orientation"], 
-                                                 page["mediasource"], 
-                                                 duplexmode, 
+            self.logdebug("%s*%s*%s*%s*%s*%s*%s" % (copies,
+                                                 page["mediatype"],
+                                                 papersize,
+                                                 page["orientation"],
+                                                 page["mediasource"],
+                                                 duplexmode,
                                                  colormode))
         return self.pagecount
Index: pkpgcounter/trunk/pkpgpdls/dvi.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/dvi.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/dvi.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -34,5 +34,5 @@
     required = [ "dvips", "gs" ]
     format = "DVI"
-    def isValid(self) :        
+    def isValid(self) :
         """Returns True if data is DVI, else False."""
         try :
@@ -40,16 +40,16 @@
                 and (ord(self.lastblock[-1]) == 0xdf) :
                 return True
-            else :    
+            else :
                 return False
-        except IndexError :          
+        except IndexError :
             return False
-            
+
     def getJobSize(self) :
         """Counts pages in a DVI document.
-        
+
            Algorithm by Jerome Alet.
-           
+
            The documentation used for this was :
-         
+
            http://www.math.umd.edu/~asnowden/comp-cont/dvi.html
         """
@@ -64,5 +64,5 @@
                 while minfile[pos] == eofchar :
                     pos -= 1
-                idbyte = minfile[pos]    
+                idbyte = minfile[pos]
                 if idbyte != minfile[1] :
                     raise IndexError, "Invalid DVI file."
@@ -73,5 +73,5 @@
             except IndexError : # EOF ?
                 pass
-        finally :        
+        finally :
             minfile.close() # reached EOF
         return pagecount
Index: pkpgcounter/trunk/pkpgpdls/pil.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/pil.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/pil.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -26,5 +26,5 @@
 try :
     from PIL import Image
-except ImportError :    
+except ImportError :
     sys.stderr.write("ERROR: You MUST install the Python Imaging Library (python-imaging) for pkpgcounter to work.\n")
     raise pdlparser.PDLParserError, "The Python Imaging Library is missing."
@@ -34,16 +34,16 @@
 class Parser(pdlparser.PDLParser) :
     """A parser for plain text documents."""
-    totiffcommands = [ 'convert "%(infname)s" "%(outfname)s"' ]  
+    totiffcommands = [ 'convert "%(infname)s" "%(outfname)s"' ]
     required = [ "convert" ]
-    def isValid(self) :    
-        """Returns True if data is an image format supported by PIL, else False."""   
+    def isValid(self) :
+        """Returns True if data is an image format supported by PIL, else False."""
         try :
             image = Image.open(self.filename)
-        except (IOError, OverflowError) :    
+        except (IOError, OverflowError) :
             return False
-        else :    
+        else :
             self.format = "%s (%s)" % (image.format, image.format_description)
             return True
-            
+
     def getJobSize(self) :
         """Counts pages in an image file."""
@@ -52,7 +52,7 @@
         try :
             while True :
-                index += 1              
+                index += 1
                 image.seek(index)
-        except EOFError :        
+        except EOFError :
             pass
-        return index    
+        return index
Index: pkpgcounter/trunk/pkpgpdls/mscrap.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/mscrap.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/mscrap.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -33,11 +33,11 @@
     required = [ "xvfb-run", "xauth", "abiword", "gs" ]
     format = "Microsoft shitty"
-    def isValid(self) :    
+    def isValid(self) :
         """Returns True if data is MS crap, else False.
-        
+
            Identifying datas taken from the file command's magic database.
            IMPORTANT : some magic values are not reused here because they
            IMPORTANT : seem to be specific to some particular i18n release.
-        """   
+        """
         if self.firstblock.startswith("PO^Q`") \
            or self.firstblock.startswith("\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1") \
@@ -49,9 +49,9 @@
             if self.isMissing(self.required) :
                 return False
-            else :    
+            else :
                 return True
-        else :    
+        else :
             return False
-            
+
     def getJobSize(self) :
         """Counts pages in a Microsoft Word (r) (tm) (c) (etc...) document.
@@ -71,10 +71,10 @@
                 (first, last) = self.parent.readFirstAndLastBlocks(psinputfile)
                 import postscript
-                return postscript.Parser(self.parent, 
-                                         outfname, 
+                return postscript.Parser(self.parent,
+                                         outfname,
                                          (first, last)).getJobSize()
             finally :
                 psinputfile.close()
-        finally :    
+        finally :
             workfile.close()
         raise pdlparser.PDLParserError, "Impossible to count pages in %(infname)s" % locals()
Index: pkpgcounter/trunk/pkpgpdls/analyzer.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/analyzer.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/analyzer.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -43,21 +43,21 @@
         self.colorspace = colorspace
         self.resolution = resolution
-    
-    
-class PDLAnalyzer :    
+
+
+class PDLAnalyzer :
     """Class for PDL autodetection."""
     def __init__(self, filename, options=AnalyzerOptions()) :
         """Initializes the PDL analyzer.
-        
+
            filename is the name of the file or '-' for stdin.
-           filename can also be a file-like object which 
+           filename can also be a file-like object which
            supports read() and seek().
         """
         self.options = options
         self.filename = filename
-        self.workfile = None 
+        self.workfile = None
         self.mustclose = None
-        
-    def getJobSize(self) :    
+
+    def getJobSize(self) :
         """Returns the job's size."""
         size = 0
@@ -67,10 +67,10 @@
                 pdlhandler = self.detectPDLHandler()
                 size = pdlhandler.getJobSize()
-            except pdlparser.PDLParserError, msg :    
+            except pdlparser.PDLParserError, msg :
                 raise pdlparser.PDLParserError, "Unsupported file format for %s (%s)" % (self.filename, msg)
-        finally :    
+        finally :
             self.closeFile()
         return size
-            
+
     def getInkCoverage(self, colorspace=None, resolution=None) :
         """Extracts the percents of ink coverage from the input file."""
@@ -89,43 +89,43 @@
                     pdlhandler.convertToTiffMultiPage24NC(filename, self.options.resolution)
                     result = inkcoverage.getInkCoverage(filename, cspace)
-                finally :    
+                finally :
                     dummyfile.close()
-            except pdlparser.PDLParserError, msg :    
+            except pdlparser.PDLParserError, msg :
                 raise pdlparser.PDLParserError, "Unsupported file format for %s (%s)" % (self.filename, msg)
         finally :
             self.closeFile()
         return result
-        
-    def openFile(self) :    
+
+    def openFile(self) :
         """Opens the job's data stream for reading."""
         self.mustclose = False  # by default we don't want to close the file when finished
         if hasattr(self.filename, "read") and hasattr(self.filename, "seek") :
-            # filename is in fact a file-like object 
+            # filename is in fact a file-like object
             infile = self.filename
         elif self.filename == "-" :
             # we must read from stdin
             infile = sys.stdin
-        else :    
+        else :
             # normal file
             self.workfile = open(self.filename, "rb")
             self.mustclose = True
             return
-            
+
         # Use a temporary file, always seekable contrary to standard input.
         self.workfile = tempfile.NamedTemporaryFile(mode="w+b")
         self.filename = self.workfile.name
         while True :
-            data = infile.read(pdlparser.MEGABYTE) 
+            data = infile.read(pdlparser.MEGABYTE)
             if not data :
                 break
             self.workfile.write(data)
-        self.workfile.flush()    
+        self.workfile.flush()
         self.workfile.seek(0)
-            
-    def closeFile(self) :        
+
+    def closeFile(self) :
         """Closes the job's data stream if we have to."""
         if self.mustclose :
-            self.workfile.close()    
-        
+            self.workfile.close()
+
     def readFirstAndLastBlocks(self, inputfile) :
         """Reads the first and last blocks of data."""
@@ -136,17 +136,17 @@
             inputfile.seek(-pdlparser.LASTBLOCKSIZE, 2)
             lastblock = inputfile.read(pdlparser.LASTBLOCKSIZE)
-        except IOError :    
+        except IOError :
             lastblock = ""
-        return (firstblock, lastblock)     
-            
-    def detectPDLHandler(self) :    
+        return (firstblock, lastblock)
+
+    def detectPDLHandler(self) :
         """Tries to autodetect the document format.
-        
+
            Returns the correct PDL handler class or None if format is unknown
-        """   
+        """
         if not os.stat(self.filename).st_size :
             raise pdlparser.PDLParserError, "input file %s is empty !" % str(self.filename)
         (firstblock, lastblock) = self.readFirstAndLastBlocks(self.workfile)
-            
+
         # IMPORTANT : the order is important below. FIXME.
         for module in (postscript, \
@@ -170,16 +170,16 @@
                        mscrap, \
                        plain) :     # IMPORTANT : don't move this one up !
-            try :               
-                return module.Parser(self, self.filename, 
+            try :
+                return module.Parser(self, self.filename,
                                            (firstblock, lastblock))
             except pdlparser.PDLParserError :
                 pass # try next parser
         raise pdlparser.PDLParserError, "Analysis of first data block failed."
-            
-def main() :    
+
+def main() :
     """Entry point for PDL Analyzer."""
     import optparse
     from copy import copy
-    
+
     def check_cichoice(option, opt, value) :
         """To add a CaseIgnore Choice option type."""
@@ -187,10 +187,10 @@
         if valower in [v.lower() for v in option.cichoices] :
             return valower
-        else :    
+        else :
             choices = ", ".join([repr(o) for o in option.cichoices])
             raise optparse.OptionValueError(
                 "option %s: invalid choice: %r (choose from %s)"
                 % (opt, value, choices))
-    
+
     class MyOption(optparse.Option) :
         """New Option class, with CaseIgnore Choice type."""
@@ -199,23 +199,23 @@
         TYPE_CHECKER = copy(optparse.Option.TYPE_CHECKER)
         TYPE_CHECKER["cichoice"] = check_cichoice
-        
-    parser = optparse.OptionParser(option_class=MyOption, 
+
+    parser = optparse.OptionParser(option_class=MyOption,
                                    usage="python analyzer.py [options] file1 [file2 ...]")
-    parser.add_option("-v", "--version", 
-                            action="store_true", 
+    parser.add_option("-v", "--version",
+                            action="store_true",
                             dest="version",
                             help="Show pkpgcounter's version number and exit.")
-    parser.add_option("-d", "--debug", 
-                            action="store_true", 
+    parser.add_option("-d", "--debug",
+                            action="store_true",
                             dest="debug",
                             help="Activate debug mode.")
-    parser.add_option("-c", "--colorspace", 
+    parser.add_option("-c", "--colorspace",
                             dest="colorspace",
                             type="cichoice",
                             cichoices=["bw", "rgb", "cmyk", "cmy", "gc"],
                             help="Activate the computation of ink usage, and defines the colorspace to use. Supported values are 'BW', 'RGB', 'CMYK', 'CMY', and 'GC'.")
-    parser.add_option("-r", "--resolution", 
-                            type="int", 
-                            default=72, 
+    parser.add_option("-r", "--resolution",
+                            type="int",
+                            default=72,
                             dest="resolution",
                             help="The resolution in DPI to use when checking ink usage. Lower resolution is faster but less accurate. Default is 72 dpi.")
@@ -223,5 +223,5 @@
     if options.version :
         print "%s" % version.__version__
-    elif not (72 <= options.resolution <= 1200) :    
+    elif not (72 <= options.resolution <= 1200) :
         sys.stderr.write("ERROR: the argument to the --resolution command line option must be between 72 and 1200.\n")
         sys.stderr.flush()
@@ -229,5 +229,5 @@
         if (not arguments) or ((not sys.stdin.isatty()) and ("-" not in arguments)) :
             arguments.append("-")
-        totalsize = 0    
+        totalsize = 0
         lines = []
         try :
@@ -246,16 +246,16 @@
                                 except KeyError :
                                     pass
-                            lines.append("      ".join(lineparts))     
-                except (IOError, pdlparser.PDLParserError), msg :    
+                            lines.append("      ".join(lineparts))
+                except (IOError, pdlparser.PDLParserError), msg :
                     sys.stderr.write("ERROR: %s\n" % msg)
                     sys.stderr.flush()
-        except KeyboardInterrupt :            
+        except KeyboardInterrupt :
             sys.stderr.write("WARN: Aborted at user's request.\n")
             sys.stderr.flush()
-        if not options.colorspace :    
+        if not options.colorspace :
             print "%i" % totalsize
-        else :    
+        else :
             print "\n".join(lines)
-    
-if __name__ == "__main__" :    
+
+if __name__ == "__main__" :
     main()
Index: pkpgcounter/trunk/pkpgpdls/pjl.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/pjl.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/pjl.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -35,8 +35,8 @@
         return self.message
     __str__ = __repr__
-        
+
 class PJLParser :
     """A parser for PJL documents.
-    
+
        Information extracted for bpl11897.pdf which was
        downloaded from Hewlett-Packard's website.
@@ -52,6 +52,6 @@
         self.parsed = 0
         self.parse()
-        
-    def __str__(self) :    
+
+    def __str__(self) :
         """Outputs our variables as a string of text."""
         if not self.parsed :
@@ -62,16 +62,16 @@
             for (k, v) in self.default_variables.items() :
                 mybuffer.append("  %s : %s" % (k, v))
-        if self.environment_variables :        
+        if self.environment_variables :
             mybuffer.append("Environment variables :")
             for (k, v) in self.environment_variables.items() :
                 mybuffer.append("  %s : %s" % (k, v))
-        return "\n".join(mybuffer)        
-            
-    def logdebug(self, message) :    
+        return "\n".join(mybuffer)
+
+    def logdebug(self, message) :
         """Logs a debug message if needed."""
         if self.debug :
             sys.stderr.write("%s\n" % message)
-            
-    def cleanvars(self) :        
+
+    def cleanvars(self) :
         """Cleans the variables dictionnaries."""
         for dicname in ("default", "environment") :
@@ -80,5 +80,5 @@
                 if len(v) == 1 :
                     varsdic[k] = v[0]
-        
+
     def parse(self) :
         """Parses a JL job."""
@@ -95,14 +95,14 @@
                                   or ((self.jlmarker == "@EJL") and (parts[1].upper() == "JI"))) :
                         # this is what we are interested in !
-                        try :    
+                        try :
                             (varname, value) = "".join(parts[2:]).split("=", 1) # TODO : parse multiple assignments on the same SET/JI statement
-                        except :    
+                        except :
                             self.logdebug("Invalid JL SET statement [%s]" % repr(statement))
-                        else :    
+                        else :
                             # all still looks fine...
                             if parts[1].upper() == "DEFAULT" :
                                 varsdic = self.default_variables
-                            else :    
-                                varsdic = self.environment_variables 
+                            else :
+                                varsdic = self.environment_variables
                             variable = varsdic.setdefault(varname.upper(), [])
                             variable.append(value)
@@ -121,10 +121,10 @@
         self.parsed = 1
         # self.logdebug("%s\n" % str(self))
-        
+
 class EJLParser(PJLParser) :
     """A parser for EJL (Epson Job Language) documents."""
     JL = "EJL"
-        
-def test() :        
+
+def test() :
     """Test function."""
     if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :
@@ -135,5 +135,5 @@
             infile = sys.stdin
             mustclose = 0
-        else :    
+        else :
             if arg.endswith(".ejl") :
                 klass = EJLParser
@@ -142,11 +142,11 @@
         try :
             parser = klass(infile.read(), debug=1)
-        except PJLParserError, msg :    
+        except PJLParserError, msg :
             sys.stderr.write("ERROR: %s\n" % msg)
             sys.stderr.flush()
-        if mustclose :    
+        if mustclose :
             infile.close()
-        print str(parser)            
-    
-if __name__ == "__main__" :    
+        print str(parser)
+
+if __name__ == "__main__" :
     test()
Index: pkpgcounter/trunk/pkpgpdls/version.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/version.py (revision 3410)
+++ pkpgcounter/trunk/pkpgpdls/version.py (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
Index: pkpgcounter/trunk/setup.py
===================================================================
--- pkpgcounter/trunk/setup.py (revision 564)
+++ pkpgcounter/trunk/setup.py (revision 3436)
@@ -1,4 +1,4 @@
 #! /usr/bin/env python
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
 #
 # pkpgcounter : a generic Page Description Language parser
@@ -9,10 +9,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -28,20 +28,20 @@
 try :
     from distutils.core import setup
-except ImportError, msg :    
+except ImportError, msg :
     sys.stderr.write("%s\n" % msg)
     sys.stderr.write("You need the DistUtils Python module.\nunder Debian, you may have to install the python-dev package.\nOf course, YMMV.\n")
     sys.exit(-1)
-    
-try :    
+
+try :
     from PIL import Image
-except ImportError :    
+except ImportError :
     sys.stderr.write("You need the Python Imaging Library (aka PIL).\nYou can grab it from http://www.pythonware.com\n")
     sys.exit(-1)
-    
-try :    
+
+try :
     import psyco
-except ImportError :    
+except ImportError :
     sys.stderr.write("WARN: If you are running on a 32 Bits x86 platform, you should install the Python Psyco module if possible, this would greatly speedup parsing. NB : Psyco doesn't work on other platforms, so don't worry if you're in this case.\n")
-    
+
 sys.path.insert(0, "pkpgpdls")
 from pkpgpdls.version import __version__, __doc__
@@ -53,11 +53,11 @@
     directory = os.sep.join(["share", "locale", lang, "LC_MESSAGES"])
     data_files.append((directory, [ mofile ]))
-    
-docdir = "share/doc/pkpgcounter"    
+
+docdir = "share/doc/pkpgcounter"
 docfiles = ["README", "COPYING", "BUGS", "CREDITS", "NEWS"]
 data_files.append((docdir, docfiles))
 
 directory = os.sep.join(["share", "man", "man1"])
-manpages = glob.glob(os.sep.join(["man", "*.1"]))    
+manpages = glob.glob(os.sep.join(["man", "*.1"]))
 data_files.append((directory, manpages))
 
@@ -71,3 +71,3 @@
       scripts = [ "bin/pkpgcounter" ],
       data_files = data_files)
-      
+
Index: pkpgcounter/trunk/bin/pkpgcounter
===================================================================
--- pkpgcounter/trunk/bin/pkpgcounter (revision 564)
+++ pkpgcounter/trunk/bin/pkpgcounter (revision 3436)
@@ -1,4 +1,4 @@
 #! /usr/bin/env python
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
 #
 # pkpgcounter : a generic Page Description Language parser
@@ -9,10 +9,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -71,40 +71,40 @@
   -v | --version        Prints pkpgcounter's version number then exits.
   -h | --help           Prints this message then exits.
-  
-  -d | --debug          Activate debug mode. 
-  
+
+  -d | --debug          Activate debug mode.
+
   -cCOLORSPACE, --colorspace=COLORSPACE
                         Activate the computation of ink usage, and defines the
                         colorspace to use. Supported values are 'BW' (Black),
                         'RGB', 'CMYK', 'CMY', and 'GC' (Grayscale vs Color).
-                        'GC' is useful if you only need to differentiate 
+                        'GC' is useful if you only need to differentiate
                         grayscale pages from coloured pages but don't care
                         about ink usage per se.
-                        
+
   -rRESOLUTION, --resolution=RESOLUTION
                         The resolution in DPI to use when checking ink usage.
                         Lower resolution is faster but less accurate. Default
                         is 72 dpi.
-  
-examples :                              
+
+examples :
 
   $ pkpgcounter file1.ps file2.escp2 file3.pclxl <file4.pcl345
-  
+
   Will launch pkpgcounter and will output the total number of pages
   needed to print all the documents specified.
-  
+
   $ pkpgcounter --colorspace bw --resolution 150 file1.ps
-  
+
   Will output the percent of black ink needed on each page of
   the file1.ps file rendered at 150 dpi.
-  
-%(__gplblurb__)s  
+
+%(__gplblurb__)s
 
 Please e-mail bugs to: %(__authoremail__)s"""
 
-if __name__ == "__main__" : 
+if __name__ == "__main__" :
     if (len(sys.argv) >= 2) and (sys.argv[1] in ("-h", "--help")) :
         print __doc__ % globals()
-    else :    
+    else :
         analyzer.main()
 
Index: pkpgcounter/trunk/clean.sh
===================================================================
--- pkpgcounter/trunk/clean.sh (revision 564)
+++ pkpgcounter/trunk/clean.sh (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
Index: pkpgcounter/trunk/man/genman.sh
===================================================================
--- pkpgcounter/trunk/man/genman.sh (revision 564)
+++ pkpgcounter/trunk/man/genman.sh (revision 3436)
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -19,5 +19,5 @@
 # $Id$
 #
-for prog in pkpgcounter ; do 
+for prog in pkpgcounter ; do
     echo "$prog" ;
     help2man --no-info \
@@ -27,5 +27,5 @@
              --source="C@LL - Conseil Internet & Logiciels Libres" \
              --output="temp$prog.1" \
-             $prog ; 
+             $prog ;
     /bin/sed -e "s/--/\\\-\\\-/g" <"temp$prog.1" >"$prog.1" ;
     /bin/rm -f "temp$prog.1"
Index: pkpgcounter/trunk/NEWS
===================================================================
--- pkpgcounter/trunk/NEWS (revision 3402)
+++ pkpgcounter/trunk/NEWS (revision 3436)
@@ -22,332 +22,332 @@
 
   * 3.51 :
-  
+
     - Partial rewrite of the PostScript parser, with huge performance increase.
-    
+
     - Fixed a problem in the PostScript parser where the number of copies set with
-      e.g. "dvips -c 9 -o output.ps input.dvi" wasn't correctly detected. 
+      e.g. "dvips -c 9 -o output.ps input.dvi" wasn't correctly detected.
 
     - Increased accuracy in the PDF parser, with some speed expense but
       some big room for future improvements.
-      
+
   * 3.50 :
-  
+
     - Added support for Canon BJ/BJC documents in page counting mode.
-    
+
     - Added support for Structured Fax documents in page counting mode.
-    
+
     - Added support for ASCII PNM (Netpbm) documents in page counting mode.
-    
+
     - Fixed a problem with the parsing of SPL1 (GDI) documents : all such
       documents should now be correctly parsed.
-    
+
     - Improved the PCL3/4/5 parser.
-    
+
   * 3.40 :
-  
+
     - Fixed a major bug in the detection of OpenDocument (ISO/IEC DIS 26300)
       files.
-      
+
     - Added support for page counting in Microsoft Word (c) (tm) (r) (etc...)
       documents.
-      
+
     - Added support for ink accounting in Microsoft Word (c) (tm) (r) (etc...)
       and OpenDocument (ISO/IEC DIS 26300) documents.
-      
-    - Now automatically detects missing executable dependencies at runtime.  
-      
+
+    - Now automatically detects missing executable dependencies at runtime.
+
   * 3.30 :
-  
+
     - Added support for all file formats supported by the Python Imaging
       Library.
-    
-    - Added a minimal parser for Hewlett-Packard LIDIL documents, as 
+
+    - Added a minimal parser for Hewlett-Packard LIDIL documents, as
       produced by the hpijs driver.
-      
+
     - Improved general reliability.
-    
+
     - Improved detection of PCL3/4/5 jobs.
-    
-    - Major code cleaning.  
-      
+
+    - Major code cleaning.
+
   * 3.20 :
-   
+
     - Added a minimal parser for Brother HBP documents.
-    
+
     - Added support for Canon ImageRunner commands to the PCLXL parser,
       much like it was already done for the PCL3/4/5 parser.
-      
+
   * 3.10 :
-  
+
     - Added a minimal parser for ESC/PAGES03 style documents.
-    
+
     - Fixed another problem in the code handling the output of Canon's
       ImageRunner printer drivers.
-    
+
   * 3.00 :
-  
+
     - Fixed a problem in the code handling the output of Canon's ImageRunner
       printer drivers.
-      
-    - Licensing terms changed to GNU GPL v3.0 or higher.  
-    
+
+    - Licensing terms changed to GNU GPL v3.0 or higher.
+
   * 2.18 :
-  
+
     - Fixed an incompatibility with Python v2.5
-    
-  * 2.17 : 
-  
+
+  * 2.17 :
+
     - Fixed problems in the handling of PJL number of copies (COPIES= and QTY=)
       which caused the number of copies for each page to be squared.
-    
-  * 2.16 : 
-  
+
+  * 2.16 :
+
     - Fixed a problem in the PCL3/4/5 parser to accomodate line based
       report generators which expect the printer to skip to next page
       based on lines per page instead of sending a specific command.
-      
+
   * 2.15 :
-   
+
     - Fixed a regexp in the PDF parser which caused some files to be
       incorrectly accounted for.
-    
+
     - Improved the detection of the number of copies in PostScript documents.
-    
+
   * 2.14 :
-  
+
     - Fixed a problem with some PS drivers which don't output %%Page:
       comments.
-      
-  * 2.13 : 
-   
+
+  * 2.13 :
+
     - Nowrecognizes the GC colorspace if you only want to differentiate
       grayscale pages from coloured pages. In this colorspace, the
       percents are always "G : 100.0   C : 0.0" or "G : 0.0   C : 100.0"
       respectively for a grayscale page and a coloured page.
-  
+
   * 2.12 :
-  
+
     - Fixed a problem with the PostScript parser.
-    
+
   * 2.11 :
-  
+
     - Improved overall robustness in ink accounting mode.
-    
+
   * 2.10 :
-  
+
     - Added a plain text parser, with support for both page counting and
       ink coverage.
-    
+
     - Added a minimal SPL1 parser.
-    
+
     - Fixed a problem in the PCLXL parser related to Kyocera printer drivers.
-    
+
   * 2.00 :
-  
+
     - The PCL3/4/5 parser was rewritten from scratch and is now
       table driven.
-      
+
     - Improved the PostScript parser.
-    
+
   * 1.85 :
-  
+
     - Added support for Samsung QPDL (aka SPL2) file format in page
       counting mode, thanks to the work done by Aur�en Croc on
       reverse engineering the file format.
-      
+
   * 1.85alpha :
-  
+
     - Added test document and program to generate the test document
       to check the functionning of the ink coverage computation algorithm.
-      
+
   * 1.84 :
-  
+
     - Computation of ink coverage now works and is documented.
       The supported file formats are : PS, PDF, PCLXL, PCL3/4/5,
       DVI and TIFF.
-      
+
   * 1.84alpha :
-  
+
     - Added initial support for the computation of ink coverage.
       See python analyzer.py --help for details. The same command
       line options work for pkpgcounter, although it's not
       documented yet.
-    
+
   * 1.83 :
-  
-    - Fixed a famously known 'brown paper bag' issue with file type autodetection. 
-    
+
+    - Fixed a famously known 'brown paper bag' issue with file type autodetection.
+
   * 1.82 :
-  
-    - Fixed PCL3/4/5 parser to detect recent Xerox drivers' output. 
-    
+
+    - Fixed PCL3/4/5 parser to detect recent Xerox drivers' output.
+
   * 1.81 :
-  
+
     - Improved the gs+Acrobat Reader fix done in 1.78.
-    
+
   * 1.80 :
-  
+
     - Added support for Zenographics ZjStream input format.
-    
+
   * 1.79 :
-  
+
     - Fixed a small problem in PostScript parser with dvips output.
-    
+
   * 1.78 :
-  
+
     - Launches gs less often when printing is done from Acrobat
       Reader.
-    
-  * 1.77 : 
-  
+
+  * 1.77 :
+
     - Fixed some problems with the code introduced in 1.76.
-    
+
     - Improved PCLXL parser's speed by almost 10%.
-    
+
   * 1.76 :
-  
+
     - Improved the PCLXL parser wrt undocumented tags.
-    
+
     - Preliminary support for Kyocera Prescribe commands.
-    
+
   * 1.75 :
-  
+
     - Added preliminary support for Canon ImageRunner's "LIPS" or "UFR"
-      (I don't know which) Page Description Language. 
-      
+      (I don't know which) Page Description Language.
+
   * 1.74 :
-  
+
     - Fixed a problem in the retrieval of named media sizes in PCLXL.
-    
+
     - Changed copyright years.
-    
+
   * 1.73 :
-  
+
     - Fixed duplex detection code in PCL3/4/5 parser.
-    
+
     - Fixed PCLXL detection code.
-    
+
     - Fixed retrieval of custom media types' names in PCLXL.
-    
+
     - Added inactive code to compute ink coverage ala PrintBill.
-    
+
   * 1.72 :
-  
+
     - Improved heuristic to detect when ghostscript has to be used to do
       the parsing.
-   
+
   * 1.71 :
-  
+
     - Now uses ghostscript as the parser when the PS stream was created by a
       particular MSWindows driver.
-    
+
     - Only complains about Psyco missing at install time, and stays
       quiet when running without Psyco.
-      
+
   * 1.70 :
-  
+
     - Fixed some PJL escaping issue in the PCLXL and PCL3/4/5 parsers.
-    
+
   * 1.69 :
-  
-    - Improved PCL3/4/5 parser.
-    
+
+    - Improved PCL3/4/5 parser.
+
     - Improved PCLXL parser wrt PJL stuff.
-    
+
   * 1.68 :
-  
+
     - Improved PostScript parser.
-    
+
   * 1.67 :
-  
+
     - Improved PostScript parser.
-    
-    - Improved PCL3/4/5 parser.
-    
-  * 1.66 : 
-  
+
+    - Improved PCL3/4/5 parser.
+
+  * 1.66 :
+
     - Improved PCLXL parser.
-    
-    - Improved PCL3/4/5 parser.
-    
+
+    - Improved PCL3/4/5 parser.
+
   * 1.65 :
-    
+
     - Improved PostScript parser.
-    
-    - Improved PCL3/4/5 parser.
-    
+
+    - Improved PCL3/4/5 parser.
+
   * 1.64 :
-    
-    - Improved PCL3/4/5 parser.
-    
+
+    - Improved PCL3/4/5 parser.
+
   * 1.63 :
-  
+
     - Now handles PJL statements to extract number of copies, duplex mode
       and paper size in the PCLXL and PCL3/4/5 parsers.
-    
+
   * 1.62 :
-  
+
     - Better handling of the number of copies in the PCLXL parser.
-    
+
     - Better handling of the number of copies in the PCL3/4/5 parser.
-      
+
   * 1.61 :
-  
-    - Improved PCL3/4/5 parser.
-    
+
+    - Improved PCL3/4/5 parser.
+
     - Better handling of the number of copies in the PostScript parser.
       Now the number can be different from page to page.
-    
-  * 1.60 : 
-  
+
+  * 1.60 :
+
     - Improved PCLXL parser.
-    
+
   * 1.59 :
-    
+
     - Major rewrite of the PDF parser to correctly handle all line endings.
-      
+
   * 1.58 :
-  
+
     - Fix for PDF files which contain several versions of the same PDF object.
-    
+
     - Doesn't break when python-psyco is not available.
-    
-  * 1.57 : 
-  
-    - Fixed a recently introduced bug in binary postscript handling code.  
-    
+
+  * 1.57 :
+
+    - Fixed a recently introduced bug in binary postscript handling code.
+
   * 1.56 :
-  
+
     - Renamed the library from pdlanalyzer into pkpgpdls to avoid problems
       when the code will be integrated back into PyKota.
-      
-  * 1.55 : 
-  
+
+  * 1.55 :
+
     - Added support for OpenOffice.org Writer and Impress documents.
-    
+
   * 1.54 :
-   
+
     - Added online documentation and a manual page.
-    
-  * 1.53 : 
-  
+
+  * 1.53 :
+
     - Moved code around to improve maintainability.
-    
-  * 1.52 : 
-  
+
+  * 1.52 :
+
     - Added support for the TIFF format.
-    
-  * 1.51 : 
-  
+
+  * 1.51 :
+
     - Added support for the DVI format.
-    
+
   * 1.50 :
-  
+
     - Major code changes to modularize. The pkpgcounter command line tool
       is now just an almost empty skeleton, which uses the pdlanalyzer
       library.
-      
-    - Several improvements to the parsing code.  
-      
+
+    - Several improvements to the parsing code.
+
   * 1.00 :
 
Index: pkpgcounter/trunk/CREDITS
===================================================================
--- pkpgcounter/trunk/CREDITS (revision 3409)
+++ pkpgcounter/trunk/CREDITS (revision 3436)
@@ -20,23 +20,23 @@
 
 The following people helped the pkpgcounter project :
-  
-  
+
+
   - Eduardo Gielamo Oliveira & Rodolfo Broco Manin : initial PCL parser.
-  
+
   - Valcir C. Vargas : helped on PCL3GUI support.
-  
-  - Daniel Franklin : pkpgcounter's algorithm for the computation 
+
+  - Daniel Franklin : pkpgcounter's algorithm for the computation
     of ink coverage comes from Daniel's PrintBill project.
-    
-  - Aur�en Croc : reverse engineered Samsung QPDL and published  
+
+  - Aur�en Croc : reverse engineered Samsung QPDL and published
                     a language specification.
 
   - Franck (?) : sent a path to improve the PostScript parser when
                  the PS code generated several copies.
-                 
-  - Yves Lavoie : reported a bug with Python 2.5                 
-  
+
+  - Yves Lavoie : reported a bug with Python 2.5
+
   - Kumar Appaiah : put pkpgcounter in Debian.
-  
+
   - Roger Jochem : reported problems and test files for custom
                    made printer drivers.
@@ -50,9 +50,9 @@
   THINK YOU DESERVE TO BE LISTED, JUST SEND ME AN EMAIL
   ASKING FOR BEING INCLUDED.
-  
+
   I APOLOGIZE IN ADVANCE IF I'VE FORGOTTEN TO ADD YOUR NAME.
-  
-  ALSO, SOME PEOPLE MAY HAVE REFUSED TO BE LISTED HERE, THIS 
+
+  ALSO, SOME PEOPLE MAY HAVE REFUSED TO BE LISTED HERE, THIS
   IS YOUR RIGHT TO DO SO TOO, JUST TELL ME.
-  
+
 ==============================================================
Index: pkpgcounter/trunk/README
===================================================================
--- pkpgcounter/trunk/README (revision 3409)
+++ pkpgcounter/trunk/README (revision 3436)
@@ -26,51 +26,51 @@
 
         - PostScript (both DSC compliant and binary)
-        
+
         - PDF
-        
+
         - PCL3/4/5
-        
+
         - PCLXL (aka PCL6)
-        
+
         - DVI
-        
+
         - OpenDocument (ISO/IEC DIS 26300)
-        
+
         - Microsoft Word (c) (tm) (r) (etc...)
-        
+
         - Plain text
-        
+
         - TIFF
-        
+
         - Several other image formats
-        
+
         - ESC/P2
-        
+
         - Zenographics ZjStream
-        
+
         - Samsung QPDL (aka SPL2)
-        
+
         - Samsung SPL1
-        
+
         - ESC/PageS03
-        
+
         - Brother HBP
 
         - Brother XL2HB
-        
+
         - Hewlett-Packard Lightweight Imaging Device Interface Language
-        
+
         - Structured Fax
-        
+
         - Canon BJ/BJC
-        
+
         - ASCII PNM (Netpbm)
-        
-The eleven latter ones, as well as some TIFF documents, are currently 
-only supported in page counting mode. 
 
-By default, when launched pkpgcounter prints on its standard output 
-a single integer representing the total number of pages in all the 
-files which filenames you've passed on the command line. 
+The eleven latter ones, as well as some TIFF documents, are currently
+only supported in page counting mode.
+
+By default, when launched pkpgcounter prints on its standard output
+a single integer representing the total number of pages in all the
+files which filenames you've passed on the command line.
 
 With no argument, or with a single dash in non-option arguments,
@@ -87,44 +87,44 @@
 
   0 - Download pkpgcounter from :
-  
+
         http://www.pykota.com/software/pkpgcounter/download
-        
-      and extract it :  
-      
+
+      and extract it :
+
         $ tar -zxf pkpgcounter-x.yy.tar.gz
-        
+
         where x.yy is pkpgcounter' version number.
-        
+
   1 - Run the installation script :
-      
+
         $ python setup.py install
-        
-      This will usually install the pkpgcounter into /usr/bin and  
+
+      This will usually install the pkpgcounter into /usr/bin and
       the library into /usr/lib/python2.?/site-packages/pkpgpdls/
-        
+
   2 - Use pkpgcounter :
-  
+
       $ pkpgcounter file1.ps file2.pclxl ... <fileN.escp2
-      
+
       pkpgcounter will display the total size in pages of all the files
       passed on the command line.
-      
+
       $ pkpgcounter --colorspace bw --resolution 150 file1.ps
-  
+
       Will output the percent of black ink needed on each page of
       the file1.ps file rendered at 150 dpi.
-      
-  3 - That's all !    
-  
+
+  3 - That's all !
+
 DEPENDENCIES :
 
   Most of the time, pkpgcounter only depends on the presence of :
-  
+
   - The Python Imaging Library (python-imaging)
-  
+
   But, depending on the file formats you plan to work with, and on the
   accounting mode you want to use (pages vs ink), you may need to install
   some or all of the additional software listed below. Usually, if one is
-  needed then pkpgcounter will complain. So your best bet is probably 
+  needed then pkpgcounter will complain. So your best bet is probably
   to NOT INSTALL anything until pkpgcounter asks you to do so on its
   standard error stream. Here's the list of software which may be needed
@@ -132,32 +132,32 @@
 
   - GhostScript (gs)
-  
+
   - The X Virtual Frame Buffer (xvfb)
-  
+
   - The X authority file utility xauth (xbase-clients)
-  
+
   - The dvips converter from TeX DVI to PostScript (tetex-bin)
-  
+
   - The ImageMagick image manipulation toolkit (imagemagick)
-  
+
   - The AbiWord word processor (abiword)
 
   - The GhostPCL/GhostPDL's pcl6 converter from PCL to PostScript
-        
+
 =============================================================================
 
-Troubleshooting : 
+Troubleshooting :
 -----------------
 
   If pkpgcounter gives incorrect results to you, please make an incorrectly
-  parsed data file available to us on some website, and tell us which 
-  driver was used, how many pages are in the file, and any additional 
+  parsed data file available to us on some website, and tell us which
+  driver was used, how many pages are in the file, and any additional
   information you think is relevant.
-  
+
   If pkpgcounter complain about your system lacking the Python Psyco module,
   please consider installing it to speedup file parsing. However, don't forget
-  that Psyco currently only runs on the 32 bits x86 platform, so no need to 
+  that Psyco currently only runs on the 32 bits x86 platform, so no need to
   install it if you've got another system type.
-  
+
 =============================================================================
 
@@ -167,6 +167,6 @@
 
     http://www.fea.unicamp.br/pclcount/
-    
-Their software is distributed under either the terms of a BSD-like license,    
+
+Their software is distributed under either the terms of a BSD-like license,
 or the terms of the GNU General Public License of the Free Software Foundation.
 
@@ -176,6 +176,6 @@
 The old parser was still available until pkpgcounter v2.18 was published, but
 was definitely removed after that, just before pkpgcounter v3.00 was published.
-    
-pkpgcounter's PCLXL (aka PCL6) parser doesn't originate from PCLCount, but 
+
+pkpgcounter's PCLXL (aka PCL6) parser doesn't originate from PCLCount, but
 was written from scratch, just like all the other parsers included in
 pkpgcounter.
@@ -183,11 +183,11 @@
 =============================================================================
 
-pkpgcounter's ink coverage algorithm for the CMYK colorspace is a 
-direct Python port from the PrintBill project by Daniel Franklin. 
-PrintBill is distributed under the terms of the GNU General Public 
-License of the Free Software Foundation, version 2 or higher. The 
-algorithms used for the other colorspaces are a complete rewrite of 
-PrintBill's algorithms using both Python and the Python Imaging 
-Library's facilities. 
+pkpgcounter's ink coverage algorithm for the CMYK colorspace is a
+direct Python port from the PrintBill project by Daniel Franklin.
+PrintBill is distributed under the terms of the GNU General Public
+License of the Free Software Foundation, version 2 or higher. The
+algorithms used for the other colorspaces are a complete rewrite of
+PrintBill's algorithms using both Python and the Python Imaging
+Library's facilities.
 
 =============================================================================
