imp is deprecated since Python v.3.4
This avoid Python warnings about this during checks Change-Id: I6647d9c93f3c2fbc1af475f8bc45e03300ee8b79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100518 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
@@ -24,8 +24,16 @@ class AgendaWizardDialogResources(object):
|
|||||||
SECTION_MINUTES = "MINUTES"
|
SECTION_MINUTES = "MINUTES"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
import imp, os
|
import sys, os
|
||||||
imp.load_source('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc'))
|
|
||||||
|
# imp is deprecated since Python v.3.4
|
||||||
|
if sys.version_info >= (3,3):
|
||||||
|
from importlib.machinery import SourceFileLoader
|
||||||
|
SourceFileLoader('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc')).load_module()
|
||||||
|
else:
|
||||||
|
import imp
|
||||||
|
imp.load_source('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc'))
|
||||||
|
|
||||||
import strings
|
import strings
|
||||||
|
|
||||||
self.resAgendaWizardDialog_title = strings.RID_AGENDAWIZARDDIALOG_START_1
|
self.resAgendaWizardDialog_title = strings.RID_AGENDAWIZARDDIALOG_START_1
|
||||||
|
@@ -22,8 +22,16 @@ class NoValidPathException(Exception):
|
|||||||
# TODO: NEVER open a dialog in an exception
|
# TODO: NEVER open a dialog in an exception
|
||||||
from .SystemDialog import SystemDialog
|
from .SystemDialog import SystemDialog
|
||||||
if xMSF:
|
if xMSF:
|
||||||
import imp, os
|
import sys, os
|
||||||
imp.load_source('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc'))
|
|
||||||
|
# imp is deprecated since Python v.3.4
|
||||||
|
if sys.version_info >= (3,3):
|
||||||
|
from importlib.machinery import SourceFileLoader
|
||||||
|
SourceFileLoader('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc')).load_module()
|
||||||
|
else:
|
||||||
|
import imp
|
||||||
|
imp.load_source('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc'))
|
||||||
|
|
||||||
import strings
|
import strings
|
||||||
SystemDialog.showErrorBox(xMSF, strings.RID_COMMON_START_21) #OfficePathnotavailable
|
SystemDialog.showErrorBox(xMSF, strings.RID_COMMON_START_21) #OfficePathnotavailable
|
||||||
|
|
||||||
|
@@ -19,8 +19,16 @@
|
|||||||
class FaxWizardDialogResources(object):
|
class FaxWizardDialogResources(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
import imp, os
|
import sys, os
|
||||||
imp.load_source('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc'))
|
|
||||||
|
# imp is deprecated since Python v.3.4
|
||||||
|
if sys.version_info >= (3,3):
|
||||||
|
from importlib.machinery import SourceFileLoader
|
||||||
|
SourceFileLoader('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc')).load_module()
|
||||||
|
else:
|
||||||
|
import imp
|
||||||
|
imp.load_source('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc'))
|
||||||
|
|
||||||
import strings
|
import strings
|
||||||
|
|
||||||
self.resFaxWizardDialog_title = strings.RID_FAXWIZARDDIALOG_START_1
|
self.resFaxWizardDialog_title = strings.RID_FAXWIZARDDIALOG_START_1
|
||||||
|
@@ -19,8 +19,16 @@
|
|||||||
class LetterWizardDialogResources(object):
|
class LetterWizardDialogResources(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
import imp, os
|
import sys, os
|
||||||
imp.load_source('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc'))
|
|
||||||
|
# imp is deprecated since Python v.3.4
|
||||||
|
if sys.version_info >= (3,3):
|
||||||
|
from importlib.machinery import SourceFileLoader
|
||||||
|
SourceFileLoader('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc')).load_module()
|
||||||
|
else:
|
||||||
|
import imp
|
||||||
|
imp.load_source('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc'))
|
||||||
|
|
||||||
import strings
|
import strings
|
||||||
|
|
||||||
self.resLetterWizardDialog_title = strings.RID_LETTERWIZARDDIALOG_START_1
|
self.resLetterWizardDialog_title = strings.RID_LETTERWIZARDDIALOG_START_1
|
||||||
|
@@ -28,8 +28,16 @@ from com.sun.star.frame import TerminationVetoException
|
|||||||
from com.sun.star.awt.PushButtonType import HELP, STANDARD
|
from com.sun.star.awt.PushButtonType import HELP, STANDARD
|
||||||
from com.sun.star.awt.FontWeight import BOLD
|
from com.sun.star.awt.FontWeight import BOLD
|
||||||
|
|
||||||
import imp, os
|
import sys, os
|
||||||
imp.load_source('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc'))
|
|
||||||
|
# imp is deprecated since Python v.3.4
|
||||||
|
if sys.version_info >= (3,3):
|
||||||
|
from importlib.machinery import SourceFileLoader
|
||||||
|
SourceFileLoader('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc')).load_module()
|
||||||
|
else:
|
||||||
|
import imp
|
||||||
|
imp.load_source('strings', os.path.join(os.path.dirname(__file__), '../common/strings.hrc'))
|
||||||
|
|
||||||
import strings
|
import strings
|
||||||
|
|
||||||
class WizardDialog(UnoDialog2):
|
class WizardDialog(UnoDialog2):
|
||||||
|
Reference in New Issue
Block a user