forked from openlp/openlp
Only import uno exceptions if not running Windoes
This commit is contained in:
parent
c8a896cedd
commit
cde0eb5ab5
@ -40,6 +40,7 @@ if os.name == u'nt':
|
|||||||
PAGE_BEFORE = 4
|
PAGE_BEFORE = 4
|
||||||
PAGE_AFTER = 5
|
PAGE_AFTER = 5
|
||||||
PAGE_BOTH = 6
|
PAGE_BOTH = 6
|
||||||
|
NoConnectException = Exception
|
||||||
else:
|
else:
|
||||||
import uno
|
import uno
|
||||||
from com.sun.star.connection import NoConnectException
|
from com.sun.star.connection import NoConnectException
|
||||||
|
@ -36,7 +36,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from oooimport import OooImport
|
from oooimport import OooImport
|
||||||
from com.sun.star.uno import RuntimeException
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -44,12 +44,14 @@ if os.name == u'nt':
|
|||||||
BOLD = 150.0
|
BOLD = 150.0
|
||||||
ITALIC = 2
|
ITALIC = 2
|
||||||
from oooimport import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH
|
from oooimport import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH
|
||||||
|
RuntimeException = Exception
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
from com.sun.star.awt.FontWeight import BOLD
|
from com.sun.star.awt.FontWeight import BOLD
|
||||||
from com.sun.star.awt.FontSlant import ITALIC
|
from com.sun.star.awt.FontSlant import ITALIC
|
||||||
from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, \
|
from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, \
|
||||||
PAGE_BOTH
|
PAGE_BOTH
|
||||||
|
from com.sun.star.uno import RuntimeException
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user