]>
Commit | Line | Data |
---|---|---|
ea8dab33 AM |
1 | From fc59dd90f03cf88f4cf16c07204809f2239284ee Mon Sep 17 00:00:00 2001 |
2 | From: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> | |
3 | Date: Thu, 20 Dec 2012 00:02:53 +0100 | |
4 | Subject: [PATCH] Add support for python3 | |
5 | ||
6 | Libreoffice 4.0 will switch its internal python version to 3.3.0 | |
7 | so it's to support that. | |
8 | ||
9 | Porting done automatically 2to3 plus print_function import added | |
10 | manually. Tested on both libreoffice master with internal python | |
11 | and with libreoffince 3.6.4 on debian with system python 2.7. | |
12 | ||
13 | This bumps the minimal python version to 2.6 since 2.5 does not | |
14 | have the print function. | |
15 | --- | |
16 | unoconv | 124 +++++++++++++++++++++++++++++++++------------------------------- | |
17 | 1 file changed, 63 insertions(+), 61 deletions(-) | |
18 | ||
19 | diff --git a/unoconv b/unoconv | |
20 | index 30e6706..f72cf08 100755 | |
21 | --- a/unoconv | |
22 | +++ b/unoconv | |
23 | @@ -1,4 +1,4 @@ | |
24 | -#!/usr/bin/env python | |
25 | +#!/usr/bin/env python3 | |
26 | ||
27 | ### This program is free software; you can redistribute it and/or modify | |
28 | ### it under the terms of the GNU General Public License as published by | |
29 | @@ -14,6 +14,8 @@ | |
30 | ### Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
31 | ### Copyright 2007-2010 Dag Wieers <dag@wieers.com> | |
32 | ||
33 | +from __future__ import print_function | |
34 | + | |
35 | from distutils.version import LooseVersion | |
36 | import getopt | |
37 | import glob | |
38 | @@ -77,11 +79,11 @@ def find_offices(): | |
39 | else: | |
40 | ||
41 | if os.name in ( 'nt', 'os2' ): | |
42 | - if 'PROGRAMFILES' in os.environ.keys(): | |
43 | + if 'PROGRAMFILES' in list(os.environ.keys()): | |
44 | extrapaths += glob.glob(os.environ['PROGRAMFILES']+'\\LibreOffice*') + \ | |
45 | glob.glob(os.environ['PROGRAMFILES']+'\\OpenOffice.org*') | |
46 | ||
47 | - if 'PROGRAMFILES(X86)' in os.environ.keys(): | |
48 | + if 'PROGRAMFILES(X86)' in list(os.environ.keys()): | |
49 | extrapaths += glob.glob(os.environ['PROGRAMFILES(X86)']+'\\LibreOffice*') + \ | |
50 | glob.glob(os.environ['PROGRAMFILES(X86)']+'\\OpenOffice.org*') | |
51 | ||
52 | @@ -233,18 +235,18 @@ def office_environ(office): | |
53 | ||
54 | def debug_office(): | |
55 | if 'URE_BOOTSTRAP' in os.environ: | |
56 | - print >>sys.stderr, 'URE_BOOTSTRAP=%s' % os.environ['URE_BOOTSTRAP'] | |
57 | + print('URE_BOOTSTRAP=%s' % os.environ['URE_BOOTSTRAP'], file=sys.stderr) | |
58 | if 'UNO_PATH' in os.environ: | |
59 | - print >>sys.stderr, 'UNO_PATH=%s' % os.environ['UNO_PATH'] | |
60 | + print('UNO_PATH=%s' % os.environ['UNO_PATH'], file=sys.stderr) | |
61 | if 'UNO_TYPES' in os.environ: | |
62 | - print >>sys.stderr, 'UNO_TYPES=%s' % os.environ['UNO_TYPES'] | |
63 | - print 'PATH=%s' % os.environ['PATH'] | |
64 | + print('UNO_TYPES=%s' % os.environ['UNO_TYPES'], file=sys.stderr) | |
65 | + print('PATH=%s' % os.environ['PATH']) | |
66 | if 'PYTHONHOME' in os.environ: | |
67 | - print >>sys.stderr, 'PYTHONHOME=%s' % os.environ['PYTHONHOME'] | |
68 | + print('PYTHONHOME=%s' % os.environ['PYTHONHOME'], file=sys.stderr) | |
69 | if 'PYTHONPATH' in os.environ: | |
70 | - print >>sys.stderr, 'PYTHONPATH=%s' % os.environ['PYTHONPATH'] | |
71 | + print('PYTHONPATH=%s' % os.environ['PYTHONPATH'], file=sys.stderr) | |
72 | if 'LD_LIBRARY_PATH' in os.environ: | |
73 | - print >>sys.stderr, 'LD_LIBRARY_PATH=%s' % os.environ['LD_LIBRARY_PATH'] | |
74 | + print('LD_LIBRARY_PATH=%s' % os.environ['LD_LIBRARY_PATH'], file=sys.stderr) | |
75 | ||
76 | def python_switch(office): | |
77 | if office.pythonhome: | |
78 | @@ -335,11 +337,11 @@ class FmtList: | |
79 | return ret | |
80 | ||
81 | def display(self, doctype): | |
82 | - print >>sys.stderr, "The following list of %s formats are currently available:\n" % doctype | |
83 | + print("The following list of %s formats are currently available:\n" % doctype, file=sys.stderr) | |
84 | for fmt in self.list: | |
85 | if fmt.doctype == doctype: | |
86 | - print >>sys.stderr, " %-8s - %s" % (fmt.name, fmt) | |
87 | - print >>sys.stderr | |
88 | + print(" %-8s - %s" % (fmt.name, fmt), file=sys.stderr) | |
89 | + print(file=sys.stderr) | |
90 | ||
91 | fmts = FmtList() | |
92 | ||
93 | @@ -530,14 +532,14 @@ class Options: | |
94 | 'outputpath', 'password=', 'pipe=', 'port=', 'server=', | |
95 | 'timeout=', 'show', 'stdout', 'template', 'verbose', | |
96 | 'version'] ) | |
97 | - except getopt.error, exc: | |
98 | - print 'unoconv: %s, try unoconv -h for a list of all the options' % str(exc) | |
99 | + except getopt.error as exc: | |
100 | + print('unoconv: %s, try unoconv -h for a list of all the options' % str(exc)) | |
101 | sys.exit(255) | |
102 | ||
103 | for opt, arg in opts: | |
104 | if opt in ['-h', '--help']: | |
105 | self.usage() | |
106 | ||
107 | + print() | |
108 | self.help() | |
109 | sys.exit(1) | |
110 | elif opt in ['-c', '--connection']: | |
111 | @@ -562,7 +564,7 @@ class Options: | |
112 | except ValueError: | |
113 | self.exportfilter.append( PropertyValue( name, 0, value, 0 ) ) | |
114 | else: | |
115 | - print >>sys.stderr, 'Warning: Option %s cannot be parsed, ignoring.' % arg | |
116 | + print('Warning: Option %s cannot be parsed, ignoring.' % arg, file=sys.stderr) | |
117 | elif opt in ['-f', '--format']: | |
118 | self.format = arg | |
119 | elif opt in ['-i', '--import']: | |
120 | @@ -581,7 +583,7 @@ class Options: | |
121 | except ValueError: | |
122 | self.importfilter.append( PropertyValue( name, 0, value, 0 ) ) | |
123 | else: | |
124 | - print >>sys.stderr, 'Warning: Option %s cannot be parsed, ignoring.' % arg | |
125 | + print('Warning: Option %s cannot be parsed, ignoring.' % arg, file=sys.stderr) | |
126 | elif opt in ['-l', '--listener']: | |
127 | self.listener = True | |
128 | elif opt in ['-n', '--no-launch']: | |
129 | @@ -589,7 +591,7 @@ class Options: | |
130 | elif opt in ['-o', '--output']: | |
131 | self.output = arg | |
132 | elif opt in ['--outputpath']: | |
133 | - print >>sys.stderr, 'Warning: This option is deprecated by --output.' | |
134 | + print('Warning: This option is deprecated by --output.', file=sys.stderr) | |
135 | self.output = arg | |
136 | elif opt in ['--password']: | |
137 | self.password = arg | |
138 | @@ -615,13 +617,13 @@ class Options: | |
139 | ||
140 | ### Enable verbosity | |
141 | if self.verbose >= 2: | |
142 | - print >>sys.stderr, 'Verbosity set to level %d' % self.verbose | |
143 | + print('Verbosity set to level %d' % self.verbose, file=sys.stderr) | |
144 | ||
145 | self.filenames = args | |
146 | ||
147 | if not self.listener and not self.showlist and self.doctype != 'list' and not self.filenames: | |
148 | - print >>sys.stderr, 'unoconv: you have to provide a filename as argument' | |
149 | - print >>sys.stderr, 'Try `unoconv -h\' for more information.' | |
150 | + print('unoconv: you have to provide a filename as argument', file=sys.stderr) | |
151 | + print('Try `unoconv -h\' for more information.', file=sys.stderr) | |
152 | sys.exit(255) | |
153 | ||
154 | ### Set connection string | |
155 | @@ -659,21 +661,21 @@ class Options: | |
156 | ### Get office product information | |
157 | product = uno.getComponentContext().ServiceManager.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product")) | |
158 | ||
159 | - print 'unoconv %s' % VERSION | |
160 | - print 'Written by Dag Wieers <dag@wieers.com>' | |
161 | - print 'Homepage at http://dag.wieers.com/home-made/unoconv/' | |
162 | ||
163 | - print 'platform %s/%s' % (os.name, sys.platform) | |
164 | - print 'python %s' % sys.version | |
165 | - print product.ooName, product.ooSetupVersion | |
166 | + print('unoconv %s' % VERSION) | |
167 | + print('Written by Dag Wieers <dag@wieers.com>') | |
168 | + print('Homepage at http://dag.wieers.com/home-made/unoconv/') | |
169 | + print() | |
170 | + print('platform %s/%s' % (os.name, sys.platform)) | |
171 | + print('python %s' % sys.version) | |
172 | + print(product.ooName, product.ooSetupVersion) | |
173 | ||
174 | # print 'build revision $Rev$' | |
175 | ||
176 | def usage(self): | |
177 | - print >>sys.stderr, 'usage: unoconv [options] file [file2 ..]' | |
178 | + print('usage: unoconv [options] file [file2 ..]', file=sys.stderr) | |
179 | ||
180 | def help(self): | |
181 | - print >>sys.stderr, '''Convert from and to any format supported by LibreOffice | |
182 | + print('''Convert from and to any format supported by LibreOffice | |
183 | ||
184 | unoconv options: | |
185 | -c, --connection=string use a custom connection string | |
186 | @@ -698,7 +700,7 @@ unoconv options: | |
187 | -t, --template=file import the styles from template (.ott) | |
188 | -T, --timeout=secs timeout after secs if connection to listener fails | |
189 | -v, --verbose be more and more verbose (-vvv for debugging) | |
190 | -''' | |
191 | +''', file=sys.stderr) | |
192 | ||
193 | class Convertor: | |
194 | def __init__(self): | |
195 | @@ -714,7 +716,7 @@ class Convertor: | |
196 | info(3, 'Connection type: %s' % op.connection) | |
197 | try: | |
198 | unocontext = resolver.resolve("uno:%s" % op.connection) | |
199 | - except NoConnectException, e: | |
200 | + except NoConnectException as e: | |
201 | # info(3, "Existing listener not found.\n%s" % e) | |
202 | info(3, "Existing listener not found.") | |
203 | ||
204 | @@ -749,7 +751,7 @@ class Convertor: | |
205 | raise | |
206 | else: | |
207 | error("Failed to connect to %s (pid=%s) in %d seconds.\n%s" % (office.binary, ooproc.pid, op.timeout, e)) | |
208 | - except Exception, e: | |
209 | + except Exception as e: | |
210 | raise | |
211 | error("Launch of %s failed.\n%s" % (office.binary, e)) | |
212 | ||
213 | @@ -799,9 +801,9 @@ class Convertor: | |
214 | ### No format found, throw error | |
215 | if not outputfmt: | |
216 | if doctype: | |
217 | - print >>sys.stderr, 'unoconv: format [%s/%s] is not known to unoconv.' % (op.doctype, op.format) | |
218 | + print('unoconv: format [%s/%s] is not known to unoconv.' % (op.doctype, op.format), file=sys.stderr) | |
219 | else: | |
220 | - print >>sys.stderr, 'unoconv: format [%s] is not known to unoconv.' % op.format | |
221 | + print('unoconv: format [%s] is not known to unoconv.' % op.format, file=sys.stderr) | |
222 | die(1) | |
223 | ||
224 | return outputfmt | |
225 | @@ -813,10 +815,10 @@ class Convertor: | |
226 | outputfmt = self.getformat(inputfn) | |
227 | ||
228 | if op.verbose > 0: | |
229 | - print >>sys.stderr, 'Input file:', inputfn | |
230 | + print('Input file:', inputfn, file=sys.stderr) | |
231 | ||
232 | if not os.path.exists(inputfn): | |
233 | - print >>sys.stderr, 'unoconv: file `%s\' does not exist.' % inputfn | |
234 | + print('unoconv: file `%s\' does not exist.' % inputfn, file=sys.stderr) | |
235 | exitcode = 1 | |
236 | ||
237 | try: | |
238 | @@ -854,7 +856,7 @@ class Convertor: | |
239 | templateurl = unohelper.absolutize(self.cwd, unohelper.systemPathToFileUrl(op.template)) | |
240 | document.StyleFamilies.loadStylesFromURL(templateurl, templateprops) | |
241 | else: | |
242 | - print >>sys.stderr, 'unoconv: template file `%s\' does not exist.' % op.template | |
243 | + print('unoconv: template file `%s\' does not exist.' % op.template, file=sys.stderr) | |
244 | exitcode = 1 | |
245 | ||
246 | ### Update document links | |
247 | @@ -924,40 +926,40 @@ class Convertor: | |
248 | ||
249 | try: | |
250 | document.storeToURL(outputurl, tuple(outputprops) ) | |
251 | - except IOException, e: | |
252 | + except IOException as e: | |
253 | raise UnoException("Unable to store document to %s (ErrCode %d)\n\nProperties: %s" % (outputurl, e.ErrCode, outputprops), None) | |
254 | ||
255 | phase = "dispose" | |
256 | document.dispose() | |
257 | document.close(True) | |
258 | ||
259 | - except SystemError, e: | |
260 | + except SystemError as e: | |
261 | error("unoconv: SystemError during %s phase:\n%s" % (phase, e)) | |
262 | exitcode = 1 | |
263 | ||
264 | - except RuntimeException, e: | |
265 | + except RuntimeException as e: | |
266 | error("unoconv: RuntimeException during %s phase:\nOffice probably died. %s" % (phase, e)) | |
267 | exitcode = 6 | |
268 | ||
269 | - except DisposedException, e: | |
270 | + except DisposedException as e: | |
271 | error("unoconv: DisposedException during %s phase:\nOffice probably died. %s" % (phase, e)) | |
272 | exitcode = 7 | |
273 | ||
274 | - except IllegalArgumentException, e: | |
275 | + except IllegalArgumentException as e: | |
276 | error("UNO IllegalArgument during %s phase:\nSource file cannot be read. %s" % (phase, e)) | |
277 | exitcode = 8 | |
278 | ||
279 | - except IOException, e: | |
280 | + except IOException as e: | |
281 | # for attr in dir(e): print '%s: %s', (attr, getattr(e, attr)) | |
282 | error("unoconv: IOException during %s phase:\n%s" % (phase, e.Message)) | |
283 | exitcode = 3 | |
284 | ||
285 | - except CannotConvertException, e: | |
286 | + except CannotConvertException as e: | |
287 | # for attr in dir(e): print '%s: %s', (attr, getattr(e, attr)) | |
288 | error("unoconv: CannotConvertException during %s phase:\n%s" % (phase, e.Message)) | |
289 | exitcode = 4 | |
290 | ||
291 | - except UnoException, e: | |
292 | + except UnoException as e: | |
293 | if hasattr(e, 'ErrCode'): | |
294 | error("unoconv: UnoException during %s phase in %s (ErrCode %d)" % (phase, repr(e.__class__), e.ErrCode)) | |
295 | exitcode = e.ErrCode | |
296 | @@ -982,7 +984,7 @@ class Listener: | |
297 | product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product")) | |
298 | try: | |
299 | unocontext = resolver.resolve("uno:%s" % op.connection) | |
300 | - except NoConnectException, e: | |
301 | + except NoConnectException as e: | |
302 | pass | |
303 | else: | |
304 | info(1, "Existing %s listener found, nothing to do." % product.ooName) | |
305 | @@ -991,25 +993,25 @@ class Listener: | |
306 | subprocess.call([office.binary, "-headless", "-invisible", "-nocrashreport", "-nodefault", "-nologo", "-nofirststartwizard", "-norestore", "-accept=%s" % op.connection], env=os.environ) | |
307 | else: | |
308 | subprocess.call([office.binary, "--headless", "--invisible", "--nocrashreport", "--nodefault", "--nologo", "--nofirststartwizard", "--norestore", "--accept=%s" % op.connection], env=os.environ) | |
309 | - except Exception, e: | |
310 | + except Exception as e: | |
311 | error("Launch of %s failed.\n%s" % (office.binary, e)) | |
312 | else: | |
313 | info(1, "Existing %s listener found, nothing to do." % product.ooName) | |
314 | ||
315 | def error(msg): | |
316 | "Output error message" | |
317 | - print >>sys.stderr, msg | |
318 | + print(msg, file=sys.stderr) | |
319 | ||
320 | def info(level, msg): | |
321 | "Output info message" | |
322 | if 'op' not in globals(): | |
323 | pass | |
324 | elif op.verbose >= 3 and level >= 3: | |
325 | - print >>sys.stderr, "DEBUG:", msg | |
326 | + print("DEBUG:", msg, file=sys.stderr) | |
327 | elif not op.stdout and level <= op.verbose: | |
328 | - print >>sys.stdout, msg | |
329 | + print(msg, file=sys.stdout) | |
330 | elif level <= op.verbose: | |
331 | - print >>sys.stderr, msg | |
332 | + print(msg, file=sys.stderr) | |
333 | ||
334 | def die(ret, msg=None): | |
335 | "Print optional error and exit with errorcode" | |
336 | @@ -1031,7 +1033,7 @@ def die(ret, msg=None): | |
337 | subprocess.Popen([office.binary, "--headless", "--invisible", "--nocrashreport", "--nodefault", "--nofirststartwizard", "--nologo", "--norestore", "--unaccept=%s" % op.connection], env=os.environ) | |
338 | ooproc.wait() | |
339 | info(2, '%s listener successfully disabled.' % product.ooName) | |
340 | - except Exception, e: | |
341 | + except Exception as e: | |
342 | error("Terminate using %s failed.\n%s" % (office.binary, e)) | |
343 | ||
344 | ### If there is no GUI attached to the instance, terminate instance | |
345 | @@ -1080,7 +1082,7 @@ def main(): | |
346 | for inputfn in op.filenames: | |
347 | convertor.convert(inputfn) | |
348 | ||
349 | - except NoConnectException, e: | |
350 | + except NoConnectException as e: | |
351 | error("unoconv: could not find an existing connection to LibreOffice at %s:%s." % (op.server, op.port)) | |
352 | if op.connection: | |
353 | 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)) | |
354 | @@ -1110,14 +1112,14 @@ if __name__ == '__main__': | |
355 | break | |
356 | except: | |
357 | # debug_office() | |
358 | - print >>sys.stderr, "unoconv: Cannot find a suitable pyuno library and python binary combination in %s" % of | |
359 | - print >>sys.stderr, "ERROR:", sys.exc_info()[1] | |
360 | - print >>sys.stderr | |
361 | + print("unoconv: Cannot find a suitable pyuno library and python binary combination in %s" % of, file=sys.stderr) | |
362 | + print("ERROR:", sys.exc_info()[1], file=sys.stderr) | |
363 | + print(file=sys.stderr) | |
364 | else: | |
365 | # debug_office() | |
366 | - print >>sys.stderr, "unoconv: Cannot find a suitable office installation on your system." | |
367 | - print >>sys.stderr, "ERROR: Please locate your office installation and send your feedback to:" | |
368 | - print >>sys.stderr, " http://github.com/dagwieers/unoconv/issues" | |
369 | + print("unoconv: Cannot find a suitable office installation on your system.", file=sys.stderr) | |
370 | + print("ERROR: Please locate your office installation and send your feedback to:", file=sys.stderr) | |
371 | + print(" http://github.com/dagwieers/unoconv/issues", file=sys.stderr) | |
372 | sys.exit(1) | |
373 | ||
374 | ### Now that we have found a working pyuno library, let's import some classes | |
375 | @@ -1160,6 +1162,6 @@ if __name__ == '__main__': | |
376 | ||
377 | try: | |
378 | main() | |
379 | - except KeyboardInterrupt, e: | |
380 | + except KeyboardInterrupt as e: | |
381 | die(6, 'Exiting on user request') | |
382 | die(exitcode) | |
383 | -- | |
384 | 1.8.1.6 | |
385 | ||
386 | Hide changes when converting a document. Closes: #624295. | |
387 | ||
388 | diff --git a/unoconv b/unoconv | |
389 | index 972e962..dd43884 100755 | |
390 | --- a/unoconv | |
391 | +++ b/unoconv | |
392 | @@ -882,6 +882,11 @@ class Convertor: | |
393 | info(2, "Selected office filter: %s" % outputfmt.filter) | |
394 | info(2, "Used doctype: %s" % outputfmt.doctype) | |
395 | ||
396 | + ### Document properties phase | |
397 | + phase = "properties" | |
398 | + if hasattr(document, 'ShowChanges'): | |
399 | + document.ShowChanges = False | |
400 | + | |
401 | ### Export phase | |
402 | phase = "export" | |
403 | ||
404 | Description: Fix spelling errors in unoconv.1 | |
405 | Forwarded: https://github.com/dagwieers/unoconv/pull/117 | |
406 | Author: Vincent Bernat <bernat@debian.org> | |
407 | Last-Update: 2013-02-18 | |
408 | ||
409 | Index: unoconv-0.6/doc/unoconv.1 | |
410 | =================================================================== | |
411 | --- unoconv-0.6.orig/doc/unoconv.1 2013-02-18 17:04:12.127613761 +1300 | |
412 | +++ unoconv-0.6/doc/unoconv.1 2013-02-18 17:04:33.479614342 +1300 | |
413 | @@ -222,7 +222,7 @@ | |
414 | .RE | |
415 | .\} | |
416 | .sp | |
417 | -For a list of posible encoding types, you can use the above link to find the possible options\&. | |
418 | +For a list of possible encoding types, you can use the above link to find the possible options\&. | |
419 | .sp | |
420 | .RS 4 | |
421 | .ie n \{\ | |
422 | @@ -278,7 +278,7 @@ | |
423 | .RE | |
424 | .\} | |
425 | .sp | |
426 | -For a list of posible encoding types, you can use the above link to find the possible options\&. | |
427 | +For a list of possible encoding types, you can use the above link to find the possible options\&. | |
428 | .sp | |
429 | .RS 4 | |
430 | .ie n \{\ | |
431 | @@ -339,7 +339,7 @@ | |
432 | .RE | |
433 | .\} | |
434 | .sp | |
435 | -For a list of posible encoding types, you can use the above link to find the possible options\&. | |
436 | +For a list of possible encoding types, you can use the above link to find the possible options\&. | |
437 | .sp | |
438 | .RS 4 | |
439 | .ie n \{\ | |
440 | Index: unoconv-0.6/doc/unoconv.1.txt | |
441 | =================================================================== | |
442 | --- unoconv-0.6.orig/doc/unoconv.1.txt 2013-02-18 17:04:12.127613761 +1300 | |
443 | +++ unoconv-0.6/doc/unoconv.1.txt 2013-02-18 17:04:42.235614582 +1300 | |
444 | @@ -134,7 +134,7 @@ | |
445 | ||
446 | -i FilterOptions=76 | |
447 | ||
448 | -For a list of posible encoding types, you can use the above link to find the | |
449 | +For a list of possible encoding types, you can use the above link to find the | |
450 | possible options. | |
451 | ||
452 | - FilterOptions | |
453 | @@ -165,7 +165,7 @@ | |
454 | ||
455 | -i FilterOptions=9/32,,9,2 | |
456 | ||
457 | -For a list of posible encoding types, you can use the above link to find the | |
458 | +For a list of possible encoding types, you can use the above link to find the | |
459 | possible options. | |
460 | ||
461 | - FilterOptions | |
462 | @@ -207,7 +207,7 @@ | |
463 | ||
464 | -e FilterOptions=9/32,,9 | |
465 | ||
466 | -For a list of posible encoding types, you can use the above link to find the | |
467 | +For a list of possible encoding types, you can use the above link to find the | |
468 | possible options. | |
469 | ||
470 | - FilterOptions | |
471 | From: Caolán McNamara <caolanm@redhat.com> | |
472 | Subject: Fix "can't write bytes direct to stdout in python3" | |
473 | Origin: https://github.com/caolanm/unoconv/commit/3249fd3df136f1a859ac0272f75fcbf010926d58 | |
474 | Forwarded: https://github.com/dagwieers/unoconv/pull/170 | |
475 | ||
476 | diff --git a/unoconv b/unoconv | |
477 | index a4f9490..2b0b0eb 100755 | |
478 | --- a/unoconv | |
479 | +++ b/unoconv | |
480 | @@ -1146,7 +1146,7 @@ if __name__ == '__main__': | |
481 | self.closed = 1 | |
482 | ||
483 | def writeBytes( self, seq ): | |
484 | - sys.stdout.write( seq.value ) | |
485 | + sys.stdout.buffer.write( seq.value ) | |
486 | ||
487 | def flush( self ): | |
488 | pass | |
489 | -- | |
490 | 1.8.5.1 | |
491 | ||
492 | From a59b9b05824868266dc0bc82518132942821515e Mon Sep 17 00:00:00 2001 | |
493 | From: Josias Montag <josias@montag.info> | |
494 | Date: Wed, 14 Aug 2013 12:51:04 +0200 | |
495 | Subject: [PATCH] add Microsoft Works (.wps) import filter | |
496 | ||
497 | --- | |
498 | unoconv | 1 + | |
499 | 1 file changed, 1 insertion(+) | |
500 | ||
501 | diff --git a/unoconv b/unoconv | |
502 | index a4f9490..7a4b89c 100755 | |
503 | --- a/unoconv | |
504 | +++ b/unoconv | |
505 | @@ -375,6 +375,7 @@ fmts.add('document', 'uot', 'uot', 'Unified Office Format text','UOF text') ### | |
506 | fmts.add('document', 'vor', 'vor', 'StarWriter 5.0 Template', 'StarWriter 5.0 Vorlage/Template') ### 6 | |
507 | fmts.add('document', 'vor4', 'vor', 'StarWriter 4.0 Template', 'StarWriter 4.0 Vorlage/Template') ### 5 | |
508 | fmts.add('document', 'vor3', 'vor', 'StarWriter 3.0 Template', 'StarWriter 3.0 Vorlage/Template') ### 4 | |
509 | +fmts.add('document', 'wps', 'wps', 'Microsoft Works', 'MS_Works') | |
510 | fmts.add('document', 'xhtml', 'html', 'XHTML Document', 'XHTML Writer File') ### 33 | |
511 | ||
512 | ### WebDocument | |
513 | -- | |
514 | 1.8.5.1 | |
515 | ||
516 | From 20b34c08622089c6b081c602a6428d6009aec0a3 Mon Sep 17 00:00:00 2001 | |
517 | From: Josias Montag <josias@montag.info> | |
518 | Date: Tue, 7 May 2013 12:40:47 +0300 | |
519 | Subject: [PATCH] Add XLSX support | |
520 | ||
521 | add the 'Calc MS Excel 2007 XML' (XLSX) export filter | |
522 | --- | |
523 | unoconv | 1 + | |
524 | 1 file changed, 1 insertion(+) | |
525 | ||
526 | diff --git a/unoconv b/unoconv | |
527 | index 30e6706..ea18a38 100755 | |
528 | --- a/unoconv | |
529 | +++ b/unoconv | |
530 | @@ -419,6 +419,7 @@ fmts.add('spreadsheet', 'xls95', 'xls', 'Microsoft Excel 95', 'MS Excel 95') ### | |
531 | fmts.add('spreadsheet', 'xlt', 'xlt', 'Microsoft Excel 97/2000/XP Template', 'MS Excel 97 Vorlage/Template') ### 6 | |
532 | fmts.add('spreadsheet', 'xlt5', 'xlt', 'Microsoft Excel 5.0 Template', 'MS Excel 5.0/95 Vorlage/Template') ### 28 | |
533 | fmts.add('spreadsheet', 'xlt95', 'xlt', 'Microsoft Excel 95 Template', 'MS Excel 95 Vorlage/Template') ### 21 | |
534 | +fmts.add('spreadsheet', 'xlsx', 'xlsx', 'Microsoft Excel 2007/2010 XML', 'Calc MS Excel 2007 XML') | |
535 | ||
536 | ### Graphics | |
537 | fmts.add('graphics', 'bmp', 'bmp', 'Windows Bitmap', 'draw_bmp_Export') ### 21 | |
538 | -- | |
539 | 1.8.5.1 | |
540 |