Author: bugman Date: Tue Nov 24 17:51:20 2009 New Revision: 9934 URL: http://svn.gna.org/viewcvs/relax?rev=9934&view=rev Log: More fixes for the __format_method() method. The methods with args and keywords are now properly formatted! Modified: 1.3/test_suite/unit_tests/_specific_fns/test_api.py Modified: 1.3/test_suite/unit_tests/_specific_fns/test_api.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_specific_fns/test_api.py?rev=9934&r1=9933&r2=9934&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/_specific_fns/test_api.py (original) +++ 1.3/test_suite/unit_tests/_specific_fns/test_api.py Tue Nov 24 17:51:20 2009 @@ -52,8 +52,12 @@ if defaults == None: defaults = () + # Counts. + num_args = len(args) - len(defaults) + num_kw = len(defaults) + # Args. - for i in xrange(len(args) - len(defaults)): + for i in range(num_args): # Separator. if i != 0: text = text + ', ' @@ -62,13 +66,13 @@ text = text + args[i] # Keyword args. - for j in xrange(i, len(defaults)+1): + for j in range(num_kw): # Separator. - if j != 0: + if num_args or j != 0: text = text + ', ' # The keyword. - text = text + args[j+1] + '=' + repr(defaults[j-i]) + text = text + args[num_args+j] + '=' + repr(defaults[j]) # End. text = text + ')'