[svn] r5421 - trunk/tools/unoconv

packagers at lists.rpmforge.net packagers at lists.rpmforge.net
Sat May 19 21:06:47 CEST 2007


Author: dag
Date: 2007-05-19 21:06:46 +0200 (Sat, 19 May 2007)
New Revision: 5421

Modified:
   trunk/tools/unoconv/ChangeLog
   trunk/tools/unoconv/Makefile
   trunk/tools/unoconv/README
   trunk/tools/unoconv/TODO
   trunk/tools/unoconv/unoconv
   trunk/tools/unoconv/unoconv.spec
Log:
Small improvements.

Modified: trunk/tools/unoconv/ChangeLog
===================================================================
--- trunk/tools/unoconv/ChangeLog	2007-05-19 18:13:51 UTC (rev 5420)
+++ trunk/tools/unoconv/ChangeLog	2007-05-19 19:06:46 UTC (rev 5421)
@@ -1,2 +1,2 @@
-* 0.1svn - ... - released 19/05/2007
+* 0.1 - released 19/05/2007
 - Initial release

Modified: trunk/tools/unoconv/Makefile
===================================================================
--- trunk/tools/unoconv/Makefile	2007-05-19 18:13:51 UTC (rev 5420)
+++ trunk/tools/unoconv/Makefile	2007-05-19 19:06:46 UTC (rev 5421)
@@ -19,7 +19,7 @@
 docs:
 	make -C docs
 
-dist:
+dist: clean
 	find . ! -path '*/.svn*' | pax -d -w -x ustar -s ',^.,$(name)-$(version),' | bzip2 >../$(name)-$(version).tar.bz2
 
 rpm: dist
@@ -30,3 +30,4 @@
 
 clean:
 	rm -f README*.html
+	make -C tests clean

Modified: trunk/tools/unoconv/README
===================================================================
--- trunk/tools/unoconv/README	2007-05-19 18:13:51 UTC (rev 5420)
+++ trunk/tools/unoconv/README	2007-05-19 19:06:46 UTC (rev 5421)
@@ -1,3 +1,13 @@
+unoconv converts any document format that OpenOffice can import, to any
+document format that OpenOffice can export.
 
+unoconv uses the OpenOffice's UNO bindings for non-interactive conversion
+of documents.
+
+Before using unoconv you need to start an OpenOffice instance that listens
+on a specific port by doing:
+
+    ooffice -headless "-accept=socket,host=localhost,port=2002;urp;"
+
 ---
 Please send me improvements to this document.

Modified: trunk/tools/unoconv/TODO
===================================================================
--- trunk/tools/unoconv/TODO	2007-05-19 18:13:51 UTC (rev 5420)
+++ trunk/tools/unoconv/TODO	2007-05-19 19:06:46 UTC (rev 5421)
@@ -14,5 +14,4 @@
 - Added support for spreadsheet, presentation and graphic formats
 
 ### Usability
-- Find a way to connect to OpenOffice without needing to start it
-- Start OpenOffice to assist conversion
+- Start OpenOffice automatically to assist conversion and then stop

Modified: trunk/tools/unoconv/unoconv
===================================================================
--- trunk/tools/unoconv/unoconv	2007-05-19 18:13:51 UTC (rev 5420)
+++ trunk/tools/unoconv/unoconv	2007-05-19 19:06:46 UTC (rev 5421)
@@ -38,7 +38,7 @@
 __version__ = "$Revision$"
 # $Source$
 
-VERSION = '0.1svn'
+VERSION = '0.1'
 
 class Fmt:
     def __init__(self, name, extension, filter, summary):
@@ -170,6 +170,7 @@
     sys.exit(1)
 
 rc = 0
+doc = None
 
 try:
     context = uno.getComponentContext()
@@ -182,7 +183,7 @@
     desktop = unosvcmgr.createInstanceWithContext("com.sun.star.frame.Desktop", unocontext)
     cwd = unohelper.systemPathToFileUrl( os.getcwd() )
 
-    inProps = PropertyValue( "Hidden" , 0 , True, 0 ),
+    inProps = PropertyValue( "Hidden" , 0 , True, 0 )
     outProps = (
                 PropertyValue( "FilterName" , 0, outputfmt.filter , 0 ),
                 PropertyValue( "Overwrite" , 0, True , 0 ),
@@ -191,7 +192,7 @@
     
     for path in args:
         try:
-            doc = None
+
             filename = unohelper.absolutize(cwd, unohelper.systemPathToFileUrl(path))
             doc = desktop.loadComponentFromURL( filename , "_blank", 0, inProps )
     
@@ -200,9 +201,9 @@
     
             if not stdout:
                 (dest, ext) = os.path.splitext(path)
-                dest = dest + "." + outputfmt.extension
+                dest = dest + '.' + outputfmt.extension
                 destUrl = unohelper.absolutize( cwd, unohelper.systemPathToFileUrl(dest) )
-                sys.stderr.write(destUrl + "\n")
+                print >>sys.stderr, destUrl
                 doc.storeToURL(destUrl, outProps)
             else:
                 doc.storeToURL("private:stream", outProps)
@@ -218,7 +219,7 @@
  
 except NoConnectException, e:
     print >>sys.stderr, "Error: Could not find an existing connection to Open Office at %s:%s." % (server, port)
-    print >>sys.stderr, "Please start an oowriter instance by doing:\n    oowriter \"-accept=socket,host=%s,port=%s;urp;\"" % (server, port)
+    print >>sys.stderr, "Please start an ooffice instance by doing:\n    ooffice -headless -accept=\"socket,host=%s,port=%s;urp;\"" % (server, port)
     sys.exit(1)
 
 except UnoException, e:

Modified: trunk/tools/unoconv/unoconv.spec
===================================================================
--- trunk/tools/unoconv/unoconv.spec	2007-05-19 18:13:51 UTC (rev 5420)
+++ trunk/tools/unoconv/unoconv.spec	2007-05-19 19:06:46 UTC (rev 5421)
@@ -18,14 +18,14 @@
 
 BuildArch: noarch
 BuildRequires: python >= 2.0
-Requires: python >= 2.0, openoffice-core, openoffic-pyuno
+Requires: python >= 2.0, openoffice.org-core, openoffice.org-pyuno
 
 %description
 unoconv converts any document format that OpenOffice can import, to any
 document format that OpenOffice can export.
 
 unoconv uses the OpenOffice's UNO bindings for non-interactive conversion
-of documents
+of documents.
 
 %prep
 %setup
@@ -41,7 +41,7 @@
 
 %files
 %defattr(-, root, root, 0755)
-%doc AUTHORS ChangeLog COPYING README TODO WISHLIST
+%doc AUTHORS ChangeLog COPYING README TODO WISHLIST docs/ tests/
 %{_bindir}/unoconv
 
 %changelog




More information about the commits mailing list