Esempio n. 1
0
	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()
Esempio n. 2
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()
Esempio n. 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()