コード例 #1
0
ファイル: basic_tools.py プロジェクト: gic888/MIEN
	def setAttrib(self, a, v, inherit=False):
		'''set attributes key a to v, with cast to python datatypes'''
		if a=="Name":
			self.setName(v)
		else:	
			if not a in self.DONOTCONVERT:
				v=stringToType(v)
			BaseXMLObject.setAttrib(self, a, v, inherit)
コード例 #2
0
ファイル: basic_tools.py プロジェクト: gic888/MIEN
	def __init__(self, node, container=None):
		'''As the parent class method, but also casts attributes to 
python data types, and initializes _references'''
		BaseXMLObject.__init__(self, node, container)
		self.castAttributes()
		self._references=[]	
コード例 #3
0
ファイル: basic_tools.py プロジェクト: gic888/MIEN
	def initIsValid(self, node):
		return BaseXMLObject.initIsValid(self, node)
コード例 #4
0
ファイル: basic_tools.py プロジェクト: gic888/MIEN
	def __init__(self, node, container=None):
		BaseXMLObject.__init__(self, node, container)
		self.castAttributes()
コード例 #5
0
ファイル: basic_tools.py プロジェクト: gic888/MIEN
	def initIsValid(self, node):
		if not node['attributes'].get('Name'):
			node['attributes']['Name']="0"
			#print "Warning: <%s> initialized with no name. Added one." % (node['tag'],)
		return BaseXMLObject.initIsValid(self, node)