Index: pykota/trunk/tests/runtest.sh
===================================================================
--- pykota/trunk/tests/runtest.sh (revision 1676)
+++ pykota/trunk/tests/runtest.sh (revision 1686)
@@ -4,5 +4,5 @@
 /bin/rm -f testsuite.* master2.ps
 gunzip <master.ps.gz >master2.ps
-for device in laserjet ljet3 ljet4 lj5gray lj5mono pxlmono pxlcolor pdfwrite pswrite psgray psmono psrgb epson epsonc eps9mid eps9high ; do
+for device in laserjet ljet3 ljet4 lj5gray lj5mono pxlmono pxlcolor pdfwrite pswrite psgray psmono psrgb epson epsonc eps9mid eps9high stcolor st800 escp escpc ; do
     gs -dQUIET -dBATCH -dNOPAUSE -sOutputFile="testsuite.$device" -sDEVICE="$device" master2.ps ;
     done
Index: pykota/trunk/pykota/pdlanalyzer.py
===================================================================
--- pykota/trunk/pykota/pdlanalyzer.py (revision 1683)
+++ pykota/trunk/pykota/pdlanalyzer.py (revision 1686)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.35  2004/08/30 23:10:24  jalet
+# Improved the ESC/P2 analyzer so that more GhostScript devices are supported
+#
 # Revision 1.34  2004/08/27 09:08:22  jalet
 # Improvement in PostScript parser to avoid being fooled by clever "students"
@@ -237,11 +240,44 @@
     def getJobSize(self) :    
         """Counts pages in an ESC/P2 document."""
-        # with GhostScript, at least, for each page there
+        # with Gimpprint, at least, for each page there
         # are two Reset Printer sequences (ESC + @)
-        marker = "\033@"
-        pagecount = 0
+        marker1 = "\033@"
+        pagecount1 = 0
+        
+        # with other software or printer driver, we
+        # may prefer to search for "\r\n\fESCAPE"
+        # or "\r\fESCAPE"
+        marker2r = "\r\f\033"
+        marker2rn = "\r\n\f\033"
+        pagecount2 = 0
+        
+        # and ghostscript's stcolor for example seems to
+        # output ESC + @ + \f for each page plus one
+        marker3 = "\033@\f"
+        pagecount3 = 0
+        
+        # while ghostscript's escp driver outputs instead
+        # \f + ESC + @
+        marker4 = "\f\033@"
+        pagecount4 = 0
+        
         for line in self.infile.xreadlines() : 
-            pagecount += line.count(marker)
-        return int(pagecount / 2)       
+            pagecount1 += line.count(marker1)
+            generic = line.count(marker2r)
+            if not generic :
+                generic = line.count(marker2rn)
+            pagecount2 += generic    
+            pagecount3 += line.count(marker3)
+            pagecount4 += line.count(marker4)
+            
+        if pagecount2 :    
+            return pagecount2
+        elif pagecount3 > 1 :     
+            return pagecount3 - 1
+        elif pagecount4 :    
+            return pagecount4
+        else :    
+            return int(pagecount1 / 2)       
+        
         
 class PCLAnalyzer :
@@ -613,4 +649,5 @@
             psyco.bind(PostScriptAnalyzer.getJobSize)
             psyco.bind(PDFAnalyzer.getJobSize)
+            psyco.bind(ESCP2Analyzer.getJobSize)
             psyco.bind(PCLAnalyzer.getJobSize)
             psyco.bind(PCLXLAnalyzer.getJobSize)
@@ -715,6 +752,6 @@
         """Returns 1 if data is ESC/P2, else 0."""
         if data.startswith("\033@") or \
+           data.startswith("\033*") or \
            data.startswith("\n\033@") :
-            #data.startswith("\033*") or 
             return 1
         else :    
Index: pykota/trunk/pykota/version.py
===================================================================
--- pykota/trunk/pykota/version.py (revision 1680)
+++ pykota/trunk/pykota/version.py (revision 1686)
@@ -22,5 +22,5 @@
 #
 
-__version__ = "1.20alpha3_unofficial"
+__version__ = "1.20alpha4_unofficial"
 
 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""
Index: pykota/trunk/NEWS
===================================================================
--- pykota/trunk/NEWS (revision 1683)
+++ pykota/trunk/NEWS (revision 1686)
@@ -22,4 +22,9 @@
 PyKota NEWS :
 
+    - 1.20alpha4 :
+    
+        - Added support for more ghostscript devices in ESC/P2
+          analyzer : stcolor, st800, escp, escpc are now supported.
+          
     - 1.20alpha3 :
        
