Author: bugman Date: Sat Sep 27 01:08:56 2008 New Revision: 7396 URL: http://svn.gna.org/viewcvs/relax?rev=7396&view=rev Log: Improvements to the from_xml() method. Modified: 1.3/generic_fns/structure/api_base.py Modified: 1.3/generic_fns/structure/api_base.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/api_base.py?rev=7396&r1=7395&r2=7396&view=diff ============================================================================== --- 1.3/generic_fns/structure/api_base.py (original) +++ 1.3/generic_fns/structure/api_base.py Sat Sep 27 01:08:56 2008 @@ -228,22 +228,14 @@ xml_to_object(str_node, self) # Now load the structure from file again. - failed = False - try: - self.load_pdb(file_path=self.path[0] + sep + self.file[0], model=None) - except RelaxFileError: - failed = True - - # Now load the structure from file again. - if failed: - failed = False - try: - self.load_pdb(file_path=self.file[0], model=None) - except RelaxFileError: - failed = True + loaded = self.load_pdb(file_path=self.path[0] + sep + self.file[0], model=None) + + # Try without the path to search for the file in the current directory. + if not loaded: + loaded = self.load_pdb(file_path=self.file[0], model=None) # Can't load the file. - if failed: + if not loaded: warn(RelaxWarning("The structure file " + `self.file[0]` + " cannot be found in the current directory or in " + `self.path[0]` + ". No data will be loaded."))