[Erp5-report] r24113 - /erp5/trunk/utils/oood/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Oct 9 09:10:58 CEST 2008


Author: kazuhiko
Date: Thu Oct  9 09:10:56 2008
New Revision: 24113

URL: http://svn.erp5.org?rev=24113&view=rev
Log:
support OOo-3.0 (at least the official 3.0RC2 and Mandriva cooker's OOo
package).
* introduce prog_dir configuration in oood.conf (if missing, same as uno_path)
* define URE_BOOTSTRAP environment variable if missing.

Modified:
    erp5/trunk/utils/oood/config.py
    erp5/trunk/utils/oood/mimemapper.py
    erp5/trunk/utils/oood/oood.conf
    erp5/trunk/utils/oood/runserw.py
    erp5/trunk/utils/oood/start.py

Modified: erp5/trunk/utils/oood/config.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/config.py?rev=24113&r1=24112&r2=24113&view=diff
==============================================================================
--- erp5/trunk/utils/oood/config.py (original)
+++ erp5/trunk/utils/oood/config.py Thu Oct  9 09:10:56 2008
@@ -30,7 +30,7 @@
 
 import os
 import logging
-from ConfigParser import ConfigParser
+from ConfigParser import ConfigParser, NoOptionError
 
 WIN = False
 if os.name == 'nt':
@@ -52,6 +52,10 @@
 tmp_dir   = config.get('System', 'tmp_dir')
 uno_path  = config.get('System', 'uno_path')
 log_file  = config.get('System', 'log_file')
+try:
+  prog_dir = config.get('System', 'prog_dir')
+except NoOptionError:
+  prog_dir = uno_path
 
 if WIN:
   oood_home = oood_home.replace('\\', '/')
@@ -59,7 +63,7 @@
   tmp_dir = tmp_dir.replace('\\', '/')
   uno_path= uno_path.replace('\\', '/')
   log_file = log_file.replace('\\', '/')
-  
+  prog_dir = prog_dir.replace('\\', '/')
 
 debug_mode = config.getboolean('System', 'debug_mode')
 log_level = eval(config.get('System', 'log_level'))

Modified: erp5/trunk/utils/oood/mimemapper.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/mimemapper.py?rev=24113&r1=24112&r2=24113&view=diff
==============================================================================
--- erp5/trunk/utils/oood/mimemapper.py (original)
+++ erp5/trunk/utils/oood/mimemapper.py Thu Oct  9 09:10:56 2008
@@ -188,12 +188,6 @@
     filter_file_list = getFileList(filter_dir)
     type_file_list = getFileList(type_dir)
     if not filter_file_list or not type_file_list:
-      # for OOo 3.0
-      filter_dir = '%s/../../*/basis3.0/share/registry/modules/org/openoffice/TypeDetection/Filter' % config.uno_path
-      type_dir = '%s/../../*/basis3.0/share/registry/modules/org/openoffice/TypeDetection/Types' % config.uno_path
-      filter_file_list = getFileList(filter_dir)
-      type_file_list = getFileList(type_dir)
-    if not filter_file_list or not type_file_list:
       raise Exception('no OOo filter found.')
 
     def prop_by_name(node, name):

Modified: erp5/trunk/utils/oood/oood.conf
URL: http://svn.erp5.org/erp5/trunk/utils/oood/oood.conf?rev=24113&r1=24112&r2=24113&view=diff
==============================================================================
--- erp5/trunk/utils/oood/oood.conf (original)
+++ erp5/trunk/utils/oood/oood.conf Thu Oct  9 09:10:56 2008
@@ -37,7 +37,9 @@
 run_dir               = /var/run/oood
 tmp_dir               = /var/tmp/oood
 # Folder where OpenOffice Uno interpreter is installed
-uno_path              = /opt/openoffice.org2.1/program
+uno_path              = /opt/openoffice.org2.4/program
+# Folder where soffice is installed (default: uno_path)
+#prog_dir              = /opt/openoffice.org3/program
 # Complete absolute path to the log file
 log_file              = /var/log/oood/oood.log
 # debug_mode tells oood to leave files in tmp directory
@@ -66,8 +68,8 @@
 pool_host             = localhost
 # According www.iana.org/assignments/port-numbers , 4060-4088 port range is unassigned
 pool_port_range_start = 4060 
-# time in seconds we have to gave one OOo instance to load in restart
-instance_load_time    = 60
+# time in seconds we have to give one OOo instance to load in restart
+instance_load_time    = 20
 # seconds to wait before killing and restarting OOo instance
 instance_timeout      = 360
 # ID of the virtual display where OOo instances are launched

Modified: erp5/trunk/utils/oood/runserw.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/runserw.py?rev=24113&r1=24112&r2=24113&view=diff
==============================================================================
--- erp5/trunk/utils/oood/runserw.py (original)
+++ erp5/trunk/utils/oood/runserw.py Thu Oct  9 09:10:56 2008
@@ -38,6 +38,12 @@
 import base64
 from logger import Log
 
+# URE_BOOTSTRAP environment variable is required for OOo-3.0
+import config
+fundamentalrc_file = '%s/fundamentalrc' % config.prog_dir
+if os.path.exists(fundamentalrc_file) and \
+   not os.environ.has_key('URE_BOOTSTRAP'):
+  os.environ['URE_BOOTSTRAP'] = 'vnd.sun.star.pathname:%s' % fundamentalrc_file
 
 def showServerStatus():
   """

Modified: erp5/trunk/utils/oood/start.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/start.py?rev=24113&r1=24112&r2=24113&view=diff
==============================================================================
--- erp5/trunk/utils/oood/start.py (original)
+++ erp5/trunk/utils/oood/start.py Thu Oct  9 09:10:56 2008
@@ -78,7 +78,7 @@
     BIN = "soffice.exe"
   else:
     BIN = "soffice"
-  cmd = '%s/%s' % (config.uno_path, BIN)
+  cmd = '%s/%s' % (config.prog_dir, BIN)
   drive, tail = os.path.splitdrive(config.run_dir.strip('/'))
   run_dir = drive +  quote(tail)
   instance_dir = '/%s/oood_instance_%d' %(run_dir,i)




More information about the Erp5-report mailing list