[Checkins] SVN: zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/cli.py logging improvements, cleanup

Andreas Jung andreas at andreas-jung.com
Sun Jul 5 11:42:40 EDT 2009


Log message for revision 101591:
  logging improvements, cleanup
  

Changed:
  U   zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/cli.py

-=-
Modified: zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/cli.py
===================================================================
--- zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/cli.py	2009-07-05 15:34:05 UTC (rev 101590)
+++ zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/cli.py	2009-07-05 15:42:40 UTC (rev 101591)
@@ -16,18 +16,12 @@
 class Server(xmlrpc.XMLRPC):
     """ SmartPrintNG Server """
 
-    rxcountpages = re.compile(r"$\s*/Type\s*/Page[/\s]", re.MULTILINE|re.DOTALL)
-
-    def _countPages(self, filename):
-        data = file(filename,"rb").read()
-        return len(self.rxcountpages.findall(data))
-
     def xmlrpc_convertZIP(self, zip_archive, converter_name='pdf-prince'):
         """ Process html-file + images within a ZIP archive """
 
         def _convertZIP(zip_archive, converter_name):
 
-            LOG.debug('Incoming request (%s, %d)' % (converter_name, len(zip_archive)))
+            LOG.debug('Incoming request (%s, %d bytes)' % (converter_name, len(zip_archive)))
             ts = time.time()
             # store zip archive first
             tempdir = tempfile.mkdtemp()
@@ -50,7 +44,6 @@
             html_filename = html_files[0]
             result = self.convert(html_filename, 
                                   converter_name=converter_name)
-
             basename, ext =  os.path.splitext(os.path.basename(result))
 
             # Generate result ZIP archive with base64-encoded result
@@ -60,7 +53,7 @@
             ZF.close()
             encoded_result = base64.encodestring(file(zip_out, 'rb').read())
             shutil.rmtree(tempdir)
-            LOG.debug('request end (%3.2lf seconds)' % (time.time() -ts))
+            LOG.debug('Request end (%3.2lf seconds)' % (time.time() -ts))
             return encoded_result
 
         try:



More information about the Checkins mailing list