コード例 #1
0
ファイル: operation.py プロジェクト: adajw/ConcurrenTree
	def __init__(self, instructions = [], protostring = None):
		''' If protostring is present, uses that existing serialized instruction set. If not, use instructions. '''
		if protostring:
			instructions = json.loads(protostring)
		try:
			self.instructions = instruction.set(instructions)
		except:
			raise ParseError()
コード例 #2
0
ファイル: operation.py プロジェクト: aral/ConcurrenTree
	def __init__(self, instructions = [], protostring = None): 
		# If protostring is present, uses that existing serialized instruction set. 
		# If not, use instructions.
		if type(instructions) == Operation:
			self.instructions = list(instructions.instructions)
		else:
			if protostring:
				instructions += json.loads(protostring)
			try:
				self.instructions = instruction.set(instructions)
			except:
				raise ParseError()
コード例 #3
0
 def __init__(self, instructions=[], protostring=None):
     # If protostring is present, uses that existing serialized instruction set.
     # If not, use instructions.
     if type(instructions) == Operation:
         self.instructions = list(instructions.instructions)
     else:
         if protostring:
             instructions += json.loads(protostring)
         try:
             self.instructions = instruction.set(instructions)
         except:
             raise ParseError()