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()
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()
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()