Exemple #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']
            _common.IncRef(self.handle)
        elif len(args) == 1 and isinstance(args[0], go.GoClass):
            self.handle = args[0].handle
            _common.IncRef(self.handle)
        else:
            self.handle = 0
Exemple #2
0
    def __init__(self, *args, **kwargs):
        """
		handle=A Go-side object is always initialized with an explicit handle=arg
		otherwise parameters can be unnamed in order of field names or named fields
		in which case a new Go object is constructed first
		"""
        if len(kwargs) == 1 and 'handle' in kwargs:
            self.handle = kwargs['handle']
            _common.IncRef(self.handle)
        elif len(args) == 1 and isinstance(args[0], go.GoClass):
            self.handle = args[0].handle
            _common.IncRef(self.handle)
        else:
            self.handle = _common.common_SourceLocation_CTor()
            _common.IncRef(self.handle)
Exemple #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']
            _common.IncRef(self.handle)
        elif len(args) == 1 and isinstance(args[0], go.GoClass):
            self.handle = args[0].handle
            _common.IncRef(self.handle)
        else:
            self.handle = _common.Map_int64_int32_CTor()
            _common.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():
                    _common.Map_int64_int32_set(self.handle, k, v)
Exemple #4
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']
            _common.IncRef(self.handle)
        elif len(args) == 1 and isinstance(args[0], go.GoClass):
            self.handle = args[0].handle
            _common.IncRef(self.handle)
        else:
            self.handle = _common.Slice_Ptr_expr_Expr_CTor()
            _common.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)