answered
2012-08-08 17:25:52 +0200
MikeW 56 ● 1 ● 6 It appears that Windows understands wildcards in a different way than Linux and so LibreOffice or even Python cannot utilize ("*.odg") in Windows without using the "glob" module. (It seems that Python's implementation of OS recognizes *.odg as a literal filename in Windows instead of a wildcard).
To solve this, I had to write a wrapper like the following:
matches = []
for root, dirnames, filenames in os.walk(os.getcwd()):
for filename in fnmatch.filter(filenames, '*.odg'):
matches.append(os.path.join(root, filename))
os.system("unoconv.py -f svg " + " ".join(matches))
I hope that helps others who encounter this same problem.
It looks like the '*' (asterisk) character was removed from my post somehow. I attempted to use wildcards with LibreOffice directly and then with unoconv but neither work in a Windows environment (specifically Win7 though I doubt that makes a difference).
MikeW ( 2012-07-30 15:52:19 +0200 )editHi @MikeW, I've updated the formatting in your post so that the asterisks are visible in the output.
qubit ( 2013-01-29 10:10:38 +0200 )edit