[svn] r5617 - trunk/tools/unoconv

packagers at lists.rpmforge.net packagers at lists.rpmforge.net
Wed Jul 18 13:06:40 CEST 2007


Author: dag
Date: 2007-07-18 13:06:11 +0200 (Wed, 18 Jul 2007)
New Revision: 5617

Modified:
   trunk/tools/unoconv/ChangeLog
   trunk/tools/unoconv/README
   trunk/tools/unoconv/unoconv
Log:
Added OpenSUSE 10 OpenOffice path /usr/lib*/ooo*/program/ (Leo Eraly)

Modified: trunk/tools/unoconv/ChangeLog
===================================================================
--- trunk/tools/unoconv/ChangeLog	2007-07-18 06:38:31 UTC (rev 5616)
+++ trunk/tools/unoconv/ChangeLog	2007-07-18 11:06:11 UTC (rev 5617)
@@ -3,6 +3,7 @@
 - Created a seperate class and allow to use as a library (like DocumentConverter.py)
 - Makefile now adds symlinks for different ODF formats like eg, odt2pdf or odp2pdf
 - Added MacOSX NeoOffice path '/Applications/NeoOffice.app/Contents/program/' (Peter Stevens)
+- Added OpenSUSE 10 OpenOffice path '/usr/lib*/ooo*/program/' (Leo Eraly)
 
 * 0.2 - released 20/05/2007
 - Added support for almost 100 graphics, presentation and spreadsheet documents

Modified: trunk/tools/unoconv/README
===================================================================
--- trunk/tools/unoconv/README	2007-07-18 06:38:31 UTC (rev 5616)
+++ trunk/tools/unoconv/README	2007-07-18 11:06:11 UTC (rev 5617)
@@ -23,6 +23,7 @@
 
  + Another python tool to aid in converting files using UNO
    http://www.artofsolving.com/files/DocumentConverter.py
+   http://www.artofsolving.com/opensource/pyodconverter
 
 ---
 Please send me improvements to this document.

Modified: trunk/tools/unoconv/unoconv
===================================================================
--- trunk/tools/unoconv/unoconv	2007-07-18 06:38:31 UTC (rev 5616)
+++ trunk/tools/unoconv/unoconv	2007-07-18 11:06:11 UTC (rev 5617)
@@ -16,21 +16,21 @@
 
 import getopt, sys, os, glob
 
-try:
-    import uno
-except:
-#    extrapaths = ('/usr/lib/openoffice/program/', '/usr/lib/openoffice.org2.0/program/')
-    extrapaths = glob.glob('/usr/lib*/openoffice*/program/') + [ '/Applications/NeoOffice.app/Contents/program', ]
-    for path in extrapaths:
-        if os.path.isfile(os.path.join(path, 'pyuno.so')):
-            sys.path.append(path)
-            break
-    else:
-        print >>sys.stderr, "unoconv: Cannot find the pyuno.so library in sys.path."
-        print >>sys.stderr, "Please locate this library and send feedback to <tools at lists.rpmforge.net>."
-        sys.exit(1)
+#extrapaths = ('/usr/lib/openoffice/program/', '/usr/lib/openoffice.org2.0/program/')
+extrapaths = glob.glob('/usr/lib*/openoffice*/program/') + glob.glob('/usr/lib*/ooo*/program') + [ '/Applications/NeoOffice.app/Contents/program', ]
+for path in extrapaths:
+    try:
+        sys.path.append(path)
+        import uno, unohelper
+        break
+    except:
+        sys.path.remove(path)
+        continue
+else:
+    print >>sys.stderr, "unoconv: Cannot find the pyuno.so library in sys.path and known paths."
+    print >>sys.stderr, "Please locate this library and send your feedback to <tools at lists.rpmforge.net>."
+    sys.exit(1)
 
-import uno, unohelper
 from com.sun.star.beans import PropertyValue
 from com.sun.star.connection import NoConnectException
 from com.sun.star.io import IOException, XOutputStream




More information about the commits mailing list