From cde0eb5ab571462751e6291317597aed4a86f331 Mon Sep 17 00:00:00 2001 From: Gerald Britton Date: Mon, 30 May 2011 17:15:34 -0400 Subject: [PATCH] Only import uno exceptions if not running Windoes --- openlp/plugins/songs/lib/oooimport.py | 1 + openlp/plugins/songs/lib/sofimport.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index ddbab8b31..fb6ee43a6 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -40,6 +40,7 @@ if os.name == u'nt': PAGE_BEFORE = 4 PAGE_AFTER = 5 PAGE_BOTH = 6 + NoConnectException = Exception else: import uno from com.sun.star.connection import NoConnectException diff --git a/openlp/plugins/songs/lib/sofimport.py b/openlp/plugins/songs/lib/sofimport.py index 5cc0482f2..7f0bed72b 100644 --- a/openlp/plugins/songs/lib/sofimport.py +++ b/openlp/plugins/songs/lib/sofimport.py @@ -36,7 +36,7 @@ import os import re from oooimport import OooImport -from com.sun.star.uno import RuntimeException + log = logging.getLogger(__name__) @@ -44,12 +44,14 @@ if os.name == u'nt': BOLD = 150.0 ITALIC = 2 from oooimport import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH + RuntimeException = Exception else: try: from com.sun.star.awt.FontWeight import BOLD from com.sun.star.awt.FontSlant import ITALIC from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, \ PAGE_BOTH + from com.sun.star.uno import RuntimeException except ImportError: pass