Exemplo n.º 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']
			_interpreter.IncRef(self.handle)
		elif len(args) == 1 and isinstance(args[0], go.GoClass):
			self.handle = args[0].handle
			_interpreter.IncRef(self.handle)
		else:
			self.handle = 0
Exemplo n.º 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']
			_interpreter.IncRef(self.handle)
		elif len(args) == 1 and isinstance(args[0], go.GoClass):
			self.handle = args[0].handle
			_interpreter.IncRef(self.handle)
		else:
			self.handle = _interpreter.interpreter_AttributeQualifierPattern_CTor()
			_interpreter.IncRef(self.handle)
Exemplo n.º 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']
			_interpreter.IncRef(self.handle)
		elif len(args) == 1 and isinstance(args[0], go.GoClass):
			self.handle = args[0].handle
			_interpreter.IncRef(self.handle)
		else:
			self.handle = _interpreter.Slice_Ptr_expr_Type_CTor()
			_interpreter.IncRef(self.handle)
			if len(args) > 0:
				if not isinstance(args[0], collections.Iterable):
					raise TypeError('Slice_Ptr_expr_Type.__init__ takes a sequence as argument')
				for elt in args[0]:
					self.append(elt)