Author: bugman Date: Wed Feb 27 20:18:51 2013 New Revision: 18576 URL: http://svn.gna.org/viewcvs/relax?rev=18576&view=rev Log: The structure.web_of_motion user function can now handle file objects as well as file names as input. Modified: trunk/generic_fns/structure/main.py trunk/user_functions/structure.py Modified: trunk/generic_fns/structure/main.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/structure/main.py?rev=18576&r1=18575&r2=18576&view=diff ============================================================================== --- trunk/generic_fns/structure/main.py (original) +++ trunk/generic_fns/structure/main.py Wed Feb 27 20:18:51 2013 @@ -977,15 +977,17 @@ # Connect to the previous atoms. web.connect_atom(mol_name=mol1.mol_name, index1=index1, index2=index2) - # The file path. - file_path = get_file_path(file, dir) - - # Add '.pdb' to the end of the file path if it isn't there yet. - if not search(".pdb$", file_path): - file_path = file_path + '.pdb' + # Append the PDB extension if needed. + if isinstance(file, str): + # The file path. + file = get_file_path(file, dir) + + # Add '.pdb' to the end of the file path if it isn't there yet. + if not search(".pdb$", file): + file += '.pdb' # Open the file for writing. - file = open_write_file(file_path, force=force) + file = open_write_file(file, force=force) # Write the structure. web.write_pdb(file) Modified: trunk/user_functions/structure.py URL: http://svn.gna.org/viewcvs/relax/trunk/user_functions/structure.py?rev=18576&r1=18575&r2=18576&view=diff ============================================================================== --- trunk/user_functions/structure.py (original) +++ trunk/user_functions/structure.py Wed Feb 27 20:18:51 2013 @@ -844,7 +844,7 @@ uf.title_short = "Web of motion between models." uf.add_keyarg( name = "file", - py_type = "str", + py_type = "str_or_inst", arg_type = "file sel", desc_short = "file name", desc = "The name of the PDB file.",