Compare commits
38 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8dcec8459d | ||
|
|
b06dc5d6b2 | ||
|
|
880a421ce2 | ||
|
|
bc3a714e26 | ||
|
|
a82df2df5a | ||
|
|
21ce03b740 | ||
|
|
4e42a77785 | ||
|
|
6de094c519 | ||
|
|
89d9cb7460 | ||
|
|
30266292fa | ||
|
|
e4d96466c9 | ||
|
|
5a556492d0 | ||
|
|
c31a44baae | ||
|
|
f0c29806cb | ||
|
|
ed579deeb7 | ||
|
|
304426b252 | ||
|
|
21f8cf544b | ||
|
|
ae2d607aeb | ||
|
|
79badfe66d | ||
|
|
a407717de7 | ||
|
|
48d4749f2b | ||
|
|
940ac0994f | ||
|
|
588fa43bcf | ||
|
|
8e71bd8471 | ||
|
|
2d7afba06a | ||
|
|
2e06fda8a3 | ||
|
|
46fe13c0a9 | ||
|
|
935281c71a | ||
|
|
242c6006e0 | ||
|
|
124a40caba | ||
|
|
2e6dcbdfce | ||
|
|
555bdde264 | ||
|
|
6112c6791a | ||
|
|
79883f8c2e | ||
|
|
cc7f259794 | ||
|
|
7dd2537c94 | ||
|
|
d1934682f1 | ||
|
|
14c3386a47 |
12 changed files with 232 additions and 1186 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -2,3 +2,7 @@ unoconv-0.3.tar.bz2
|
|||
/unoconv-0.4.tar.bz2
|
||||
/unoconv-0.5.tar.bz2
|
||||
/unoconv-0.6.tar.gz
|
||||
/unoconv-0.7.tar.gz
|
||||
/0.8.2.tar.gz
|
||||
/0.9.tar.gz
|
||||
/0.9.0.tar.gz
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
From 3c20d6ec49a97c24cfb1fe9fd61ac80944819088 Mon Sep 17 00:00:00 2001
|
||||
From: Dag Wieers <dag@wieers.com>
|
||||
Date: Fri, 28 Sep 2012 19:33:01 +0200
|
||||
Subject: [PATCH] Fix a broken --export option and add -V as alternative to
|
||||
--version
|
||||
|
||||
This closes #93.
|
||||
---
|
||||
unoconv | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/unoconv b/unoconv
|
||||
index 972e962..30e6706 100755
|
||||
--- a/unoconv
|
||||
+++ b/unoconv
|
||||
@@ -524,8 +524,8 @@ class Options:
|
||||
|
||||
### Get options from the commandline
|
||||
try:
|
||||
- opts, args = getopt.getopt (args, 'c:Dd:e:f:hi:Llo:np:s:T:t:v',
|
||||
- ['connection=', 'debug', 'doctype=', 'export', 'format=',
|
||||
+ opts, args = getopt.getopt (args, 'c:Dd:e:f:hi:Llo:np:s:T:t:vV',
|
||||
+ ['connection=', 'debug', 'doctype=', 'export=', 'format=',
|
||||
'help', 'import', 'listener', 'no-launch', 'output=',
|
||||
'outputpath', 'password=', 'pipe=', 'port=', 'server=',
|
||||
'timeout=', 'show', 'stdout', 'template', 'verbose',
|
||||
@@ -609,7 +609,7 @@ class Options:
|
||||
self.timeout = int(arg)
|
||||
elif opt in ['-v', '--verbose']:
|
||||
self.verbose = self.verbose + 1
|
||||
- elif opt in ['--version']:
|
||||
+ elif opt in ['-V', '--version']:
|
||||
self.version()
|
||||
sys.exit(255)
|
||||
|
||||
--
|
||||
1.7.11.7
|
||||
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
From 3249fd3df136f1a859ac0272f75fcbf010926d58 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
Date: Thu, 7 Nov 2013 13:33:37 +0000
|
||||
Subject: [PATCH] Resolves: fdo#70309 can't write bytes direct to stdout in
|
||||
python3
|
||||
|
||||
---
|
||||
unoconv | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/unoconv b/unoconv
|
||||
index a4f9490..2b0b0eb 100755
|
||||
--- a/unoconv
|
||||
+++ b/unoconv
|
||||
@@ -1146,7 +1146,7 @@ if __name__ == '__main__':
|
||||
self.closed = 1
|
||||
|
||||
def writeBytes( self, seq ):
|
||||
- sys.stdout.write( seq.value )
|
||||
+ sys.stdout.buffer.write( seq.value )
|
||||
|
||||
def flush( self ):
|
||||
pass
|
||||
--
|
||||
1.8.5.3
|
||||
|
||||
24
0001-libreoffice-or-OO.o-has-never-had-wps-export.patch
Normal file
24
0001-libreoffice-or-OO.o-has-never-had-wps-export.patch
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
From aa46d3cbcec14ae46a176165852089558c524ff2 Mon Sep 17 00:00:00 2001
|
||||
From: David Tardon <dtardon@redhat.com>
|
||||
Date: Fri, 10 Jul 2015 12:55:13 +0200
|
||||
Subject: [PATCH] libreoffice (or OO.o) has never had wps export
|
||||
|
||||
---
|
||||
unoconv | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/unoconv b/unoconv
|
||||
index 2e56d3c..1158374 100755
|
||||
--- a/unoconv
|
||||
+++ b/unoconv
|
||||
@@ -377,7 +377,6 @@ fmts.add('document', 'uot', 'uot', 'Unified Office Format text','UOF text') ###
|
||||
fmts.add('document', 'vor', 'vor', 'StarWriter 5.0 Template', 'StarWriter 5.0 Vorlage/Template') ### 6
|
||||
fmts.add('document', 'vor4', 'vor', 'StarWriter 4.0 Template', 'StarWriter 4.0 Vorlage/Template') ### 5
|
||||
fmts.add('document', 'vor3', 'vor', 'StarWriter 3.0 Template', 'StarWriter 3.0 Vorlage/Template') ### 4
|
||||
-fmts.add('document', 'wps', 'wps', 'Microsoft Works', 'MS_Works')
|
||||
fmts.add('document', 'xhtml', 'html', 'XHTML Document', 'XHTML Writer File') ### 33
|
||||
fmts.add('document', 'epub', 'epub', 'Electronic Publication', 'EPUB')
|
||||
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,384 +0,0 @@
|
|||
From 34bbe9fa679d39921fd67002e01e7a9bf93b009a Mon Sep 17 00:00:00 2001
|
||||
From: rpm-build <rpm-build>
|
||||
Date: Sat, 19 Apr 2014 12:05:04 +0200
|
||||
Subject: [PATCH] 0001-python3-added-compatibility.2.patch
|
||||
|
||||
---
|
||||
unoconv | 142 +++++++++++++++++++++++++++++++++++++++-------------------------
|
||||
1 file changed, 86 insertions(+), 56 deletions(-)
|
||||
|
||||
diff --git a/unoconv b/unoconv
|
||||
index 30e6706..8c45ad9 100755
|
||||
--- a/unoconv
|
||||
+++ b/unoconv
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/env python
|
||||
+#!/usr/bin/python
|
||||
|
||||
### 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
|
||||
@@ -203,7 +203,7 @@ def office_environ(office):
|
||||
### Set UNO_PATH so that "officehelper.bootstrap()" can find soffice executable:
|
||||
os.environ['UNO_PATH'] = office.unopath
|
||||
|
||||
- ### Set URE_BOOTSTRAP so that "uno.getComponentContext()" bootstraps a complete
|
||||
+ ### Set URE_BOOTSTRAP so that "global_uno.getComponentContext()" bootstraps a complete
|
||||
### UNO environment
|
||||
if os.name in ( 'nt', 'os2' ):
|
||||
os.environ['URE_BOOTSTRAP'] = 'vnd.sun.star.pathname:' + realpath(office.basepath, 'program', 'fundamental.ini')
|
||||
@@ -277,6 +277,7 @@ def python_switch(office):
|
||||
|
||||
try:
|
||||
os.execvpe(office.python, [office.python, ] + sys.argv[0:], os.environ)
|
||||
+ print(office.python, [office.python, ] + sys.argv[0:], osenviron)
|
||||
except OSError:
|
||||
### Mac OS X versions prior to 10.6 do not support execv in
|
||||
### a process that contains multiple threads. Instead of
|
||||
@@ -553,14 +554,14 @@ class Options:
|
||||
if name in ('FilterOptions'):
|
||||
self.exportfilteroptions = value
|
||||
elif value in ('True', 'true'):
|
||||
- self.exportfilter.append( PropertyValue( name, 0, True, 0 ) )
|
||||
+ self.exportfilter.append( UnoPropertyValue( name, 0, True, 0 ) )
|
||||
elif value in ('False', 'false'):
|
||||
- self.exportfilter.append( PropertyValue( name, 0, False, 0 ) )
|
||||
+ self.exportfilter.append( UnoPropertyValue( name, 0, False, 0 ) )
|
||||
else:
|
||||
try:
|
||||
- self.exportfilter.append( PropertyValue( name, 0, int(value), 0 ) )
|
||||
+ self.exportfilter.append( UnoPropertyValue( name, 0, int(value), 0 ) )
|
||||
except ValueError:
|
||||
- self.exportfilter.append( PropertyValue( name, 0, value, 0 ) )
|
||||
+ self.exportfilter.append( UnoPropertyValue( name, 0, value, 0 ) )
|
||||
else:
|
||||
print >>sys.stderr, 'Warning: Option %s cannot be parsed, ignoring.' % arg
|
||||
elif opt in ['-f', '--format']:
|
||||
@@ -572,14 +573,14 @@ class Options:
|
||||
if name in ('FilterOptions'):
|
||||
self.importfilteroptions = value
|
||||
elif value in ('True', 'true'):
|
||||
- self.importfilter.append( PropertyValue( name, 0, True, 0 ) )
|
||||
+ self.importfilter.append( UnoPropertyValue( name, 0, True, 0 ) )
|
||||
elif value in ('False', 'false'):
|
||||
- self.importfilter.append( PropertyValue( name, 0, False, 0 ) )
|
||||
+ self.importfilter.append( UnoPropertyValue( name, 0, False, 0 ) )
|
||||
else:
|
||||
try:
|
||||
- self.importfilter.append( PropertyValue( name, 0, int(value), 0 ) )
|
||||
+ self.importfilter.append( UnoPropertyValue( name, 0, int(value), 0 ) )
|
||||
except ValueError:
|
||||
- self.importfilter.append( PropertyValue( name, 0, value, 0 ) )
|
||||
+ self.importfilter.append( UnoPropertyValue( name, 0, value, 0 ) )
|
||||
else:
|
||||
print >>sys.stderr, 'Warning: Option %s cannot be parsed, ignoring.' % arg
|
||||
elif opt in ['-l', '--listener']:
|
||||
@@ -657,7 +658,7 @@ class Options:
|
||||
|
||||
def version(self):
|
||||
### Get office product information
|
||||
- product = uno.getComponentContext().ServiceManager.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product"))
|
||||
+ product = global_uno.getComponentContext().ServiceManager.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", GlobalUnoProps(nodepath="/org.openoffice.Setup/Product"))
|
||||
|
||||
print 'unoconv %s' % VERSION
|
||||
print 'Written by Dag Wieers <dag@wieers.com>'
|
||||
@@ -706,7 +707,7 @@ class Convertor:
|
||||
unocontext = None
|
||||
|
||||
### Do the LibreOffice component dance
|
||||
- self.context = uno.getComponentContext()
|
||||
+ self.context = global_uno.getComponentContext()
|
||||
self.svcmgr = self.context.ServiceManager
|
||||
resolver = self.svcmgr.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", self.context)
|
||||
|
||||
@@ -714,7 +715,7 @@ class Convertor:
|
||||
info(3, 'Connection type: %s' % op.connection)
|
||||
try:
|
||||
unocontext = resolver.resolve("uno:%s" % op.connection)
|
||||
- except NoConnectException, e:
|
||||
+ except UnoNoConnectException, e:
|
||||
# info(3, "Existing listener not found.\n%s" % e)
|
||||
info(3, "Existing listener not found.")
|
||||
|
||||
@@ -724,7 +725,7 @@ class Convertor:
|
||||
### Start our own OpenOffice instance
|
||||
info(3, "Launching our own listener using %s." % office.binary)
|
||||
try:
|
||||
- product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product"))
|
||||
+ product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", GlobalUnoProps(nodepath="/org.openoffice.Setup/Product"))
|
||||
if product.ooName != "LibreOffice" or LooseVersion(product.ooSetupVersion) <= LooseVersion('3.3'):
|
||||
ooproc = subprocess.Popen([office.binary, "-headless", "-invisible", "-nocrashreport", "-nodefault", "-nofirststartwizard", "-nologo", "-norestore", "-accept=%s" % op.connection], env=os.environ)
|
||||
else:
|
||||
@@ -742,7 +743,7 @@ class Convertor:
|
||||
try:
|
||||
unocontext = resolver.resolve("uno:%s" % op.connection)
|
||||
break
|
||||
- except NoConnectException:
|
||||
+ except UnoNoConnectException:
|
||||
time.sleep(0.5)
|
||||
timeout += 0.5
|
||||
except:
|
||||
@@ -759,7 +760,7 @@ class Convertor:
|
||||
### And some more LibreOffice magic
|
||||
unosvcmgr = unocontext.ServiceManager
|
||||
self.desktop = unosvcmgr.createInstanceWithContext("com.sun.star.frame.Desktop", unocontext)
|
||||
- self.cwd = unohelper.systemPathToFileUrl( os.getcwd() )
|
||||
+ self.cwd = global_unohelper.systemPathToFileUrl( os.getcwd() )
|
||||
|
||||
### List all filters
|
||||
# self.filters = unosvcmgr.createInstanceWithContext( "com.sun.star.document.FilterFactory", unocontext)
|
||||
@@ -824,22 +825,22 @@ class Convertor:
|
||||
phase = "import"
|
||||
|
||||
### Load inputfile
|
||||
- inputprops = UnoProps(Hidden=True, ReadOnly=True, UpdateDocMode=QUIET_UPDATE)
|
||||
+ inputprops = GlobalUnoProps(Hidden=True, ReadOnly=True, UpdateDocMode=UNO_QUIET_UPDATE)
|
||||
|
||||
# if op.password:
|
||||
-# info = UnoProps(algorithm-name="PBKDF2", salt="salt", iteration-count=1024, hash="hash")
|
||||
-# inputprops += UnoProps(ModifyPasswordInfo=info)
|
||||
+# info = GlobalUnoProps(algorithm-name="PBKDF2", salt="salt", iteration-count=1024, hash="hash")
|
||||
+# inputprops += GlobalUnoProps(ModifyPasswordInfo=info)
|
||||
|
||||
- ### Cannot use UnoProps for FilterData property
|
||||
+ ### Cannot use GlobalUnoProps for FilterData property
|
||||
if op.importfilteroptions:
|
||||
# print "Import filter options: %s" % op.importfilteroptions
|
||||
- inputprops += UnoProps(FilterOptions=op.importfilteroptions)
|
||||
+ inputprops += GlobalUnoProps(FilterOptions=op.importfilteroptions)
|
||||
|
||||
- ### Cannot use UnoProps for FilterData property
|
||||
+ ### Cannot use GlobalUnoProps for FilterData property
|
||||
if op.importfilter:
|
||||
- inputprops += ( PropertyValue( "FilterData", 0, uno.Any("[]com.sun.star.beans.PropertyValue", tuple( op.importfilter ), ), 0 ), )
|
||||
+ inputprops += ( UnoPropertyValue( "FilterData", 0, global_uno.Any("[]com.sun.star.beans.PropertyValue", tuple( op.importfilter ), ), 0 ), )
|
||||
|
||||
- inputurl = unohelper.absolutize(self.cwd, unohelper.systemPathToFileUrl(inputfn))
|
||||
+ inputurl = global_unohelper.absolutize(self.cwd, global_unohelper.systemPathToFileUrl(inputfn))
|
||||
document = self.desktop.loadComponentFromURL( inputurl , "_blank", 0, inputprops )
|
||||
|
||||
if not document:
|
||||
@@ -850,8 +851,8 @@ class Convertor:
|
||||
if op.template:
|
||||
if os.path.exists(op.template):
|
||||
info(1, "Template file: %s" % op.template)
|
||||
- templateprops = UnoProps(OverwriteStyles=True)
|
||||
- templateurl = unohelper.absolutize(self.cwd, unohelper.systemPathToFileUrl(op.template))
|
||||
+ templateprops = GlobalUnoProps(OverwriteStyles=True)
|
||||
+ templateurl = global_unohelper.absolutize(self.cwd, global_unohelper.systemPathToFileUrl(op.template))
|
||||
document.StyleFamilies.loadStylesFromURL(templateurl, templateprops)
|
||||
else:
|
||||
print >>sys.stderr, 'unoconv: template file `%s\' does not exist.' % op.template
|
||||
@@ -885,26 +886,26 @@ class Convertor:
|
||||
### Export phase
|
||||
phase = "export"
|
||||
|
||||
- outputprops = UnoProps(FilterName=outputfmt.filter, OutputStream=OutputStream(), Overwrite=True)
|
||||
+ outputprops = GlobalUnoProps(FilterName=outputfmt.filter, OutputStream=GlobalOutputStream(), Overwrite=True)
|
||||
|
||||
### Set default filter options
|
||||
if op.exportfilteroptions:
|
||||
# print "Export filter options: %s" % op.exportfilteroptions
|
||||
- outputprops += UnoProps(FilterOptions=op.exportfilteroptions)
|
||||
+ outputprops += GlobalUnoProps(FilterOptions=op.exportfilteroptions)
|
||||
else:
|
||||
if outputfmt.filter == 'Text (encoded)':
|
||||
- outputprops += UnoProps(FilterOptions="76,LF")
|
||||
+ outputprops += GlobalUnoProps(FilterOptions="76,LF")
|
||||
|
||||
elif outputfmt.filter == 'Text':
|
||||
- outputprops += UnoProps(FilterOptions="76")
|
||||
+ outputprops += GlobalUnoProps(FilterOptions="76")
|
||||
|
||||
elif outputfmt.filter == 'Text - txt - csv (StarCalc)':
|
||||
- outputprops += UnoProps(FilterOptions="44,34,76")
|
||||
+ outputprops += GlobalUnoProps(FilterOptions="44,34,76")
|
||||
|
||||
|
||||
- ### Cannot use UnoProps for FilterData property
|
||||
+ ### Cannot use GlobalUnoProps for FilterData property
|
||||
if op.exportfilter:
|
||||
- outputprops += ( PropertyValue( "FilterData", 0, uno.Any("[]com.sun.star.beans.PropertyValue", tuple( op.exportfilter ), ), 0 ), )
|
||||
+ outputprops += ( UnoPropertyValue( "FilterData", 0, global_uno.Any("[]com.sun.star.beans.PropertyValue", tuple( op.exportfilter ), ), 0 ), )
|
||||
|
||||
if not op.stdout:
|
||||
(outputfn, ext) = os.path.splitext(inputfn)
|
||||
@@ -917,14 +918,14 @@ class Convertor:
|
||||
else:
|
||||
outputfn = op.output
|
||||
|
||||
- outputurl = unohelper.absolutize( self.cwd, unohelper.systemPathToFileUrl(outputfn) )
|
||||
+ outputurl = global_unohelper.absolutize( self.cwd, global_unohelper.systemPathToFileUrl(outputfn) )
|
||||
info(1, "Output file: %s" % outputfn)
|
||||
else:
|
||||
outputurl = "private:stream"
|
||||
|
||||
try:
|
||||
document.storeToURL(outputurl, tuple(outputprops) )
|
||||
- except IOException, e:
|
||||
+ except UnoIOException, e:
|
||||
raise UnoException("Unable to store document to %s (ErrCode %d)\n\nProperties: %s" % (outputurl, e.ErrCode, outputprops), None)
|
||||
|
||||
phase = "dispose"
|
||||
@@ -935,24 +936,24 @@ class Convertor:
|
||||
error("unoconv: SystemError during %s phase:\n%s" % (phase, e))
|
||||
exitcode = 1
|
||||
|
||||
- except RuntimeException, e:
|
||||
+ except UnoRuntimeException, e:
|
||||
error("unoconv: RuntimeException during %s phase:\nOffice probably died. %s" % (phase, e))
|
||||
exitcode = 6
|
||||
|
||||
- except DisposedException, e:
|
||||
+ except UnoDisposedException, e:
|
||||
error("unoconv: DisposedException during %s phase:\nOffice probably died. %s" % (phase, e))
|
||||
exitcode = 7
|
||||
|
||||
- except IllegalArgumentException, e:
|
||||
+ except UnoIllegalArgumentException, e:
|
||||
error("UNO IllegalArgument during %s phase:\nSource file cannot be read. %s" % (phase, e))
|
||||
exitcode = 8
|
||||
|
||||
- except IOException, e:
|
||||
+ except UnoIOException, e:
|
||||
# for attr in dir(e): print '%s: %s', (attr, getattr(e, attr))
|
||||
error("unoconv: IOException during %s phase:\n%s" % (phase, e.Message))
|
||||
exitcode = 3
|
||||
|
||||
- except CannotConvertException, e:
|
||||
+ except UnoCannotConvertException, e:
|
||||
# for attr in dir(e): print '%s: %s', (attr, getattr(e, attr))
|
||||
error("unoconv: CannotConvertException during %s phase:\n%s" % (phase, e.Message))
|
||||
exitcode = 4
|
||||
@@ -975,14 +976,14 @@ class Listener:
|
||||
global product
|
||||
|
||||
info(1, "Start listener on %s:%s" % (op.server, op.port))
|
||||
- self.context = uno.getComponentContext()
|
||||
+ self.context = global_uno.getComponentContext()
|
||||
self.svcmgr = self.context.ServiceManager
|
||||
try:
|
||||
resolver = self.svcmgr.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", self.context)
|
||||
- product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product"))
|
||||
+ product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", GlobalUnoProps(nodepath="/org.openoffice.Setup/Product"))
|
||||
try:
|
||||
unocontext = resolver.resolve("uno:%s" % op.connection)
|
||||
- except NoConnectException, e:
|
||||
+ except UnoNoConnectException, e:
|
||||
pass
|
||||
else:
|
||||
info(1, "Existing %s listener found, nothing to do." % product.ooName)
|
||||
@@ -1039,7 +1040,7 @@ def die(ret, msg=None):
|
||||
info(3, 'Terminating %s instance.' % product.ooName)
|
||||
try:
|
||||
convertor.desktop.terminate()
|
||||
- except DisposedException:
|
||||
+ except UnoDisposedException:
|
||||
info(2, '%s instance unsuccessfully closed, sending TERM signal.' % product.ooName)
|
||||
try:
|
||||
ooproc.terminate()
|
||||
@@ -1080,7 +1081,7 @@ def main():
|
||||
for inputfn in op.filenames:
|
||||
convertor.convert(inputfn)
|
||||
|
||||
- except NoConnectException, e:
|
||||
+ except UnoNoConnectException, e:
|
||||
error("unoconv: could not find an existing connection to LibreOffice at %s:%s." % (op.server, op.port))
|
||||
if op.connection:
|
||||
info(0, "Please start an LibreOffice instance on server '%s' by doing:\n\n unoconv --listener --server %s --port %s\n\nor alternatively:\n\n soffice -nologo -nodefault -accept=\"%s\"" % (op.server, op.server, op.port, op.connection))
|
||||
@@ -1094,7 +1095,8 @@ def main():
|
||||
error("Warning: failed to launch Office suite. Aborting.")
|
||||
|
||||
### Main entrance
|
||||
-if __name__ == '__main__':
|
||||
+def run():
|
||||
+ global exitcode
|
||||
exitcode = 0
|
||||
|
||||
info(3, 'sysname=%s, platform=%s, python=%s, python-version=%s' % (os.name, sys.platform, sys.executable, sys.version))
|
||||
@@ -1105,7 +1107,12 @@ if __name__ == '__main__':
|
||||
office_environ(of)
|
||||
# debug_office()
|
||||
try:
|
||||
- import uno, unohelper
|
||||
+ global global_uno
|
||||
+ global global_unohelper
|
||||
+
|
||||
+ import uno as global_uno
|
||||
+ import unohelper as global_unohelper
|
||||
+ global office
|
||||
office = of
|
||||
break
|
||||
except:
|
||||
@@ -1121,17 +1128,30 @@ if __name__ == '__main__':
|
||||
sys.exit(1)
|
||||
|
||||
### Now that we have found a working pyuno library, let's import some classes
|
||||
- from com.sun.star.beans import PropertyValue
|
||||
- from com.sun.star.connection import NoConnectException
|
||||
- from com.sun.star.document.UpdateDocMode import QUIET_UPDATE
|
||||
- from com.sun.star.lang import DisposedException, IllegalArgumentException
|
||||
- from com.sun.star.io import IOException, XOutputStream
|
||||
- from com.sun.star.script import CannotConvertException
|
||||
+ global UnoPropertyValue
|
||||
+ global UnoNoConnectException
|
||||
+ global UNO_QUIET_UPDATE
|
||||
+ global UnoDisposedException
|
||||
+ global UnoIllegalArgumentException
|
||||
+ global UnoIOException
|
||||
+ global UnoXOutputStream
|
||||
+ global UnoCannotConvertException
|
||||
+ global UnoException
|
||||
+ global UnoRuntimeException
|
||||
+
|
||||
+ from com.sun.star.beans import PropertyValue as UnoPropertyValue
|
||||
+ from com.sun.star.connection import NoConnectException as UnoNoConnectException
|
||||
+ from com.sun.star.document.UpdateDocMode import QUIET_UPDATE as UNO_QUIET_UPDATE
|
||||
+ from com.sun.star.lang import DisposedException as UnoDisposedException
|
||||
+ from com.sun.star.lang import IllegalArgumentException as UnoIllegalArgumentException
|
||||
+ from com.sun.star.io import IOException as UnoIOException
|
||||
+ from com.sun.star.io import XOutputStream as UnoXOutputStream
|
||||
+ from com.sun.star.script import CannotConvertException as UnoCannotConvertException
|
||||
from com.sun.star.uno import Exception as UnoException
|
||||
- from com.sun.star.uno import RuntimeException
|
||||
+ from com.sun.star.uno import RuntimeException as UnoRuntimeException
|
||||
|
||||
### And now that we have those classes, build on them
|
||||
- class OutputStream( unohelper.Base, XOutputStream ):
|
||||
+ class OutputStream( global_unohelper.Base, UnoXOutputStream ):
|
||||
def __init__( self ):
|
||||
self.closed = 0
|
||||
|
||||
@@ -1144,15 +1164,22 @@ if __name__ == '__main__':
|
||||
def flush( self ):
|
||||
pass
|
||||
|
||||
+ global GlobalOutputStream
|
||||
+ GlobalOutputStream = OutputStream
|
||||
+
|
||||
def UnoProps(**args):
|
||||
props = []
|
||||
for key in args:
|
||||
- prop = PropertyValue()
|
||||
+ prop = UnoPropertyValue()
|
||||
prop.Name = key
|
||||
prop.Value = args[key]
|
||||
props.append(prop)
|
||||
return tuple(props)
|
||||
|
||||
+ global GlobalUnoProps
|
||||
+ GlobalUnoProps = UnoProps
|
||||
+
|
||||
+ global op
|
||||
op = Options(sys.argv[1:])
|
||||
|
||||
info(2, "Using office base path: %s" % office.basepath)
|
||||
@@ -1163,3 +1190,6 @@ if __name__ == '__main__':
|
||||
except KeyboardInterrupt, e:
|
||||
die(6, 'Exiting on user request')
|
||||
die(exitcode)
|
||||
+
|
||||
+if __name__ == '__main__':
|
||||
+ run()
|
||||
--
|
||||
1.9.0
|
||||
|
||||
|
|
@ -1,629 +0,0 @@
|
|||
From 21b9a845ac7e8805b41d7dab1a6fbf8076689ae8 Mon Sep 17 00:00:00 2001
|
||||
From: rpm-build <rpm-build>
|
||||
Date: Sat, 19 Apr 2014 12:06:27 +0200
|
||||
Subject: [PATCH] 0001-python3-added-compatibility.3.patch
|
||||
|
||||
---
|
||||
unoconv | 248 ++++++++++++++++++++++++++++++++++++----------------------------
|
||||
1 file changed, 139 insertions(+), 109 deletions(-)
|
||||
|
||||
diff --git a/unoconv b/unoconv
|
||||
index 30e6706..a13db44 100755
|
||||
--- a/unoconv
|
||||
+++ b/unoconv
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/env python
|
||||
+#!/usr/bin/python3
|
||||
|
||||
### 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
|
||||
@@ -77,11 +77,11 @@ def find_offices():
|
||||
else:
|
||||
|
||||
if os.name in ( 'nt', 'os2' ):
|
||||
- if 'PROGRAMFILES' in os.environ.keys():
|
||||
+ if 'PROGRAMFILES' in list(os.environ.keys()):
|
||||
extrapaths += glob.glob(os.environ['PROGRAMFILES']+'\\LibreOffice*') + \
|
||||
glob.glob(os.environ['PROGRAMFILES']+'\\OpenOffice.org*')
|
||||
|
||||
- if 'PROGRAMFILES(X86)' in os.environ.keys():
|
||||
+ if 'PROGRAMFILES(X86)' in list(os.environ.keys()):
|
||||
extrapaths += glob.glob(os.environ['PROGRAMFILES(X86)']+'\\LibreOffice*') + \
|
||||
glob.glob(os.environ['PROGRAMFILES(X86)']+'\\OpenOffice.org*')
|
||||
|
||||
@@ -203,7 +203,7 @@ def office_environ(office):
|
||||
### Set UNO_PATH so that "officehelper.bootstrap()" can find soffice executable:
|
||||
os.environ['UNO_PATH'] = office.unopath
|
||||
|
||||
- ### Set URE_BOOTSTRAP so that "uno.getComponentContext()" bootstraps a complete
|
||||
+ ### Set URE_BOOTSTRAP so that "global_uno.getComponentContext()" bootstraps a complete
|
||||
### UNO environment
|
||||
if os.name in ( 'nt', 'os2' ):
|
||||
os.environ['URE_BOOTSTRAP'] = 'vnd.sun.star.pathname:' + realpath(office.basepath, 'program', 'fundamental.ini')
|
||||
@@ -233,18 +233,18 @@ def office_environ(office):
|
||||
|
||||
def debug_office():
|
||||
if 'URE_BOOTSTRAP' in os.environ:
|
||||
- print >>sys.stderr, 'URE_BOOTSTRAP=%s' % os.environ['URE_BOOTSTRAP']
|
||||
+ print('URE_BOOTSTRAP=%s' % os.environ['URE_BOOTSTRAP'], file=sys.stderr)
|
||||
if 'UNO_PATH' in os.environ:
|
||||
- print >>sys.stderr, 'UNO_PATH=%s' % os.environ['UNO_PATH']
|
||||
+ print('UNO_PATH=%s' % os.environ['UNO_PATH'], file=sys.stderr)
|
||||
if 'UNO_TYPES' in os.environ:
|
||||
- print >>sys.stderr, 'UNO_TYPES=%s' % os.environ['UNO_TYPES']
|
||||
- print 'PATH=%s' % os.environ['PATH']
|
||||
+ print('UNO_TYPES=%s' % os.environ['UNO_TYPES'], file=sys.stderr)
|
||||
+ print('PATH=%s' % os.environ['PATH'])
|
||||
if 'PYTHONHOME' in os.environ:
|
||||
- print >>sys.stderr, 'PYTHONHOME=%s' % os.environ['PYTHONHOME']
|
||||
+ print('PYTHONHOME=%s' % os.environ['PYTHONHOME'], file=sys.stderr)
|
||||
if 'PYTHONPATH' in os.environ:
|
||||
- print >>sys.stderr, 'PYTHONPATH=%s' % os.environ['PYTHONPATH']
|
||||
+ print('PYTHONPATH=%s' % os.environ['PYTHONPATH'], file=sys.stderr)
|
||||
if 'LD_LIBRARY_PATH' in os.environ:
|
||||
- print >>sys.stderr, 'LD_LIBRARY_PATH=%s' % os.environ['LD_LIBRARY_PATH']
|
||||
+ print('LD_LIBRARY_PATH=%s' % os.environ['LD_LIBRARY_PATH'], file=sys.stderr)
|
||||
|
||||
def python_switch(office):
|
||||
if office.pythonhome:
|
||||
@@ -277,6 +277,7 @@ def python_switch(office):
|
||||
|
||||
try:
|
||||
os.execvpe(office.python, [office.python, ] + sys.argv[0:], os.environ)
|
||||
+ print((office.python, [office.python, ] + sys.argv[0:], osenviron))
|
||||
except OSError:
|
||||
### Mac OS X versions prior to 10.6 do not support execv in
|
||||
### a process that contains multiple threads. Instead of
|
||||
@@ -335,11 +336,11 @@ class FmtList:
|
||||
return ret
|
||||
|
||||
def display(self, doctype):
|
||||
- print >>sys.stderr, "The following list of %s formats are currently available:\n" % doctype
|
||||
+ print("The following list of %s formats are currently available:\n" % doctype, file=sys.stderr)
|
||||
for fmt in self.list:
|
||||
if fmt.doctype == doctype:
|
||||
- print >>sys.stderr, " %-8s - %s" % (fmt.name, fmt)
|
||||
- print >>sys.stderr
|
||||
+ print(" %-8s - %s" % (fmt.name, fmt), file=sys.stderr)
|
||||
+ print(file=sys.stderr)
|
||||
|
||||
fmts = FmtList()
|
||||
|
||||
@@ -530,14 +531,14 @@ class Options:
|
||||
'outputpath', 'password=', 'pipe=', 'port=', 'server=',
|
||||
'timeout=', 'show', 'stdout', 'template', 'verbose',
|
||||
'version'] )
|
||||
- except getopt.error, exc:
|
||||
- print 'unoconv: %s, try unoconv -h for a list of all the options' % str(exc)
|
||||
+ except getopt.error as exc:
|
||||
+ print('unoconv: %s, try unoconv -h for a list of all the options' % str(exc))
|
||||
sys.exit(255)
|
||||
|
||||
for opt, arg in opts:
|
||||
if opt in ['-h', '--help']:
|
||||
self.usage()
|
||||
- print
|
||||
+ print()
|
||||
self.help()
|
||||
sys.exit(1)
|
||||
elif opt in ['-c', '--connection']:
|
||||
@@ -553,16 +554,16 @@ class Options:
|
||||
if name in ('FilterOptions'):
|
||||
self.exportfilteroptions = value
|
||||
elif value in ('True', 'true'):
|
||||
- self.exportfilter.append( PropertyValue( name, 0, True, 0 ) )
|
||||
+ self.exportfilter.append( UnoPropertyValue( name, 0, True, 0 ) )
|
||||
elif value in ('False', 'false'):
|
||||
- self.exportfilter.append( PropertyValue( name, 0, False, 0 ) )
|
||||
+ self.exportfilter.append( UnoPropertyValue( name, 0, False, 0 ) )
|
||||
else:
|
||||
try:
|
||||
- self.exportfilter.append( PropertyValue( name, 0, int(value), 0 ) )
|
||||
+ self.exportfilter.append( UnoPropertyValue( name, 0, int(value), 0 ) )
|
||||
except ValueError:
|
||||
- self.exportfilter.append( PropertyValue( name, 0, value, 0 ) )
|
||||
+ self.exportfilter.append( UnoPropertyValue( name, 0, value, 0 ) )
|
||||
else:
|
||||
- print >>sys.stderr, 'Warning: Option %s cannot be parsed, ignoring.' % arg
|
||||
+ print('Warning: Option %s cannot be parsed, ignoring.' % arg, file=sys.stderr)
|
||||
elif opt in ['-f', '--format']:
|
||||
self.format = arg
|
||||
elif opt in ['-i', '--import']:
|
||||
@@ -572,16 +573,16 @@ class Options:
|
||||
if name in ('FilterOptions'):
|
||||
self.importfilteroptions = value
|
||||
elif value in ('True', 'true'):
|
||||
- self.importfilter.append( PropertyValue( name, 0, True, 0 ) )
|
||||
+ self.importfilter.append( UnoPropertyValue( name, 0, True, 0 ) )
|
||||
elif value in ('False', 'false'):
|
||||
- self.importfilter.append( PropertyValue( name, 0, False, 0 ) )
|
||||
+ self.importfilter.append( UnoPropertyValue( name, 0, False, 0 ) )
|
||||
else:
|
||||
try:
|
||||
- self.importfilter.append( PropertyValue( name, 0, int(value), 0 ) )
|
||||
+ self.importfilter.append( UnoPropertyValue( name, 0, int(value), 0 ) )
|
||||
except ValueError:
|
||||
- self.importfilter.append( PropertyValue( name, 0, value, 0 ) )
|
||||
+ self.importfilter.append( UnoPropertyValue( name, 0, value, 0 ) )
|
||||
else:
|
||||
- print >>sys.stderr, 'Warning: Option %s cannot be parsed, ignoring.' % arg
|
||||
+ print('Warning: Option %s cannot be parsed, ignoring.' % arg, file=sys.stderr)
|
||||
elif opt in ['-l', '--listener']:
|
||||
self.listener = True
|
||||
elif opt in ['-n', '--no-launch']:
|
||||
@@ -589,7 +590,7 @@ class Options:
|
||||
elif opt in ['-o', '--output']:
|
||||
self.output = arg
|
||||
elif opt in ['--outputpath']:
|
||||
- print >>sys.stderr, 'Warning: This option is deprecated by --output.'
|
||||
+ print('Warning: This option is deprecated by --output.', file=sys.stderr)
|
||||
self.output = arg
|
||||
elif opt in ['--password']:
|
||||
self.password = arg
|
||||
@@ -615,13 +616,13 @@ class Options:
|
||||
|
||||
### Enable verbosity
|
||||
if self.verbose >= 2:
|
||||
- print >>sys.stderr, 'Verbosity set to level %d' % self.verbose
|
||||
+ print('Verbosity set to level %d' % self.verbose, file=sys.stderr)
|
||||
|
||||
self.filenames = args
|
||||
|
||||
if not self.listener and not self.showlist and self.doctype != 'list' and not self.filenames:
|
||||
- print >>sys.stderr, 'unoconv: you have to provide a filename as argument'
|
||||
- print >>sys.stderr, 'Try `unoconv -h\' for more information.'
|
||||
+ print('unoconv: you have to provide a filename as argument', file=sys.stderr)
|
||||
+ print('Try `unoconv -h\' for more information.', file=sys.stderr)
|
||||
sys.exit(255)
|
||||
|
||||
### Set connection string
|
||||
@@ -657,23 +658,23 @@ class Options:
|
||||
|
||||
def version(self):
|
||||
### Get office product information
|
||||
- product = uno.getComponentContext().ServiceManager.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product"))
|
||||
-
|
||||
- print 'unoconv %s' % VERSION
|
||||
- print 'Written by Dag Wieers <dag@wieers.com>'
|
||||
- print 'Homepage at http://dag.wieers.com/home-made/unoconv/'
|
||||
- print
|
||||
- print 'platform %s/%s' % (os.name, sys.platform)
|
||||
- print 'python %s' % sys.version
|
||||
- print product.ooName, product.ooSetupVersion
|
||||
+ product = global_uno.getComponentContext().ServiceManager.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", GlobalUnoProps(nodepath="/org.openoffice.Setup/Product"))
|
||||
+
|
||||
+ print('unoconv %s' % VERSION)
|
||||
+ print('Written by Dag Wieers <dag@wieers.com>')
|
||||
+ print('Homepage at http://dag.wieers.com/home-made/unoconv/')
|
||||
+ print()
|
||||
+ print('platform %s/%s' % (os.name, sys.platform))
|
||||
+ print('python %s' % sys.version)
|
||||
+ print(product.ooName, product.ooSetupVersion)
|
||||
# print
|
||||
# print 'build revision $Rev$'
|
||||
|
||||
def usage(self):
|
||||
- print >>sys.stderr, 'usage: unoconv [options] file [file2 ..]'
|
||||
+ print('usage: unoconv [options] file [file2 ..]', file=sys.stderr)
|
||||
|
||||
def help(self):
|
||||
- print >>sys.stderr, '''Convert from and to any format supported by LibreOffice
|
||||
+ print('''Convert from and to any format supported by LibreOffice
|
||||
|
||||
unoconv options:
|
||||
-c, --connection=string use a custom connection string
|
||||
@@ -698,7 +699,7 @@ unoconv options:
|
||||
-t, --template=file import the styles from template (.ott)
|
||||
-T, --timeout=secs timeout after secs if connection to listener fails
|
||||
-v, --verbose be more and more verbose (-vvv for debugging)
|
||||
-'''
|
||||
+''', file=sys.stderr)
|
||||
|
||||
class Convertor:
|
||||
def __init__(self):
|
||||
@@ -706,7 +707,7 @@ class Convertor:
|
||||
unocontext = None
|
||||
|
||||
### Do the LibreOffice component dance
|
||||
- self.context = uno.getComponentContext()
|
||||
+ self.context = global_uno.getComponentContext()
|
||||
self.svcmgr = self.context.ServiceManager
|
||||
resolver = self.svcmgr.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", self.context)
|
||||
|
||||
@@ -714,7 +715,7 @@ class Convertor:
|
||||
info(3, 'Connection type: %s' % op.connection)
|
||||
try:
|
||||
unocontext = resolver.resolve("uno:%s" % op.connection)
|
||||
- except NoConnectException, e:
|
||||
+ except UnoNoConnectException as e:
|
||||
# info(3, "Existing listener not found.\n%s" % e)
|
||||
info(3, "Existing listener not found.")
|
||||
|
||||
@@ -724,7 +725,7 @@ class Convertor:
|
||||
### Start our own OpenOffice instance
|
||||
info(3, "Launching our own listener using %s." % office.binary)
|
||||
try:
|
||||
- product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product"))
|
||||
+ product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", GlobalUnoProps(nodepath="/org.openoffice.Setup/Product"))
|
||||
if product.ooName != "LibreOffice" or LooseVersion(product.ooSetupVersion) <= LooseVersion('3.3'):
|
||||
ooproc = subprocess.Popen([office.binary, "-headless", "-invisible", "-nocrashreport", "-nodefault", "-nofirststartwizard", "-nologo", "-norestore", "-accept=%s" % op.connection], env=os.environ)
|
||||
else:
|
||||
@@ -742,14 +743,14 @@ class Convertor:
|
||||
try:
|
||||
unocontext = resolver.resolve("uno:%s" % op.connection)
|
||||
break
|
||||
- except NoConnectException:
|
||||
+ except UnoNoConnectException:
|
||||
time.sleep(0.5)
|
||||
timeout += 0.5
|
||||
except:
|
||||
raise
|
||||
else:
|
||||
error("Failed to connect to %s (pid=%s) in %d seconds.\n%s" % (office.binary, ooproc.pid, op.timeout, e))
|
||||
- except Exception, e:
|
||||
+ except Exception as e:
|
||||
raise
|
||||
error("Launch of %s failed.\n%s" % (office.binary, e))
|
||||
|
||||
@@ -759,7 +760,7 @@ class Convertor:
|
||||
### And some more LibreOffice magic
|
||||
unosvcmgr = unocontext.ServiceManager
|
||||
self.desktop = unosvcmgr.createInstanceWithContext("com.sun.star.frame.Desktop", unocontext)
|
||||
- self.cwd = unohelper.systemPathToFileUrl( os.getcwd() )
|
||||
+ self.cwd = global_unohelper.systemPathToFileUrl( os.getcwd() )
|
||||
|
||||
### List all filters
|
||||
# self.filters = unosvcmgr.createInstanceWithContext( "com.sun.star.document.FilterFactory", unocontext)
|
||||
@@ -799,9 +800,9 @@ class Convertor:
|
||||
### No format found, throw error
|
||||
if not outputfmt:
|
||||
if doctype:
|
||||
- print >>sys.stderr, 'unoconv: format [%s/%s] is not known to unoconv.' % (op.doctype, op.format)
|
||||
+ print('unoconv: format [%s/%s] is not known to unoconv.' % (op.doctype, op.format), file=sys.stderr)
|
||||
else:
|
||||
- print >>sys.stderr, 'unoconv: format [%s] is not known to unoconv.' % op.format
|
||||
+ print('unoconv: format [%s] is not known to unoconv.' % op.format, file=sys.stderr)
|
||||
die(1)
|
||||
|
||||
return outputfmt
|
||||
@@ -813,10 +814,10 @@ class Convertor:
|
||||
outputfmt = self.getformat(inputfn)
|
||||
|
||||
if op.verbose > 0:
|
||||
- print >>sys.stderr, 'Input file:', inputfn
|
||||
+ print('Input file:', inputfn, file=sys.stderr)
|
||||
|
||||
if not os.path.exists(inputfn):
|
||||
- print >>sys.stderr, 'unoconv: file `%s\' does not exist.' % inputfn
|
||||
+ print('unoconv: file `%s\' does not exist.' % inputfn, file=sys.stderr)
|
||||
exitcode = 1
|
||||
|
||||
try:
|
||||
@@ -824,22 +825,22 @@ class Convertor:
|
||||
phase = "import"
|
||||
|
||||
### Load inputfile
|
||||
- inputprops = UnoProps(Hidden=True, ReadOnly=True, UpdateDocMode=QUIET_UPDATE)
|
||||
+ inputprops = GlobalUnoProps(Hidden=True, ReadOnly=True, UpdateDocMode=UNO_QUIET_UPDATE)
|
||||
|
||||
# if op.password:
|
||||
-# info = UnoProps(algorithm-name="PBKDF2", salt="salt", iteration-count=1024, hash="hash")
|
||||
-# inputprops += UnoProps(ModifyPasswordInfo=info)
|
||||
+# info = GlobalUnoProps(algorithm-name="PBKDF2", salt="salt", iteration-count=1024, hash="hash")
|
||||
+# inputprops += GlobalUnoProps(ModifyPasswordInfo=info)
|
||||
|
||||
- ### Cannot use UnoProps for FilterData property
|
||||
+ ### Cannot use GlobalUnoProps for FilterData property
|
||||
if op.importfilteroptions:
|
||||
# print "Import filter options: %s" % op.importfilteroptions
|
||||
- inputprops += UnoProps(FilterOptions=op.importfilteroptions)
|
||||
+ inputprops += GlobalUnoProps(FilterOptions=op.importfilteroptions)
|
||||
|
||||
- ### Cannot use UnoProps for FilterData property
|
||||
+ ### Cannot use GlobalUnoProps for FilterData property
|
||||
if op.importfilter:
|
||||
- inputprops += ( PropertyValue( "FilterData", 0, uno.Any("[]com.sun.star.beans.PropertyValue", tuple( op.importfilter ), ), 0 ), )
|
||||
+ inputprops += ( UnoPropertyValue( "FilterData", 0, global_uno.Any("[]com.sun.star.beans.PropertyValue", tuple( op.importfilter ), ), 0 ), )
|
||||
|
||||
- inputurl = unohelper.absolutize(self.cwd, unohelper.systemPathToFileUrl(inputfn))
|
||||
+ inputurl = global_unohelper.absolutize(self.cwd, global_unohelper.systemPathToFileUrl(inputfn))
|
||||
document = self.desktop.loadComponentFromURL( inputurl , "_blank", 0, inputprops )
|
||||
|
||||
if not document:
|
||||
@@ -850,11 +851,11 @@ class Convertor:
|
||||
if op.template:
|
||||
if os.path.exists(op.template):
|
||||
info(1, "Template file: %s" % op.template)
|
||||
- templateprops = UnoProps(OverwriteStyles=True)
|
||||
- templateurl = unohelper.absolutize(self.cwd, unohelper.systemPathToFileUrl(op.template))
|
||||
+ templateprops = GlobalUnoProps(OverwriteStyles=True)
|
||||
+ templateurl = global_unohelper.absolutize(self.cwd, global_unohelper.systemPathToFileUrl(op.template))
|
||||
document.StyleFamilies.loadStylesFromURL(templateurl, templateprops)
|
||||
else:
|
||||
- print >>sys.stderr, 'unoconv: template file `%s\' does not exist.' % op.template
|
||||
+ print('unoconv: template file `%s\' does not exist.' % op.template, file=sys.stderr)
|
||||
exitcode = 1
|
||||
|
||||
### Update document links
|
||||
@@ -885,26 +886,26 @@ class Convertor:
|
||||
### Export phase
|
||||
phase = "export"
|
||||
|
||||
- outputprops = UnoProps(FilterName=outputfmt.filter, OutputStream=OutputStream(), Overwrite=True)
|
||||
+ outputprops = GlobalUnoProps(FilterName=outputfmt.filter, OutputStream=GlobalOutputStream(), Overwrite=True)
|
||||
|
||||
### Set default filter options
|
||||
if op.exportfilteroptions:
|
||||
# print "Export filter options: %s" % op.exportfilteroptions
|
||||
- outputprops += UnoProps(FilterOptions=op.exportfilteroptions)
|
||||
+ outputprops += GlobalUnoProps(FilterOptions=op.exportfilteroptions)
|
||||
else:
|
||||
if outputfmt.filter == 'Text (encoded)':
|
||||
- outputprops += UnoProps(FilterOptions="76,LF")
|
||||
+ outputprops += GlobalUnoProps(FilterOptions="76,LF")
|
||||
|
||||
elif outputfmt.filter == 'Text':
|
||||
- outputprops += UnoProps(FilterOptions="76")
|
||||
+ outputprops += GlobalUnoProps(FilterOptions="76")
|
||||
|
||||
elif outputfmt.filter == 'Text - txt - csv (StarCalc)':
|
||||
- outputprops += UnoProps(FilterOptions="44,34,76")
|
||||
+ outputprops += GlobalUnoProps(FilterOptions="44,34,76")
|
||||
|
||||
|
||||
- ### Cannot use UnoProps for FilterData property
|
||||
+ ### Cannot use GlobalUnoProps for FilterData property
|
||||
if op.exportfilter:
|
||||
- outputprops += ( PropertyValue( "FilterData", 0, uno.Any("[]com.sun.star.beans.PropertyValue", tuple( op.exportfilter ), ), 0 ), )
|
||||
+ outputprops += ( UnoPropertyValue( "FilterData", 0, global_uno.Any("[]com.sun.star.beans.PropertyValue", tuple( op.exportfilter ), ), 0 ), )
|
||||
|
||||
if not op.stdout:
|
||||
(outputfn, ext) = os.path.splitext(inputfn)
|
||||
@@ -917,47 +918,47 @@ class Convertor:
|
||||
else:
|
||||
outputfn = op.output
|
||||
|
||||
- outputurl = unohelper.absolutize( self.cwd, unohelper.systemPathToFileUrl(outputfn) )
|
||||
+ outputurl = global_unohelper.absolutize( self.cwd, global_unohelper.systemPathToFileUrl(outputfn) )
|
||||
info(1, "Output file: %s" % outputfn)
|
||||
else:
|
||||
outputurl = "private:stream"
|
||||
|
||||
try:
|
||||
document.storeToURL(outputurl, tuple(outputprops) )
|
||||
- except IOException, e:
|
||||
+ except UnoIOException as e:
|
||||
raise UnoException("Unable to store document to %s (ErrCode %d)\n\nProperties: %s" % (outputurl, e.ErrCode, outputprops), None)
|
||||
|
||||
phase = "dispose"
|
||||
document.dispose()
|
||||
document.close(True)
|
||||
|
||||
- except SystemError, e:
|
||||
+ except SystemError as e:
|
||||
error("unoconv: SystemError during %s phase:\n%s" % (phase, e))
|
||||
exitcode = 1
|
||||
|
||||
- except RuntimeException, e:
|
||||
+ except UnoRuntimeException as e:
|
||||
error("unoconv: RuntimeException during %s phase:\nOffice probably died. %s" % (phase, e))
|
||||
exitcode = 6
|
||||
|
||||
- except DisposedException, e:
|
||||
+ except UnoDisposedException as e:
|
||||
error("unoconv: DisposedException during %s phase:\nOffice probably died. %s" % (phase, e))
|
||||
exitcode = 7
|
||||
|
||||
- except IllegalArgumentException, e:
|
||||
+ except UnoIllegalArgumentException as e:
|
||||
error("UNO IllegalArgument during %s phase:\nSource file cannot be read. %s" % (phase, e))
|
||||
exitcode = 8
|
||||
|
||||
- except IOException, e:
|
||||
+ except UnoIOException as e:
|
||||
# for attr in dir(e): print '%s: %s', (attr, getattr(e, attr))
|
||||
error("unoconv: IOException during %s phase:\n%s" % (phase, e.Message))
|
||||
exitcode = 3
|
||||
|
||||
- except CannotConvertException, e:
|
||||
+ except UnoCannotConvertException as e:
|
||||
# for attr in dir(e): print '%s: %s', (attr, getattr(e, attr))
|
||||
error("unoconv: CannotConvertException during %s phase:\n%s" % (phase, e.Message))
|
||||
exitcode = 4
|
||||
|
||||
- except UnoException, e:
|
||||
+ except UnoException as e:
|
||||
if hasattr(e, 'ErrCode'):
|
||||
error("unoconv: UnoException during %s phase in %s (ErrCode %d)" % (phase, repr(e.__class__), e.ErrCode))
|
||||
exitcode = e.ErrCode
|
||||
@@ -975,14 +976,14 @@ class Listener:
|
||||
global product
|
||||
|
||||
info(1, "Start listener on %s:%s" % (op.server, op.port))
|
||||
- self.context = uno.getComponentContext()
|
||||
+ self.context = global_uno.getComponentContext()
|
||||
self.svcmgr = self.context.ServiceManager
|
||||
try:
|
||||
resolver = self.svcmgr.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", self.context)
|
||||
- product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product"))
|
||||
+ product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", GlobalUnoProps(nodepath="/org.openoffice.Setup/Product"))
|
||||
try:
|
||||
unocontext = resolver.resolve("uno:%s" % op.connection)
|
||||
- except NoConnectException, e:
|
||||
+ except UnoNoConnectException as e:
|
||||
pass
|
||||
else:
|
||||
info(1, "Existing %s listener found, nothing to do." % product.ooName)
|
||||
@@ -991,25 +992,25 @@ class Listener:
|
||||
subprocess.call([office.binary, "-headless", "-invisible", "-nocrashreport", "-nodefault", "-nologo", "-nofirststartwizard", "-norestore", "-accept=%s" % op.connection], env=os.environ)
|
||||
else:
|
||||
subprocess.call([office.binary, "--headless", "--invisible", "--nocrashreport", "--nodefault", "--nologo", "--nofirststartwizard", "--norestore", "--accept=%s" % op.connection], env=os.environ)
|
||||
- except Exception, e:
|
||||
+ except Exception as e:
|
||||
error("Launch of %s failed.\n%s" % (office.binary, e))
|
||||
else:
|
||||
info(1, "Existing %s listener found, nothing to do." % product.ooName)
|
||||
|
||||
def error(msg):
|
||||
"Output error message"
|
||||
- print >>sys.stderr, msg
|
||||
+ print(msg, file=sys.stderr)
|
||||
|
||||
def info(level, msg):
|
||||
"Output info message"
|
||||
if 'op' not in globals():
|
||||
pass
|
||||
elif op.verbose >= 3 and level >= 3:
|
||||
- print >>sys.stderr, "DEBUG:", msg
|
||||
+ print("DEBUG:", msg, file=sys.stderr)
|
||||
elif not op.stdout and level <= op.verbose:
|
||||
- print >>sys.stdout, msg
|
||||
+ print(msg, file=sys.stdout)
|
||||
elif level <= op.verbose:
|
||||
- print >>sys.stderr, msg
|
||||
+ print(msg, file=sys.stderr)
|
||||
|
||||
def die(ret, msg=None):
|
||||
"Print optional error and exit with errorcode"
|
||||
@@ -1031,7 +1032,7 @@ def die(ret, msg=None):
|
||||
subprocess.Popen([office.binary, "--headless", "--invisible", "--nocrashreport", "--nodefault", "--nofirststartwizard", "--nologo", "--norestore", "--unaccept=%s" % op.connection], env=os.environ)
|
||||
ooproc.wait()
|
||||
info(2, '%s listener successfully disabled.' % product.ooName)
|
||||
- except Exception, e:
|
||||
+ except Exception as e:
|
||||
error("Terminate using %s failed.\n%s" % (office.binary, e))
|
||||
|
||||
### If there is no GUI attached to the instance, terminate instance
|
||||
@@ -1039,7 +1040,7 @@ def die(ret, msg=None):
|
||||
info(3, 'Terminating %s instance.' % product.ooName)
|
||||
try:
|
||||
convertor.desktop.terminate()
|
||||
- except DisposedException:
|
||||
+ except UnoDisposedException:
|
||||
info(2, '%s instance unsuccessfully closed, sending TERM signal.' % product.ooName)
|
||||
try:
|
||||
ooproc.terminate()
|
||||
@@ -1080,7 +1081,7 @@ def main():
|
||||
for inputfn in op.filenames:
|
||||
convertor.convert(inputfn)
|
||||
|
||||
- except NoConnectException, e:
|
||||
+ except UnoNoConnectException as e:
|
||||
error("unoconv: could not find an existing connection to LibreOffice at %s:%s." % (op.server, op.port))
|
||||
if op.connection:
|
||||
info(0, "Please start an LibreOffice instance on server '%s' by doing:\n\n unoconv --listener --server %s --port %s\n\nor alternatively:\n\n soffice -nologo -nodefault -accept=\"%s\"" % (op.server, op.server, op.port, op.connection))
|
||||
@@ -1094,7 +1095,8 @@ def main():
|
||||
error("Warning: failed to launch Office suite. Aborting.")
|
||||
|
||||
### Main entrance
|
||||
-if __name__ == '__main__':
|
||||
+def run():
|
||||
+ global exitcode
|
||||
exitcode = 0
|
||||
|
||||
info(3, 'sysname=%s, platform=%s, python=%s, python-version=%s' % (os.name, sys.platform, sys.executable, sys.version))
|
||||
@@ -1105,33 +1107,51 @@ if __name__ == '__main__':
|
||||
office_environ(of)
|
||||
# debug_office()
|
||||
try:
|
||||
- import uno, unohelper
|
||||
+ global global_uno
|
||||
+ global global_unohelper
|
||||
+
|
||||
+ import uno as global_uno
|
||||
+ import unohelper as global_unohelper
|
||||
+ global office
|
||||
office = of
|
||||
break
|
||||
except:
|
||||
# debug_office()
|
||||
- print >>sys.stderr, "unoconv: Cannot find a suitable pyuno library and python binary combination in %s" % of
|
||||
- print >>sys.stderr, "ERROR:", sys.exc_info()[1]
|
||||
- print >>sys.stderr
|
||||
+ print("unoconv: Cannot find a suitable pyuno library and python binary combination in %s" % of, file=sys.stderr)
|
||||
+ print("ERROR:", sys.exc_info()[1], file=sys.stderr)
|
||||
+ print(file=sys.stderr)
|
||||
else:
|
||||
# debug_office()
|
||||
- print >>sys.stderr, "unoconv: Cannot find a suitable office installation on your system."
|
||||
- print >>sys.stderr, "ERROR: Please locate your office installation and send your feedback to:"
|
||||
- print >>sys.stderr, " http://github.com/dagwieers/unoconv/issues"
|
||||
+ print("unoconv: Cannot find a suitable office installation on your system.", file=sys.stderr)
|
||||
+ print("ERROR: Please locate your office installation and send your feedback to:", file=sys.stderr)
|
||||
+ print(" http://github.com/dagwieers/unoconv/issues", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
### Now that we have found a working pyuno library, let's import some classes
|
||||
- from com.sun.star.beans import PropertyValue
|
||||
- from com.sun.star.connection import NoConnectException
|
||||
- from com.sun.star.document.UpdateDocMode import QUIET_UPDATE
|
||||
- from com.sun.star.lang import DisposedException, IllegalArgumentException
|
||||
- from com.sun.star.io import IOException, XOutputStream
|
||||
- from com.sun.star.script import CannotConvertException
|
||||
+ global UnoPropertyValue
|
||||
+ global UnoNoConnectException
|
||||
+ global UNO_QUIET_UPDATE
|
||||
+ global UnoDisposedException
|
||||
+ global UnoIllegalArgumentException
|
||||
+ global UnoIOException
|
||||
+ global UnoXOutputStream
|
||||
+ global UnoCannotConvertException
|
||||
+ global UnoException
|
||||
+ global UnoRuntimeException
|
||||
+
|
||||
+ from com.sun.star.beans import PropertyValue as UnoPropertyValue
|
||||
+ from com.sun.star.connection import NoConnectException as UnoNoConnectException
|
||||
+ from com.sun.star.document.UpdateDocMode import QUIET_UPDATE as UNO_QUIET_UPDATE
|
||||
+ from com.sun.star.lang import DisposedException as UnoDisposedException
|
||||
+ from com.sun.star.lang import IllegalArgumentException as UnoIllegalArgumentException
|
||||
+ from com.sun.star.io import IOException as UnoIOException
|
||||
+ from com.sun.star.io import XOutputStream as UnoXOutputStream
|
||||
+ from com.sun.star.script import CannotConvertException as UnoCannotConvertException
|
||||
from com.sun.star.uno import Exception as UnoException
|
||||
- from com.sun.star.uno import RuntimeException
|
||||
+ from com.sun.star.uno import RuntimeException as UnoRuntimeException
|
||||
|
||||
### And now that we have those classes, build on them
|
||||
- class OutputStream( unohelper.Base, XOutputStream ):
|
||||
+ class OutputStream( global_unohelper.Base, UnoXOutputStream ):
|
||||
def __init__( self ):
|
||||
self.closed = 0
|
||||
|
||||
@@ -1144,15 +1164,22 @@ if __name__ == '__main__':
|
||||
def flush( self ):
|
||||
pass
|
||||
|
||||
+ global GlobalOutputStream
|
||||
+ GlobalOutputStream = OutputStream
|
||||
+
|
||||
def UnoProps(**args):
|
||||
props = []
|
||||
for key in args:
|
||||
- prop = PropertyValue()
|
||||
+ prop = UnoPropertyValue()
|
||||
prop.Name = key
|
||||
prop.Value = args[key]
|
||||
props.append(prop)
|
||||
return tuple(props)
|
||||
|
||||
+ global GlobalUnoProps
|
||||
+ GlobalUnoProps = UnoProps
|
||||
+
|
||||
+ global op
|
||||
op = Options(sys.argv[1:])
|
||||
|
||||
info(2, "Using office base path: %s" % office.basepath)
|
||||
@@ -1160,6 +1187,9 @@ if __name__ == '__main__':
|
||||
|
||||
try:
|
||||
main()
|
||||
- except KeyboardInterrupt, e:
|
||||
+ except KeyboardInterrupt as e:
|
||||
die(6, 'Exiting on user request')
|
||||
die(exitcode)
|
||||
+
|
||||
+if __name__ == '__main__':
|
||||
+ run()
|
||||
--
|
||||
1.9.0
|
||||
|
||||
22
0001-python3-added-compatibility.patch
Normal file
22
0001-python3-added-compatibility.patch
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
From 21b9a845ac7e8805b41d7dab1a6fbf8076689ae8 Mon Sep 17 00:00:00 2001
|
||||
From: rpm-build <rpm-build>
|
||||
Date: Sat, 19 Apr 2014 12:06:27 +0200
|
||||
Subject: [PATCH] 0001-python3-added-compatibility.3.patch
|
||||
|
||||
---
|
||||
unoconv | 248 ++++++++++++++++++++++++++++++++++++----------------------------
|
||||
1 file changed, 139 insertions(+), 109 deletions(-)
|
||||
|
||||
diff --git a/unoconv b/unoconv
|
||||
index 30e6706..a13db44 100755
|
||||
--- a/unoconv
|
||||
+++ b/unoconv
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/env python
|
||||
+#!/usr/bin/python3
|
||||
|
||||
### 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
|
||||
--
|
||||
1.9.0
|
||||
|
||||
|
|
@ -141,7 +141,7 @@ index 30e6706..e4a1ac8 100755
|
|||
+### MA 02110-1301 USA.
|
||||
### Copyright 2007-2010 Dag Wieers <dag@wieers.com>
|
||||
|
||||
from distutils.version import LooseVersion
|
||||
from __future__ import print_function
|
||||
--
|
||||
1.7.11.7
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ index dd73799..a5d29da 100755
|
|||
-fmts.add('document', 'vor4', 'vor', 'StarWriter 4.0 Template', 'StarWriter 4.0 Vorlage/Template') ### 5
|
||||
-fmts.add('document', 'vor3', 'vor', 'StarWriter 3.0 Template', 'StarWriter 3.0 Vorlage/Template') ### 4
|
||||
fmts.add('document', 'xhtml', 'html', 'XHTML Document', 'XHTML Writer File') ### 33
|
||||
fmts.add('document', 'epub', 'epub', 'Electronic Publication', 'EPUB')
|
||||
|
||||
### WebDocument
|
||||
@@ -382,14 +374,9 @@ fmts.add('web', 'html', 'html', 'HTML Document', 'HTML') ### 2
|
||||
fmts.add('web', 'html', 'html', 'HTML Document Template', 'writerweb8_writer_template') ### 13
|
||||
fmts.add('web', 'mediawiki', 'txt', 'MediaWiki', 'MediaWiki_Web') ### 9
|
||||
|
|
|
|||
145
changelog
Normal file
145
changelog
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
* Mon Nov 21 2022 David Tardon <dtardon@redhat.com> - 0.9.0-9
|
||||
- Convert license to SPDX
|
||||
|
||||
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Sun Dec 22 2019 David Tardon <dtardon@redhat.com> - 0.9.0-2
|
||||
- upload fixed tarball
|
||||
|
||||
* Sat Sep 28 2019 David Tardon <dtardon@redhat.com> - 0.9-1
|
||||
- new upstream release
|
||||
|
||||
* Sat Aug 31 2019 David Tardon <dtardon@redhat.com> - 0.8.2-1
|
||||
- new upstream release
|
||||
|
||||
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.7-4
|
||||
- Rebuild for Python 3.6
|
||||
|
||||
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Tue Jan 05 2016 David Tardon <dtardon@redhat.com> - 0.7-2
|
||||
- don't install obscure filter deps by default
|
||||
|
||||
* Fri Jul 10 2015 David Tardon <dtardon@redhat.com> - 0.7-1
|
||||
- new upstream release
|
||||
|
||||
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-12
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Sat Apr 19 2014 David Tardon <dtardon@redhat.com> - 0.6-10
|
||||
- Resolves: rhbz#1076275 unoconv trips over '-f latex'
|
||||
- do not show unusable export formats
|
||||
|
||||
* Thu Apr 17 2014 David Tardon <dtardon@redhat.com> - 0.6-9
|
||||
- Resolves: rhbz#1076275 unonconv trips over '-f latex'
|
||||
|
||||
* Wed Feb 12 2014 David Tardon <dtardon@redhat.com> - 0.6-8
|
||||
- Resolves: rhbz#1047539 --stdout option does not work
|
||||
|
||||
* Thu Jan 30 2014 David Tardon <dtardon@redhat.com> - 0.6-7
|
||||
- pull in all libreoffice filters
|
||||
|
||||
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Tue Jul 23 2013 David Tardon <dtardon@redhat.com> - 0.6-5
|
||||
- Resolves: rhbz#987046 drop env from shebang
|
||||
|
||||
* Wed May 29 2013 David Tardon <dtardon@redhat.com> - 0.6-4
|
||||
- rhbz#957776 cannot open office documents
|
||||
|
||||
* Mon Apr 08 2013 David Tardon <dtardon@redhat.com> - 0.6-3
|
||||
- Resolves: rhbz#947096 unoconv doesn't work with Libreoffice 4.0
|
||||
|
||||
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Mon Nov 05 2012 David Tardon <dtardon@redhat.com> - 0.6-1
|
||||
- new upstream release
|
||||
|
||||
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Mon Mar 26 2012 David Tardon <dtardon@redhat.com> - 0.5-1
|
||||
- new upstream release
|
||||
|
||||
* Mon Mar 26 2012 David Tardon <dtardon@redhat.com> - 0.4-6
|
||||
|
||||
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Tue Nov 30 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 0.4-3
|
||||
- Add missing Requires on openoffice.org-brand/libreoffice-core. RHBZ#658576
|
||||
|
||||
* Sat Nov 13 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 0.4-2
|
||||
- Backport some upstream fixes (LD_LIBRARY_PATH issue and -o flag issue)
|
||||
|
||||
* Fri Nov 12 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 0.4-1
|
||||
- Update to 0.4
|
||||
|
||||
* Sat Oct 30 2010 Caolán McNamara <caolanm@redhat.com> - 0.3-5
|
||||
- rebuild for LibreOffice
|
||||
|
||||
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||
|
||||
* Thu May 07 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 0.3-3
|
||||
- Fix rpmlints
|
||||
- Prepare package for Fedora review
|
||||
|
||||
* Sun Feb 22 2009 Peter Hanecak <hany@hany.sk> 0.3-2
|
||||
- used %%{?dist} in release number
|
||||
- license GPLv2
|
||||
|
||||
* Wed Dec 19 2007 Dag Wieers <dag@wieers.com> - 0.3-2 - 5993+/dag
|
||||
- Fixed openoffice.org2 dependency on RHEL4.
|
||||
|
||||
* Sat Sep 01 2007 Dag Wieers <dag@wieers.com> - 0.3-1
|
||||
- Updated to release 0.3.
|
||||
|
||||
* Sun May 20 2007 Dag Wieers <dag@wieers.com> - 0.2-1
|
||||
- Updated to release 0.2.
|
||||
|
||||
* Sat May 19 2007 Dag Wieers <dag@wieers.com> - 0.1-1
|
||||
- Initial package. (using DAR)
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
eeda0d358ce4bacd5dd84303012c416d unoconv-0.6.tar.gz
|
||||
SHA512 (0.9.0.tar.gz) = 37d63ada32675fd0ebd089a74db453fdb7332a24e62cbf3e060d6d15cc503c76ede9ccc5e09467f4a38833a8358c09fde23cc8780a77c343268f20e0c37f2469
|
||||
|
|
|
|||
140
unoconv.spec
140
unoconv.spec
|
|
@ -1,127 +1,55 @@
|
|||
Summary: Tool to convert between any document format supported by LibreOffice
|
||||
Summary: A tool to convert documents from/to any format supported by LibreOffice
|
||||
Name: unoconv
|
||||
Version: 0.6
|
||||
Release: 10%{?dist}
|
||||
License: GPLv2
|
||||
Group: System Environment/Base
|
||||
URL: http://dag.wieers.com/home-made/unoconv/
|
||||
Source: http://dag.wieers.com/home-made/%{name}/%{name}-%{version}.tar.gz
|
||||
Patch0: 0001-Fix-a-broken-export-option-and-add-V-as-alternative-.patch
|
||||
%if 0%{?rhel}
|
||||
Patch1: 0001-python3-added-compatibility.2.patch
|
||||
%else
|
||||
Patch1: 0001-python3-added-compatibility.3.patch
|
||||
%endif
|
||||
Patch2: 0001-update-FSF-address.patch
|
||||
Patch3: 0001-Resolves-fdo-70309-can-t-write-bytes-direct-to-stdou.patch
|
||||
Patch4: 0001-make-LaTeX-export-usable-with-writer2latex-ext.patch
|
||||
Patch5: 0002-remove-export-formats-dropped-by-LibreOffice.patch
|
||||
Version: 0.9.0
|
||||
Release: %autorelease
|
||||
License: GPL-2.0-only
|
||||
URL: https://github.com/unoconv/unoconv/
|
||||
Source: https://github.com/unoconv/unoconv/archive/%{version}.tar.gz
|
||||
|
||||
Patch0: 0001-python3-added-compatibility.patch
|
||||
Patch1: 0001-update-FSF-address.patch
|
||||
Patch2: 0001-make-LaTeX-export-usable-with-writer2latex-ext.patch
|
||||
Patch3: 0001-libreoffice-or-OO.o-has-never-had-wps-export.patch
|
||||
Patch4: 0002-remove-export-formats-dropped-by-LibreOffice.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: asciidoc
|
||||
BuildRequires: xmlto
|
||||
|
||||
Requires: libreoffice-filters
|
||||
Requires: libreoffice-pyuno
|
||||
Requires: libreoffice-writer2latex
|
||||
Requires: openoffice.org-diafilter
|
||||
Suggests: libreoffice-writer2latex
|
||||
Suggests: openoffice.org-diafilter
|
||||
|
||||
%description
|
||||
unoconv converts between any document format that LibreOffice understands.
|
||||
It uses LibreOffice's UNO bindings for non-interactive conversion of
|
||||
documents.
|
||||
Universal Office Converter (unoconv) is a command line tool to convert any
|
||||
document format that LibreOffice can import to any document format that
|
||||
LibreOffice can export. It makes use of the LibreOffice's UNO bindings for
|
||||
non-interactive conversion of documents.
|
||||
|
||||
Supported document formats include Open Document Format (.odf), MS Word (.doc),
|
||||
MS Office Open/MS OOXML (.xml), Portable Document Format (.pdf), HTML, XHTML,
|
||||
RTF, Docbook (.xml), and more.
|
||||
Supported document formats include Open Document Format (.odg, .odp, .ods,
|
||||
.odt), MS Word (.doc), MS Office Open/MS OOXML (.docx, .pptx, .xlsx), PDF,
|
||||
HTML, RTF, and many more.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
rm doc/%{name}.1
|
||||
|
||||
%build
|
||||
make %{?_smp_mflags}
|
||||
asciidoc README.adoc
|
||||
|
||||
%install
|
||||
make install DESTDIR="%{buildroot}"
|
||||
make install DESTDIR="%{buildroot}" prefix=%{_prefix}
|
||||
|
||||
%files
|
||||
%doc AUTHORS ChangeLog COPYING README.asciidoc WISHLIST doc/*.txt tests/
|
||||
%doc AUTHORS ChangeLog README.html
|
||||
%doc doc/errcode.html doc/filters.html doc/formats.html doc/selinux.html
|
||||
%license COPYING
|
||||
%{_mandir}/man1/%{name}.1*
|
||||
%{_bindir}/%{name}
|
||||
|
||||
%changelog
|
||||
* Sat Apr 19 2014 David Tardon <dtardon@redhat.com> - 0.6-10
|
||||
- Resolves: rhbz#1076275 unoconv trips over '-f latex'
|
||||
- do not show unusable export formats
|
||||
|
||||
* Thu Apr 17 2014 David Tardon <dtardon@redhat.com> - 0.6-9
|
||||
- Resolves: rhbz#1076275 unonconv trips over '-f latex'
|
||||
|
||||
* Wed Feb 12 2014 David Tardon <dtardon@redhat.com> - 0.6-8
|
||||
- Resolves: rhbz#1047539 --stdout option does not work
|
||||
|
||||
* Thu Jan 30 2014 David Tardon <dtardon@redhat.com> - 0.6-7
|
||||
- pull in all libreoffice filters
|
||||
|
||||
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Tue Jul 23 2013 David Tardon <dtardon@redhat.com> - 0.6-5
|
||||
- Resolves: rhbz#987046 drop env from shebang
|
||||
|
||||
* Wed May 29 2013 David Tardon <dtardon@redhat.com> - 0.6-4
|
||||
- rhbz#957776 cannot open office documents
|
||||
|
||||
* Mon Apr 08 2013 David Tardon <dtardon@redhat.com> - 0.6-3
|
||||
- Resolves: rhbz#947096 unoconv doesn't work with Libreoffice 4.0
|
||||
|
||||
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Mon Nov 05 2012 David Tardon <dtardon@redhat.com> - 0.6-1
|
||||
- new upstream release
|
||||
|
||||
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Mon Mar 26 2012 David Tardon <dtardon@redhat.com> - 0.5-1
|
||||
- new upstream release
|
||||
|
||||
* Mon Mar 26 2012 David Tardon <dtardon@redhat.com> - 0.4-6
|
||||
|
||||
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Tue Nov 30 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 0.4-3
|
||||
- Add missing Requires on openoffice.org-brand/libreoffice-core. RHBZ#658576
|
||||
|
||||
* Sat Nov 13 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 0.4-2
|
||||
- Backport some upstream fixes (LD_LIBRARY_PATH issue and -o flag issue)
|
||||
|
||||
* Fri Nov 12 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 0.4-1
|
||||
- Update to 0.4
|
||||
|
||||
* Sat Oct 30 2010 Caolán McNamara <caolanm@redhat.com> - 0.3-5
|
||||
- rebuild for LibreOffice
|
||||
|
||||
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||
|
||||
* Thu May 07 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 0.3-3
|
||||
- Fix rpmlints
|
||||
- Prepare package for Fedora review
|
||||
|
||||
* Sun Feb 22 2009 Peter Hanecak <hany@hany.sk> 0.3-2
|
||||
- used %%{?dist} in release number
|
||||
- license GPLv2
|
||||
|
||||
* Wed Dec 19 2007 Dag Wieers <dag@wieers.com> - 0.3-2 - 5993+/dag
|
||||
- Fixed openoffice.org2 dependency on RHEL4.
|
||||
|
||||
* Sat Sep 01 2007 Dag Wieers <dag@wieers.com> - 0.3-1
|
||||
- Updated to release 0.3.
|
||||
|
||||
* Sun May 20 2007 Dag Wieers <dag@wieers.com> - 0.2-1
|
||||
- Updated to release 0.2.
|
||||
|
||||
* Sat May 19 2007 Dag Wieers <dag@wieers.com> - 0.1-1
|
||||
- Initial package. (using DAR)
|
||||
%autochangelog
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue