Author: bugman Date: Fri Aug 14 10:51:09 2009 New Revision: 9304 URL: http://svn.gna.org/viewcvs/relax?rev=9304&view=rev Log: Converted a number of flags from int to bool. 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=9304&r1=9303&r2=9304&view=diff ============================================================================== --- 1.3/prompt/interpreter.py (original) +++ 1.3/prompt/interpreter.py Fri Aug 14 10:51:09 2009 @@ -124,7 +124,7 @@ sys.ps3 = '\nrelax> ' # The function intro flag. - self.intro = 0 + self.intro = False # Python modules. self._pi = pi @@ -270,7 +270,7 @@ # Execute the script file if given. if script_file: # Turn on the function intro flag. - self.intro = 1 + self.intro = True # Run the script. return run_script(intro=self.__intro_string, local=self.local, script_file=script_file, quit=self.__quit_flag, show_script=self.__show_script, raise_relax_error=self.__raise_relax_error) @@ -300,7 +300,7 @@ print "Echoing of user function calls has been enabled." - def script(self, file=None, quit=0): + def script(self, file=None, quit=False): """Function for executing a script file.""" # File argument. @@ -314,17 +314,17 @@ raise RelaxError, "The script file '" + file + "' does not exist." # Quit argument. - if type(quit) != int or (quit != 0 and quit != 1): + if type(quit) != int or (quit != False and quit != True): raise RelaxBinError, ('quit', quit) # Turn on the function intro flag. - self.intro = 1 + self.intro = True # Execute the script. run_script(local=self.local, script_file=file, quit=quit) # Turn off the function intro flag. - self.intro = 0 + self.intro = False class _Exit: @@ -356,8 +356,8 @@ #signal.signal(2, 1) # Prompt. - more = 0 - while 1: + more = False + while True: try: if more: prompt = sys.ps2 @@ -373,7 +373,7 @@ except KeyboardInterrupt: self.write("\nKeyboardInterrupt\n") self.resetbuffer() - more = 0 + more = False def interact_script(self, intro=None, local={}, script_file=None, quit=True, show_script=True, raise_relax_error=False): @@ -406,7 +406,7 @@ sys.stdout.write("%s\n" % intro) # Turn the intro flag on so functions will print their intro strings. - local['self'].intro = 1 + local['self'].intro = True # Print the script. if show_script: