Ask Your Question

MikeW's profile - activity

2013-06-04 22:58:07 +0200 received badge  Famous Question (source)
2013-01-21 08:28:43 +0200 received badge  Notable Question (source)
2012-11-13 10:28:42 +0200 received badge  Popular Question (source)
2012-08-31 21:10:36 +0200 received badge  Nice Question (source)
2012-08-31 14:36:41 +0200 received badge  Nice Answer (source)
2012-08-16 09:57:26 +0200 received badge  Student (source)
2012-08-16 09:57:16 +0200 received badge  Self-Learner (source)
2012-08-16 09:57:16 +0200 received badge  Teacher (source)
2012-08-08 17:25:52 +0200 answered a question batch conversion with unoconv in Windows

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.

2012-07-30 15:52:19 +0200 commented question batch conversion with unoconv in Windows

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).

2012-07-25 02:37:48 +0200 asked a question batch conversion with unoconv in Windows

I tried to use unoconv to convert all odg documents in a folder to svg but it just dies with "cannot find file". Is there something I am missing to able to do this?

python unoconv.py -f svg *.odg
unoconv: file '*.odg' does not exist.