Only import uno exceptions if not running Windoes

This commit is contained in:
Gerald Britton 2011-05-30 17:15:34 -04:00
parent c8a896cedd
commit cde0eb5ab5
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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