[Erp5-report] r38553 gabriel - in /erp5/trunk/utils/cloudooo/cloudooo: ./ application/ bin/

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Sep 22 17:48:26 CEST 2010


Author: gabriel
Date: Wed Sep 22 17:48:26 2010
New Revision: 38553

URL: http://svn.erp5.org?rev=38553&view=rev
Log:
- remove ooolib.py because the code was splited in unoconverter.py and unomimemapper.py. With this, the helper scripts don't have cloudooo as dependency.

Removed:
    erp5/trunk/utils/cloudooo/cloudooo/ooolib.py
Modified:
    erp5/trunk/utils/cloudooo/cloudooo/application/openoffice.py
    erp5/trunk/utils/cloudooo/cloudooo/bin/cloudooo_tester.py
    erp5/trunk/utils/cloudooo/cloudooo/utils.py

Modified: erp5/trunk/utils/cloudooo/cloudooo/application/openoffice.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/application/openoffice.py?rev=38553&r1=38552&r2=38553&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/application/openoffice.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/application/openoffice.py [utf8] Wed Sep 22 17:48:26 2010
@@ -30,7 +30,6 @@ from os import environ
 from os.path import exists, join
 from subprocess import Popen, PIPE
 from threading import Lock
-from cloudooo.ooolib import setUpUnoEnvironment
 from zope.interface import implements
 from application import Application
 from sys import executable as python_path
@@ -89,7 +88,6 @@ class OpenOffice(Application):
     uno_path -- Full path of the Uno Library
     """
     Application.loadSettings(self, hostname, port, path_run_dir, display_id)
-    setUpUnoEnvironment(uno_path, office_binary_path)
     self.office_binary_path = office_binary_path
     self.uno_path = uno_path
     self.process_name = "soffice.bin"

Modified: erp5/trunk/utils/cloudooo/cloudooo/bin/cloudooo_tester.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/bin/cloudooo_tester.py?rev=38553&r1=38552&r2=38553&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/bin/cloudooo_tester.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/bin/cloudooo_tester.py [utf8] Wed Sep 22 17:48:26 2010
@@ -5,7 +5,6 @@ import sys
 from base64 import encodestring
 from xmlrpclib import ServerProxy
 from getopt import getopt, GetoptError
-from cloudooo.utils import usage
 
 DOCUMENT_STRING = "MemoryMonitor - TimeoutMonitor - RequestMonitor\n\nOOHandler\n\nMimemapper\n\nERP5\n"
 HOSTNAME = PORT = None
@@ -44,7 +43,7 @@ def main():
     opt_list, arg_list = getopt(sys.argv[1:], "", 
                                 ["port=","hostname="])
   except GetoptError, e:
-    usage(sys.stderr, "%s \nUse --port and --hostname" % e)
+    print >> sys.stderr, "%s \nUse --port and --hostname" % e
     sys.exit(2)
   
   for opt, arg in opt_list:
@@ -54,7 +53,7 @@ def main():
       HOSTNAME = arg
   
   if not HOSTNAME and not PORT:
-    usage(sys.stderr, "Use --port and --hostname")
+    print >> sys.stderr, "Use --port and --hostname"
     sys.exit(2)
   suite = unittest.TestLoader().loadTestsFromTestCase(CloudoooTestCase)
   unittest.TextTestRunner(verbosity=2).run(suite)

Removed: erp5/trunk/utils/cloudooo/cloudooo/ooolib.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/ooolib.py?rev=38552&view=auto
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/ooolib.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/ooolib.py (removed)
@@ -1,110 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002-2010 Nexedi SA and Contributors. All Rights Reserved.
-#                    Gabriel M. Monnerat <gabriel at tiolive.com>
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsibility of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# guarantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# 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, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-##############################################################################
-
-from os import environ, putenv
-from sys import path
-from os.path import exists
-
-def setUpUnoEnvironment(uno_path=None, office_binary_path=None):
-  """Set up the environment to use the uno library and connect with the
-  openoffice by socket"""
-  if uno_path is not None:
-    environ['uno_path'] = uno_path
-  else:
-    uno_path = environ.get('uno_path')
-
-  if office_binary_path is not None:
-    environ['office_binary_path'] = office_binary_path
-  else:
-    office_binary_path = environ.get('office_binary_path')
-
-  # Add in sys.path the path of pyuno
-  if uno_path not in path:
-    path.append(uno_path)
-  fundamentalrc_file = '%s/fundamentalrc' % office_binary_path
-  if exists(fundamentalrc_file) and \
-       not environ.has_key('URE_BOOTSTRAP'):
-    putenv('URE_BOOTSTRAP','vnd.sun.star.pathname:%s' % fundamentalrc_file)
-
-def createProperty(name, value):
-  """Create property"""
-  setUpUnoEnvironment()
-  from com.sun.star.beans import PropertyValue
-  property = PropertyValue()
-  property.Name = name
-  property.Value = value
-  return property
-
-# XXX - method duplicated
-def createSpecificProperty(filter_name):
-  """Creates a property according to the filter"""
-  setUpUnoEnvironment()
-  import uno
-  from com.sun.star.beans import PropertyValue
-  if filter_name == "impress_html_Export":
-    property = PropertyValue('FilterData', 0, 
-                        uno.Any('[]com.sun.star.beans.PropertyValue',
-                        (PropertyValue('IsExportNotes', 0, True, 0),
-                        PropertyValue('Format', 0, 2, 0),),), 0)
-  elif filter_name == "impress_pdf_Export":
-    property = PropertyValue('FilterData', 0,
-                       uno.Any('[]com.sun.star.beans.PropertyValue',
-                       (PropertyValue('ExportNotesPages', 0, True, 0),),), 0)
-  elif filter_name in ("draw_html_Export", "HTML (StarCalc)"):
-    property = PropertyValue('FilterData', 0,
-                        uno.Any('[]com.sun.star.beans.PropertyValue',
-                                (PropertyValue('Format', 0, 2, 0),),), 0)
-  elif filter_name == "Text (encoded)":
-    property = PropertyValue('FilterFlags', 0, 'UTF8,LF', 0)
-  else:
-    return []
-
-  return [property,]
-
-def getServiceManager(host, port):
-  """Get the ServiceManager from the running OpenOffice.org."""
-  setUpUnoEnvironment()
-  import uno
-  # Get the uno component context from the PyUNO runtime
-  uno_context = uno.getComponentContext()
-  # Create the UnoUrlResolver on the Python side.
-  url_resolver = "com.sun.star.bridge.UnoUrlResolver"
-  resolver = uno_context.ServiceManager.createInstanceWithContext(url_resolver,
-      uno_context)
-  # Connect to the running OpenOffice.org and get its
-  # context.
-  uno_connection = resolver.resolve("uno:socket,host=%s,port=%s;urp;StarOffice.ComponentContext" % (host, port))
-  # Get the ServiceManager object
-  return uno_connection.ServiceManager
-
-def systemPathToFileUrl(path):
-  """Returns a path in uno library patterns"""
-  setUpUnoEnvironment()
-  from unohelper import systemPathToFileUrl
-  
-  return systemPathToFileUrl(path)

Modified: erp5/trunk/utils/cloudooo/cloudooo/utils.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/utils.py?rev=38553&r1=38552&r2=38553&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/utils.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/utils.py [utf8] Wed Sep 22 17:48:26 2010
@@ -67,11 +67,6 @@ def waitStopDaemon(daemon, attempts=5):
     if not daemon.status():
       break
 
-def usage(stream, msg=None):
-  """Print the message"""
-  if msg:
-    print >>stream,  msg
-
 def configureLogger(level=None, debug_mode=False):
   """Configure logger.
 




More information about the Erp5-report mailing list