#--- import all of "engine_parts" sub-parts ---# from engine_parts import * #--- create new Indexer and add items ---# i = Indexer() i.name = "words" a = i.spawn("hello") ## be sure to save id's for later! b = i.spawn("world") # --- define Process callbacks --- # def print_indexer_name(i): print("-".join(['' for x in range(32)])) print(i.name) def prefix_value(v): prefix = "token: " print(prefix + str(v)) #--- define Process and Handler ---# p = Process(print_indexer_name,prefix_value,"PrintWordsProcess") h = Handler() #--- bind process to handle ---# c = h.indexers.spawn(i) d = h.processes.spawn(p) #--- define new Event object ---# e = Event("EngineEvent") #--- define aciton callback ---# def action_handle(index,eg): global h h.process() # --- define new Action object ---# act = Action(action_handle,"EngineAction") act.bind(e) #--- trigger event and therefore action ---# e.trigger(None)