Author: bugman Date: Mon Jan 25 16:53:14 2010 New Revision: 10311 URL: http://svn.gna.org/viewcvs/relax?rev=10311&view=rev Log: Created the populate_self() method to place all user functions into the interpreter namespace. Modified: 1.3/prompt/interpreter.py Modified: 1.3/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/interpreter.py?rev=10311&r1=10310&r2=10311&view=diff ============================================================================== --- 1.3/prompt/interpreter.py (original) +++ 1.3/prompt/interpreter.py Mon Jan 25 16:53:14 2010 @@ -228,6 +228,14 @@ return objects + def populate_self(self): + """Place all user functions and other special objects into self.""" + + # Add the interpreter objects to the class namespace. + for name in self._locals.keys(): + setattr(self, name, self._locals[name]) + + def run(self, script_file=None): """Run the python interpreter.