import __builtin__ as builtins except: import builtins try: unicode bytes = str bytearray = str except NameError: unicode = str import socket # since on Windows sal3.dll no longer calls WSAStartup # all functions and variables starting with a underscore (_) must be considered private # and can be changed at any time. Don't use them _g_ctx = pyuno.getComponentContext( ) _g_delegatee = builtins.__dict__["__import__"] def getComponentContext(): """ returns the UNO component context, that was used to initialize the python runtime. """ return _g_ctx def getConstantByName( constant ): "Looks up the value of a idl constant by giving its explicit name" return pyuno.getConstantByName( constant ) def getTypeByName( typeName): """ returns a uno.Type instance of the type given by typeName. In case the type does not exist, a com.sun.star.uno.RuntimeException is raised. """
def setUp(self): self.xContext = pyuno.getComponentContext() pyuno.private_initTestEnvironment()
import warnings # since on Windows sal3.dll no longer calls WSAStartup import socket # Some Python 2/3 compatibility code copied from the six library PY2 = sys.version_info[0] == 2 if PY2: six_string_types = basestring, else: six_string_types = str, # All functions and variables starting with a underscore (_) must be # considered private and can be changed at any time. Don't use them. _component_context = pyuno.getComponentContext() def getComponentContext(): """Returns the UNO component context used to initialize the Python runtime.""" return _component_context def getCurrentContext(): """Returns the current context. See http://udk.openoffice.org/common/man/concept/uno_contexts.html#current_context for an explanation on the current context concept. """
try: import __builtin__ except ImportError: import builtins as __builtin__ try: unicode except NameError: # Python 3 compatibility unicode = str import socket # since on Windows sal3.dll no longer calls WSAStartup # all functions and variables starting with a underscore (_) must be considered private # and can be changed at any time. Don't use them _g_ctx = pyuno.getComponentContext() _g_delegatee = __builtin__.__dict__["__import__"] def getComponentContext(): """ returns the UNO component context, that was used to initialize the python runtime. """ return _g_ctx def getConstantByName(constant): "Looks up the value of a idl constant by giving its explicit name" return pyuno.getConstantByName(constant) def getTypeByName(typeName):
def setUp(self): self.xContext = pyuno.getComponentContext() global havePonies if not (havePonies): pyuno.private_initTestEnvironment() havePonies = True
def setUp(self): self.xContext = pyuno.getComponentContext() pyuno.experimentalExtraMagic()
def setUp(self): self.xContext = pyuno.getComponentContext() global havePonies if not(havePonies): pyuno.private_initTestEnvironment() havePonies = True
def get(self): """ Getter method for this singleton """ return pyuno.getComponentContext().getValueByName(self.name)