コード例 #1
0
def _uno_struct__init__(self, *args, **kwargs):
    """Initializes a UNO struct.

    Referenced from the pyuno shared library.

    This function can be called with either an already constructed UNO struct, which it
    will then just reference without copying, or with arguments to create a new UNO struct.
    """

    # Check to see if this function was passed an existing UNO struct
    if len(kwargs) == 0 and len(args) == 1 and getattr(args[0], "__class__",
                                                       None) == self.__class__:
        self.__dict__['value'] = args[0]
    else:
        struct, used = pyuno._createUnoStructHelper(
            self.__class__.__pyunostruct__, args, **kwargs)

        for kwarg in kwargs.keys():
            if not used.get(kwarg):
                RuntimeException = pyuno.getClass(
                    "com.sun.star.uno.RuntimeException")
                raise RuntimeException(
                    "_uno_struct__init__: unused keyword argument '%s'." %
                    kwarg, None)

        self.__dict__["value"] = struct
コード例 #2
0
def _uno_struct__init__(self, *args):
    if len(args) == 1 and hasattr(
            args[0], "__class__") and args[0].__class__ == self.__class__:
        self.__dict__["value"] = args[0]
    else:
        self.__dict__["value"] = pyuno._createUnoStructHelper(
            self.__class__.__pyunostruct__, args)
コード例 #3
0
ファイル: uno.py プロジェクト: hbrls/openoffice-py-mockup
def _uno_struct__init__(self,*args, **kwargs):
    if len(kwargs) == 0 and len(args) == 1 and hasattr(args[0], "__class__") and args[0].__class__ == self.__class__ :
        self.__dict__["value"] = args[0]
    else:
        struct, used = pyuno._createUnoStructHelper(self.__class__.__pyunostruct__,args,**kwargs)
        for kw in kwargs.keys():
            if not (kw in used and used[kw]):
                RuntimeException = pyuno.getClass( "com.sun.star.uno.RuntimeException" )
                raise RuntimeException("_uno_struct__init__: unused keyword argument '" + kw + "'", None)
        self.__dict__["value"] = struct
コード例 #4
0
def _uno_struct__init__(self, *args, **kwargs):
    if len(kwargs) == 0 and len(args) == 1 and hasattr(
            args[0], "__class__") and args[0].__class__ == self.__class__:
        self.__dict__["value"] = args[0]
    else:
        struct, used = pyuno._createUnoStructHelper(
            self.__class__.__pyunostruct__, args, **kwargs)
        for kw in kwargs.keys():
            if not (kw in used and used[kw]):
                RuntimeException = pyuno.getClass(
                    "com.sun.star.uno.RuntimeException")
                raise RuntimeException(
                    "_uno_struct__init__: unused keyword argument '" + kw +
                    "'", None)
        self.__dict__["value"] = struct
コード例 #5
0
ファイル: uno.py プロジェクト: CloCkWeRX/core
def _uno_struct__init__(self, *args, **kwargs):
    """Initializes a UNO struct.

    Referenced from the pyuno shared library.

    This function can be called with either an already constructed UNO struct, which it
    will then just reference without copying, or with arguments to create a new UNO struct.
    """

    # Check to see if this function was passed an existing UNO struct
    if len(kwargs) == 0 and len(args) == 1 and getattr(args[0], "__class__", None) == self.__class__:
        self.__dict__['value'] = args[0]
    else:
        struct, used = pyuno._createUnoStructHelper(self.__class__.__pyunostruct__, args, **kwargs)

        for kwarg in kwargs.keys():
            if not used.get(kwarg):
                RuntimeException = pyuno.getClass("com.sun.star.uno.RuntimeException")
                raise RuntimeException("_uno_struct__init__: unused keyword argument '%s'." % kwarg, None)

        self.__dict__["value"] = struct
コード例 #6
0
ファイル: uno.py プロジェクト: beppec56/openoffice
def _uno_struct__init__(self,*args):
    if len(args) == 1 and hasattr(args[0], "__class__") and args[0].__class__ == self.__class__ :
        self.__dict__["value"] = args[0]
    else:
        self.__dict__["value"] = pyuno._createUnoStructHelper(self.__class__.__pyunostruct__,args)
コード例 #7
0
ファイル: uno.py プロジェクト: hanya/pyuno3
 def __init__(self, *args, **kwds):
     if len(args) == 1 and isinstance(args[0], self.__class__):
         value = args[0]
     else:
         value = pyuno._createUnoStructHelper(self.__class__.__pyunostruct__, args)
     self.__dict__["value"] = value