Author: bugman Date: Thu Sep 27 16:14:47 2012 New Revision: 17574 URL: http://svn.gna.org/viewcvs/relax?rev=17574&view=rev Log: Removed the 'force flag' text from the RelaxWarning messages output by the bruker.read user function. The force flag arguments of the generic_fns.mol_res_spin.name_spin() and generic_fns.mol_res_spin.set_spin_isotope() functions can now be set to None to suppress the text. Modified: trunk/generic_fns/bruker.py trunk/generic_fns/mol_res_spin.py Modified: trunk/generic_fns/bruker.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/bruker.py?rev=17574&r1=17573&r2=17574&view=diff ============================================================================== --- trunk/generic_fns/bruker.py (original) +++ trunk/generic_fns/bruker.py Thu Sep 27 16:14:47 2012 @@ -190,11 +190,11 @@ # The labelling. elif row[0] == 'Labelling:': # Set the isotope value. - set_spin_isotope(isotope=row[1]) + set_spin_isotope(isotope=row[1], force=None) # Name the spins. name = split('([A-Z]+)', row[1])[1] - name_spin(name=name) + name_spin(name=name, force=None) # The integration method. elif row[0] == 'Used integrals:': Modified: trunk/generic_fns/mol_res_spin.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/mol_res_spin.py?rev=17574&r1=17573&r2=17574&view=diff ============================================================================== --- trunk/generic_fns/mol_res_spin.py (original) +++ trunk/generic_fns/mol_res_spin.py Thu Sep 27 16:14:47 2012 @@ -2193,8 +2193,8 @@ @type name: str @param pipe: The data pipe to operate on. Defaults to the current data pipe. @type pipe: str - @keyword force: A flag which if True will cause the named spin to be renamed. - @type force: bool + @keyword force: A flag which if True will cause the named spin to be renamed. If None, then the warning messages will not mention the need to change this flag to rename. + @type force: bool or None """ # The data pipe. @@ -2209,8 +2209,11 @@ try: # Rename the matching spins. for spin, id in spin_loop(spin_id, pipe=pipe, return_id=True): - if spin.name and not force: - warn(RelaxWarning("The spin '%s' is already named. Set the force flag to rename." % id)) + if spin.name and force != True: + if force == False: + warn(RelaxWarning("The spin '%s' is already named. Set the force flag to rename." % id)) + else: + warn(RelaxWarning("The spin '%s' is already named." % id)) else: spin.name = name @@ -3050,8 +3053,8 @@ @type isotope: str @param pipe: The data pipe to operate on. Defaults to the current data pipe. @type pipe: str - @keyword force: A flag which if True will cause the isotope type to be changed. - @type force: bool + @keyword force: A flag which if True will cause the isotope type to be changed. If None, then the warning messages will not mention the need to change this flag to rename. + @type force: bool or None """ # Types currently supported in relax. @@ -3081,8 +3084,11 @@ # Set the isotope type for the matching spins. for spin, id in spin_loop(spin_id, pipe=pipe, return_id=True): - if hasattr(spin, 'isotope') and spin.isotope and not force: - warn(RelaxWarning("The nuclear isotope type of the spin '%s' is already set. Change the force flag to True to reset." % id)) + if hasattr(spin, 'isotope') and spin.isotope and force != True: + if force == False: + warn(RelaxWarning("The nuclear isotope type of the spin '%s' is already set. Change the force flag to True to reset." % id)) + else: + warn(RelaxWarning("The nuclear isotope type of the spin '%s' is already set." % id)) else: spin.isotope = isotope