Esempio n. 1
0
    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.
    """
Esempio n. 2
0
 def setUp(self):
     self.xContext = pyuno.getComponentContext()
     pyuno.private_initTestEnvironment()
Esempio n. 3
0
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.
    """
Esempio n. 4
0
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):
Esempio n. 5
0
 def setUp(self):
     self.xContext = pyuno.getComponentContext()
     global havePonies
     if not (havePonies):
         pyuno.private_initTestEnvironment()
         havePonies = True
Esempio n. 6
0
 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
Esempio n. 8
0
 def setUp(self):
     self.xContext = pyuno.getComponentContext()
     pyuno.private_initTestEnvironment()
Esempio n. 9
0
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.
    """
Esempio n. 10
0
 def get(self):
     """ Getter method for this singleton """
     return pyuno.getComponentContext().getValueByName(self.name)