Example #1
0
    def __init__(self, *args, **kwargs):
        """
		handle=A Go-side object is always initialized with an explicit handle=arg
		"""
        if len(kwargs) == 1 and 'handle' in kwargs:
            self.handle = kwargs['handle']
            _parser.IncRef(self.handle)
        elif len(args) == 1 and isinstance(args[0], go.GoClass):
            self.handle = args[0].handle
            _parser.IncRef(self.handle)
        else:
            self.handle = 0
Example #2
0
    def __init__(self, *args, **kwargs):
        """
		handle=A Go-side object is always initialized with an explicit handle=arg
		otherwise parameter is a python list that we copy from
		"""
        self.index = 0
        if len(kwargs) == 1 and 'handle' in kwargs:
            self.handle = kwargs['handle']
            _parser.IncRef(self.handle)
        elif len(args) == 1 and isinstance(args[0], go.GoClass):
            self.handle = args[0].handle
            _parser.IncRef(self.handle)
        else:
            self.handle = _parser.Map_int64_int32_CTor()
            _parser.IncRef(self.handle)
            if len(args) > 0:
                if not isinstance(args[0], collections.Mapping):
                    raise TypeError(
                        'Map_int64_int32.__init__ takes a mapping as argument')
                for k, v in args[0].items():
                    _parser.Map_int64_int32_set(self.handle, k, v)
Example #3
0
    def __init__(self, *args, **kwargs):
        """
		handle=A Go-side object is always initialized with an explicit handle=arg
		otherwise parameter is a python list that we copy from
		"""
        self.index = 0
        if len(kwargs) == 1 and 'handle' in kwargs:
            self.handle = kwargs['handle']
            _parser.IncRef(self.handle)
        elif len(args) == 1 and isinstance(args[0], go.GoClass):
            self.handle = args[0].handle
            _parser.IncRef(self.handle)
        else:
            self.handle = _parser.Slice_Ptr_expr_Expr_CTor()
            _parser.IncRef(self.handle)
            if len(args) > 0:
                if not isinstance(args[0], collections.Iterable):
                    raise TypeError(
                        'Slice_Ptr_expr_Expr.__init__ takes a sequence as argument'
                    )
                for elt in args[0]:
                    self.append(elt)