[Erp5-report] r13668 - in /erp5/trunk/utils/oood: config.py lib.py serw.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Mar 26 17:19:00 CEST 2007


Author: bartek
Date: Mon Mar 26 17:18:58 2007
New Revision: 13668

URL: http://svn.erp5.org?rev=13668&view=rev
Log:
moved asciify  to lib as library function
added a debug_mode flag to config
dont' remove temp files if in debug mode

Modified:
    erp5/trunk/utils/oood/config.py
    erp5/trunk/utils/oood/lib.py
    erp5/trunk/utils/oood/serw.py

Modified: erp5/trunk/utils/oood/config.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/config.py?rev=13668&r1=13667&r2=13668&view=diff
==============================================================================
--- erp5/trunk/utils/oood/config.py (original)
+++ erp5/trunk/utils/oood/config.py Mon Mar 26 17:18:58 2007
@@ -36,6 +36,8 @@
 uno_path  = '/opt/openoffice.org2.0/program'  # Folder where OpenOffice Uno interpreter is installed
 log_file  = '/var/log/oood/oood.log'          # Complete absolute path to the log file
 
+debug_mode = False
+
 
 ###################################################################
 # Server settings

Modified: erp5/trunk/utils/oood/lib.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/lib.py?rev=13668&r1=13667&r2=13668&view=diff
==============================================================================
--- erp5/trunk/utils/oood/lib.py (original)
+++ erp5/trunk/utils/oood/lib.py Mon Mar 26 17:18:58 2007
@@ -29,12 +29,24 @@
 
 import threading
 import time
+import string
 import sys
 
 # Ad-hoc patch. Should be more generic
 sys.path.append('/etc/oood/')
 
 import config
+
+nulltrans = string.maketrans('', '')
+remother = nulltrans.translate(nulltrans, string.letters)
+
+
+def asciify(s):
+  """
+    for clearing chars out of filenames
+  """
+  return s.translate(nulltrans, remother)
+
 
 class WorkerException(Exception):pass
 class IllegalMimeType(WorkerException):pass

Modified: erp5/trunk/utils/oood/serw.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/serw.py?rev=13668&r1=13667&r2=13668&view=diff
==============================================================================
--- erp5/trunk/utils/oood/serw.py (original)
+++ erp5/trunk/utils/oood/serw.py Mon Mar 26 17:18:58 2007
@@ -32,7 +32,6 @@
 sys.path.append('/etc/oood/')
 
 import base64
-import config
 import cStringIO
 import glob
 import os
@@ -50,13 +49,12 @@
 from SimpleXMLRPCServer import *
 from SocketServer import ThreadingMixIn
 
+import config
 import lib
 import pool
 
 from com.sun.star.uno import RuntimeException as unoRuntimeException
 
-nulltrans = string.maketrans('', '')
-remother = nulltrans.translate(nulltrans, string.letters)
 
 class MySerw(ThreadingMixIn, SimpleXMLRPCServer):
 
@@ -82,10 +80,7 @@
       setattr(self, 'run_' + f, self._wrap(f))
 
   def _asciify(self, s):
-    """
-      for clearing chars out of filenames
-    """
-    return s.translate(nulltrans, remother)
+    return lib.asciify(s)
 
   def _mkName(self, fname):
     """
@@ -159,7 +154,8 @@
     pth = os.path.join(config.oood_home, 'tmp', os.path.basename(filename))
     for f in glob.glob(pth + '*'):
       lib.log('removing %s' % f)
-      os.remove(self._mkName(f))
+      if not config.debug_mode:
+        os.remove(self._mkName(f))
       any = True
     if not any:
       lib.log('no file beginning with %s' % filename, 1)




More information about the Erp5-report mailing list