Kaydet (Commit) 293a1441 authored tarafından Xisco Fauli's avatar Xisco Fauli Kaydeden (comit) Michael Meeks

pyfax: Use relative imports so we can call the wizard remotely

Change-Id: I8ed98ff5125caf28680f94865ab2fe122f124182
Reviewed-on: https://gerrit.libreoffice.org/683Reviewed-by: 's avatarMichael Meeks <michael.meeks@suse.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@suse.com>
üst cf939a85
#!/usr/bin/env python
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from web.WWD_Events import WWD_Events
import sys
if __name__ == "__main__":
WWD_Events.main(sys.argv)
......@@ -17,8 +17,8 @@
#
import traceback
import inspect
from wizards.common.ConfigNode import *
from wizards.common.Configuration import Configuration
from .ConfigNode import *
from .Configuration import Configuration
class ConfigGroup(ConfigNode):
......
......@@ -16,8 +16,8 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
import traceback
from wizards.common.ConfigNode import *
from wizards.common.Configuration import Configuration
from .ConfigNode import *
from .Configuration import Configuration
class ConfigSet(ConfigNode):
'''
......
......@@ -15,10 +15,9 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
import uno
import traceback
from wizards.common.PropertyNames import PropertyNames
from wizards.common.Helper import *
from .PropertyNames import PropertyNames
from .Helper import *
'''
This class gives access to the OO configuration api.
......
......@@ -17,7 +17,7 @@
#
import uno
import traceback
from wizards.common.NoValidPathException import *
from .NoValidPathException import *
from com.sun.star.frame.FrameSearchFlag import ALL, PARENT
from com.sun.star.util import URL
......
......@@ -18,7 +18,7 @@
import traceback
import types
from os import path as osPath
from wizards.common.NoValidPathException import *
from .NoValidPathException import *
from com.sun.star.ucb import CommandAbortedException
from com.sun.star.awt.VclWindowPeerAttribute import OK, YES_NO
......
......@@ -18,7 +18,7 @@
import uno
import traceback
from datetime import date as DateTime
from wizards.common.NumberFormatter import NumberFormatter
from .NumberFormatter import NumberFormatter
from com.sun.star.uno import RuntimeException
......
......@@ -16,7 +16,7 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
import traceback
import uno
from com.sun.star.lang import Locale
from com.sun.star.util.NumberFormat import DATE, LOGICAL, DATETIME, TEXT, NUMBER
......
......@@ -15,8 +15,8 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from wizards.common.DebugHelper import *
from wizards.common.DebugHelper import *
from .DebugHelper import *
from .DebugHelper import *
class PropertySetHelper(object):
......
......@@ -16,8 +16,8 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
import traceback
from wizards.common.Configuration import Configuration
from wizards.common.SystemDialog import SystemDialog
from .Configuration import Configuration
from .SystemDialog import SystemDialog
from com.sun.star.awt.VclWindowPeerAttribute import OK
......
......@@ -17,9 +17,9 @@
#
import uno
import traceback
from wizards.common.Configuration import Configuration
from wizards.common.Desktop import Desktop
from wizards.common.Helper import Helper
from .Configuration import Configuration
from .Desktop import Desktop
from .Helper import Helper
from com.sun.star.ui.dialogs.TemplateDescription import FILESAVE_AUTOEXTENSION, FILEOPEN_SIMPLE
from com.sun.star.ui.dialogs.ExtendedFilePickerElementIds import CHECKBOX_AUTOEXTENSION
......
......@@ -18,8 +18,8 @@
import uno
import traceback
import unohelper
from wizards.ui.event.CommonListener import TerminateListenerProcAdapter
from wizards.common.Desktop import Desktop
from ..ui.event.CommonListener import TerminateListenerProcAdapter
from ..common.Desktop import Desktop
from com.sun.star.awt import WindowDescriptor
from com.sun.star.awt import Rectangle
......
......@@ -15,8 +15,8 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from wizards.common.ConfigGroup import *
from wizards.common.ConfigGroup import *
from ..common.ConfigGroup import *
from ..common.ConfigGroup import *
class CGFax(ConfigGroup):
......
......@@ -15,9 +15,9 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from wizards.common.ConfigGroup import *
from wizards.common.ConfigGroup import *
from wizards.fax.CGFax import CGFax
from .CGFax import CGFax
from ..common.ConfigGroup import *
from ..common.ConfigGroup import *
class CGFaxWizard(ConfigGroup):
......
......@@ -15,39 +15,38 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
# -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
import uno
import unohelper
import traceback
from .FaxWizardDialogImpl import FaxWizardDialogImpl
from com.sun.star.task import XJobExecutor
from wizards.fax.FaxWizardDialogImpl import FaxWizardDialogImpl
# implement a UNO component by deriving from the standard unohelper.Base class
# and from the interface(s) you want to implement.
class CallWizard(unohelper.Base, XJobExecutor):
def __init__(self, ctx):
# store the component context for later use
self.ctx = ctx
def __init__(self, ctx):
# store the component context for later use
self.ctx = ctx
def trigger(self, args):
try:
fw = FaxWizardDialogImpl(self.ctx.ServiceManager)
fw.startWizard(self.ctx.ServiceManager)
except Exception as e:
print ("Wizard failure exception " + str(type(e)) +
" message " + str(e) + " args " + str(e.args) +
traceback.format_exc());
def trigger(self, args):
print "hello"
try:
fw = FaxWizardDialogImpl(self.ctx.ServiceManager)
fw.startWizard(self.ctx.ServiceManager)
except Exception as e:
print ("Wizard failure exception " + str(type(e)) +
" message " + str(e) + " args " + str(e.args) +
traceback.format_exc())
# pythonloader looks for a static g_ImplementationHelper variable
g_ImplementationHelper = unohelper.ImplementationHelper()
g_ImplementationHelper.addImplementation( \
CallWizard, # UNO object class
"com.sun.star.wizards.fax.CallWizard", # implemenation name
("com.sun.star.task.Job",),) # list of implemented services
# (the only service)
CallWizard, # UNO object class
"com.sun.star.wizards.fax.CallWizard", # implemenation name
("com.sun.star.task.Job",),) # list of implemented services
# (the only service)
# vim:set shiftwidth=4 softtabstop=4 expandtab:
......@@ -15,10 +15,9 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from wizards.text.TextDocument import *
from wizards.text.TextDocument import *
from wizards.text.TextSectionHandler import TextSectionHandler
from wizards.common.PropertyNames import PropertyNames
from ..text.TextDocument import *
from ..text.TextSectionHandler import TextSectionHandler
from ..common.PropertyNames import PropertyNames
from com.sun.star.text.ControlCharacter import PARAGRAPH_BREAK
from com.sun.star.style.ParagraphAdjust import CENTER
......
......@@ -15,10 +15,9 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
import wizards.ui.UIConsts
from wizards.ui.WizardDialog import *
from wizards.fax.FaxWizardDialogResources import FaxWizardDialogResources
from wizards.fax.FaxWizardDialogConst import *
from .FaxWizardDialogResources import FaxWizardDialogResources
from .FaxWizardDialogConst import *
from ..ui.WizardDialog import *
from com.sun.star.awt.FontUnderline import SINGLE
......
......@@ -15,8 +15,7 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from wizards.common.HelpIds import HelpIds
from ..common.HelpIds import HelpIds
OPTBUSINESSFAX_ITEM_CHANGED = "optBusinessFaxItemChanged"
LSTBUSINESSSTYLE_ACTION_PERFORMED = None # "lstBusinessStyleActionPerformed"
......
......@@ -15,17 +15,16 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from wizards.fax.FaxWizardDialog import *
from wizards.fax.FaxWizardDialog import *
from wizards.fax.CGFaxWizard import *
from wizards.fax.FaxDocument import *
from wizards.ui.PathSelection import PathSelection
from wizards.common.FileAccess import FileAccess
from wizards.ui.event.UnoDataAware import UnoDataAware
from wizards.ui.event.RadioDataAware import RadioDataAware
from wizards.text.TextFieldHandler import TextFieldHandler
from wizards.common.SystemDialog import SystemDialog
from wizards.common.NoValidPathException import NoValidPathException
from .FaxWizardDialog import *
from .CGFaxWizard import *
from .FaxDocument import *
from ..ui.PathSelection import PathSelection
from ..common.FileAccess import FileAccess
from ..ui.event.UnoDataAware import UnoDataAware
from ..ui.event.RadioDataAware import RadioDataAware
from ..text.TextFieldHandler import TextFieldHandler
from ..common.SystemDialog import SystemDialog
from ..common.NoValidPathException import NoValidPathException
from com.sun.star.awt.VclWindowPeerAttribute import YES_NO, DEF_NO
from com.sun.star.uno import RuntimeException
......@@ -66,12 +65,8 @@ class FaxWizardDialogImpl(FaxWizardDialog):
"uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"
xLocMSF = Desktop.connect(ConnectStr)
lw = FaxWizardDialogImpl(xLocMSF)
lw.startWizard(xLocMSF, None)
except RuntimeException, e:
# TODO Auto-generated catch block
traceback.print_exc()
lw.startWizard(xLocMSF)
except Exception, e:
# TODO Auto-generated catch blocksetMaxStep
traceback.print_exc()
def startWizard(self, xMSF):
......
......@@ -15,7 +15,7 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from wizards.common.Resource import Resource
from ..common.Resource import Resource
class FaxWizardDialogResources(Resource):
MODULE_NAME = "dbw"
......
__all__ = ['CallWizard', 'CGFax', 'GCFaxWizard', 'FaxDocument', 'FaxWizardDialogConst',
'FaxWizardDialogImpl', 'FaxWizardDialog', 'FaxWizardDialogResources']
#!/usr/bin/env python
import uno
from fax.FaxWizardDialogImpl import FaxWizardDialogImpl
import sys
if __name__ == "__main__":
FaxWizardDialogImpl.main(sys.argv)
......@@ -19,12 +19,12 @@ import uno
import traceback
import time
from datetime import date as dateTimeObject
from wizards.common.Desktop import Desktop
from wizards.common.Helper import Helper
from wizards.document.OfficeDocument import OfficeDocument
from wizards.text.ViewHandler import ViewHandler
from wizards.text.TextFieldHandler import TextFieldHandler
from wizards.common.Configuration import Configuration
from .ViewHandler import ViewHandler
from .TextFieldHandler import TextFieldHandler
from ..common.Desktop import Desktop
from ..common.Helper import Helper
from ..document.OfficeDocument import OfficeDocument
from ..common.Configuration import Configuration
from com.sun.star.container import NoSuchElementException
from com.sun.star.lang import WrappedTargetException
......
......@@ -18,7 +18,7 @@
import traceback
import time
import unicodedata
from wizards.common.PropertyNames import PropertyNames
from ..common.PropertyNames import PropertyNames
from com.sun.star.util import DateTime
......
......@@ -17,7 +17,7 @@
#
import uno
import traceback
from wizards.common.Helper import Helper
from ..common.Helper import Helper
class TextSectionHandler(object):
'''Creates a new instance of TextSectionHandler'''
......
......@@ -16,10 +16,10 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from threading import RLock
from wizards.ui.PeerConfig import PeerConfig
from wizards.common.PropertyNames import *
from wizards.common.HelpIds import HelpIds
from wizards.common.Helper import Helper
from .PeerConfig import PeerConfig
from ..common.PropertyNames import *
from ..common.HelpIds import HelpIds
from ..common.Helper import Helper
from com.sun.star.awt import Size
......
......@@ -16,9 +16,9 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
import traceback
from wizards.common.PropertyNames import *
from wizards.common.FileAccess import *
from wizards.common.SystemDialog import SystemDialog
from ..common.PropertyNames import *
from ..common.FileAccess import *
from ..common.SystemDialog import SystemDialog
class PathSelection(object):
......
......@@ -15,7 +15,7 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from wizards.ui.event.CommonListener import WindowListenerProcAdapter
from .event.CommonListener import WindowListenerProcAdapter
'''
@author rpiterman
......
......@@ -17,10 +17,9 @@
#
import uno
import traceback
import wizards.ui.UIConsts
from wizards.common.PropertyNames import PropertyNames
from wizards.common.Helper import Helper
from wizards.ui.PeerConfig import PeerConfig
from .PeerConfig import PeerConfig
from ..common.PropertyNames import PropertyNames
from ..common.Helper import Helper
from com.sun.star.awt import Rectangle
from com.sun.star.awt.PosSize import POS
......
......@@ -15,11 +15,10 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from wizards.ui.UIConsts import *
from wizards.ui.UIConsts import *
from wizards.ui.UnoDialog import *
from wizards.ui.event.CommonListener import *
from wizards.common.Desktop import Desktop
from .UIConsts import *
from .UnoDialog import *
from .event.CommonListener import *
from ..common.Desktop import Desktop
'''
This class contains convenience methods for inserting components to a dialog.
......
......@@ -15,14 +15,13 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
import wizards.ui.UIConsts
from wizards.ui.UnoDialog2 import *
from abc import ABCMeta, abstractmethod
from wizards.common.Resource import Resource
from wizards.ui.XPathSelectionListener import XPathSelectionListener
from wizards.common.HelpIds import *
from wizards.document.OfficeDocument import OfficeDocument
from wizards.text.TextDocument import TextDocument
from .UnoDialog2 import *
from .XPathSelectionListener import XPathSelectionListener
from ..common.Resource import Resource
from ..common.HelpIds import *
from ..document.OfficeDocument import OfficeDocument
from ..text.TextDocument import TextDocument
from com.sun.star.lang import NoSuchMethodException
from com.sun.star.lang import IllegalArgumentException
......
......@@ -30,12 +30,10 @@
# Change Log
# Danny Brewer Revised 2004-06-05-01
#
#**********************************************************************
# OOo's libraries
import unohelper
from com.sun.star.awt import XActionListener
class ActionListenerProcAdapter( unohelper.Base, XActionListener ):
def __init__( self, oProcToCall, tParams=() ):
self.oProcToCall = oProcToCall # a python procedure
......
......@@ -17,8 +17,8 @@
#
import traceback
from abc import ABCMeta, abstractmethod
from wizards.common.PropertyNames import *
from wizards.ui.event.CommonListener import *
from .CommonListener import *
from ...common.PropertyNames import *
'''
@author rpiterman
......
......@@ -15,7 +15,7 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from wizards.common.Helper import Helper
from ...common.Helper import Helper
class ListModelBinder(object):
......
......@@ -15,15 +15,10 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from wizards.ui.event.DataAware import *
from wizards.ui.event.DataAware import *
from wizards.ui.event.UnoDataAware import *
import time
'''
@author rpiterman
To change the template for this generated type comment go to
Window>Preferences>Java>Code Generation>Code and Comments
'''
from .DataAware import *
from .DataAware import *
from .UnoDataAware import *
class RadioDataAware(DataAware):
......
......@@ -15,9 +15,9 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from wizards.ui.event.DataAware import *
from wizards.ui.event.DataAware import *
from wizards.common.Helper import *
from .DataAware import *
from .DataAware import *
from ...common.Helper import *
'''
@author rpiterman
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment