Author: bugman Date: Thu Jul 28 16:26:16 2011 New Revision: 13956 URL: http://svn.gna.org/viewcvs/relax?rev=13956&view=rev Log: The relax mode normally specified by the command line can now be overridden. Modified: 1.3/relax.py Modified: 1.3/relax.py URL: http://svn.gna.org/viewcvs/relax/1.3/relax.py?rev=13956&r1=13955&r2=13956&view=diff ============================================================================== --- 1.3/relax.py (original) +++ 1.3/relax.py Thu Jul 28 16:26:16 2011 @@ -66,16 +66,18 @@ putenv('PDBVIEWER', 'vmd') -def start(profile_flag=False): +def start(mode=None, profile_flag=False): """Execute relax. + @keyword mode: Force a relax mode, overriding the command line. + @type mode: str @keyword profile_flag: Change this flag to True for code profiling. @type profile_flag: bool """ # Normal relax operation. if not profile_flag: - Relax() + Relax(mode) # relax in profiling mode. else: @@ -89,7 +91,7 @@ # Run relax in profiling mode. profile.Profile.print_stats = print_stats - profile.run('Relax()') + profile.run('Relax(mode=%s)' % repr(mode)) @@ -100,8 +102,12 @@ whether debugging is turned on, etc. """ - def __init__(self): - """The top level class for initialising the program.""" + def __init__(self, mode=None): + """The top level class for initialising the program. + + @keyword mode: Force a relax mode, overriding the command line. + @type mode: str + """ # Get and store the PID of this process. self.pid = getpid() @@ -110,7 +116,8 @@ self.generic = generic_fns # Process the command line arguments and determine the relax mode. - mode, log_file, tee_file = self.arguments() + if not mode: + mode, log_file, tee_file = self.arguments() # Set up the warning system. relax_warnings.setup(self.pedantic)