Module interpreter
[hide private]
[frames] | no frames]

Source Code for Module interpreter

 1  import code 
 2  import readline 
 3  from tab_completion import tab_completion 
 4   
 5  from macros import macros 
 6   
7 -class interpreter(macros):
8 - def __init__(self, relax):
9 "The top level class." 10 11 # Place the program class structure under self.relax 12 self.relax = relax 13 del relax 14 15 # Place the macros in the local namespace. 16 exit = self.exit 17 load = self.load 18 19 # Setup tab completion. 20 readline.set_completer(tab_completion(name_space=locals()).finish) 21 readline.parse_and_bind("tab: complete") 22 23 # Go to the prompt. 24 code.interact(banner=self.relax.intro_string, local=locals())
25