← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~j-corwin/openlp/present into lp:openlp

 

Jonathan Corwin has proposed merging lp:~j-corwin/openlp/present into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  #598361 AttributeError: 'NoneType' object has no attribute 'isPaused'
  https://bugs.launchpad.net/bugs/598361


Trap presentation errors when OpenOffice not installed
-- 
https://code.launchpad.net/~j-corwin/openlp/present/+merge/28602
Your team OpenLP Core is requested to review the proposed merge of lp:~j-corwin/openlp/present into lp:openlp.
=== modified file 'openlp/plugins/presentations/lib/impresscontroller.py'
--- openlp/plugins/presentations/lib/impresscontroller.py	2010-06-25 20:20:03 +0000
+++ openlp/plugins/presentations/lib/impresscontroller.py	2010-06-27 22:37:25 +0000
@@ -41,10 +41,15 @@
 
 if os.name == u'nt':
     from win32com.client import Dispatch
+    import pywintypes
 else:
-    import uno
-    from com.sun.star.beans import PropertyValue
-
+    try:
+        import uno
+        from com.sun.star.beans import PropertyValue
+        uno_available = True
+    except ImportError:
+        uno_available = False
+        
 from PyQt4 import QtCore
 
 from presentationcontroller import PresentationController, PresentationDocument
@@ -78,9 +83,7 @@
         if os.name == u'nt':
             return self.get_com_servicemanager() is not None
         else:
-            # If not windows, and we've got this far then probably
-            # installed else the import uno would likely have failed
-            return True
+            return uno_available
 
     def start_process(self):
         """
@@ -322,7 +325,10 @@
         Returns true if screen is blank
         """
         log.debug(u'is blank OpenOffice')
-        return self.control.isPaused()
+        if self.control:
+            return self.control.isPaused()
+        else:
+            return False
 
     def stop_presentation(self):
         log.debug(u'stop presentation OpenOffice')


Follow ups