예제 #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']
			_cel.IncRef(self.handle)
		elif len(args) == 1 and isinstance(args[0], go.GoClass):
			self.handle = args[0].handle
			_cel.IncRef(self.handle)
		else:
			self.handle = 0
예제 #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']
			_cel.IncRef(self.handle)
		elif len(args) == 1 and isinstance(args[0], go.GoClass):
			self.handle = args[0].handle
			_cel.IncRef(self.handle)
		else:
			self.handle = _cel.cel_Env_CTor()
			_cel.IncRef(self.handle)
예제 #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']
			_cel.IncRef(self.handle)
		elif len(args) == 1 and isinstance(args[0], go.GoClass):
			self.handle = args[0].handle
			_cel.IncRef(self.handle)
		else:
			self.handle = _cel.Map_int64_int32_CTor()
			_cel.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():
					_cel.Map_int64_int32_set(self.handle, k, v)
예제 #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']
			_cel.IncRef(self.handle)
		elif len(args) == 1 and isinstance(args[0], go.GoClass):
			self.handle = args[0].handle
			_cel.IncRef(self.handle)
		else:
			self.handle = _cel.Slice_Ptr_interpreter_AttributeQualifierPattern_CTor()
			_cel.IncRef(self.handle)
			if len(args) > 0:
				if not isinstance(args[0], collections.Iterable):
					raise TypeError('Slice_Ptr_interpreter_AttributeQualifierPattern.__init__ takes a sequence as argument')
				for elt in args[0]:
					self.append(elt)