dagwieers/unoconv — Issue #16: com.sun.star.beans.PropertyValue may not yet been imported when Options initializing
Author: metalman
Created: 2011-12-12 10:48:04+00:00
State: open

com.sun.star.beans.PropertyValue may not yet been imported when Options initializing.
git diff to fix it:
```patch
diff --git a/unoconv b/unoconv
index a4fa0d0..ba001ff 100755
--- a/unoconv
+++ b/unoconv
@@ -196,8 +196,7 @@ def python_switch(office):

os.environ['UNO_PATH'] = office.unopath

- if op.verbose > 0:
- print >>sys.stderr, "Switching from python %s to %s" % (sys.executable, office.python)
+ #print >>sys.stderr, "Switching from python %s to %s" % (sys.executable, office.python)
os.execvpe(office.python, [office.python, ] + sys.argv[0:], os.environ)

class Fmt:
@@ -882,8 +881,6 @@ def main():
if __name__ == '__main__':
exitcode = 0

- op = Options(sys.argv[1:])
-
for of in find_offices():
if sys.executable != of.python:
python_switch(of)
@@ -923,6 +920,8 @@ if __name__ == '__main__':
def flush( self ):
pass

+ op = Options(sys.argv[1:])
+
try:
main()
except KeyboardInterrupt, e:
```