Author: bugman
Date: Mon Jan 19 15:45:03 2009
New Revision: 8536
URL: http://svn.gna.org/viewcvs/relax?rev=8536&view=rev
Log:
Fixes for the Base_struct_API.from_xml() method.
Modified:
branches/multi_structure/generic_fns/structure/api_base.py
Modified: branches/multi_structure/generic_fns/structure/api_base.py
URL:
http://svn.gna.org/viewcvs/relax/branches/multi_structure/generic_fns/structure/api_base.py?rev=8536&r1=8535&r2=8536&view=diff
==============================================================================
--- branches/multi_structure/generic_fns/structure/api_base.py (original)
+++ branches/multi_structure/generic_fns/structure/api_base.py Mon Jan 19
15:45:03 2009
@@ -182,40 +182,44 @@
@type dir: str
"""
+ # Recreate the model / molecule data structure.
+ model_nodes = str_node.getElementsByTagName('model')
+ self.structural_data.from_xml(model_nodes)
+
# Recreate all the data structures.
- xml_to_object(str_node, self)
+ #xml_to_object(str_node, self)
# Loop over the structures and load them.
- for i in xrange(self.num):
- # Load the structure from file and path.
- if self.path[i]:
- try:
- loaded = self.load_pdb(file_path=self.path[i] + sep +
self.file[i], model=None, struct_index=i)
- except RelaxError:
- loaded = False
- else:
- loaded = False
-
- # Try without the path to search for the file in the current
directory.
- if not loaded:
- try:
- loaded = self.load_pdb(file_path=self.file[i], model=None,
struct_index=i)
- except RelaxError:
- loaded = False
-
- # Try in the path of the results file.
- if not loaded:
- try:
- loaded = self.load_pdb(file_path=dir + sep + self.file[i],
model=None, struct_index=i)
- except RelaxError:
- loaded = False
-
- # Can't load the file.
- if not loaded:
- if self.path[i]:
- warn(RelaxWarning("The structure file " + `self.file[i]` +
" cannot be found in the current directory, the directory of the results file
or in the directory" + `self.path[i]` + "."))
- else:
- warn(RelaxWarning("The structure file " + `self.file[i]` +
" cannot be found in the current directory or the directory of the results
file."))
+ #for i in xrange(self.num):
+ # # Load the structure from file and path.
+ # if self.path[i]:
+ # try:
+ # loaded = self.load_pdb(file_path=self.path[i] + sep +
self.file[i], model=None, struct_index=i)
+ # except RelaxError:
+ # loaded = False
+ # else:
+ # loaded = False
+
+ # # Try without the path to search for the file in the current
directory.
+ # if not loaded:
+ # try:
+ # loaded = self.load_pdb(file_path=self.file[i],
model=None, struct_index=i)
+ # except RelaxError:
+ # loaded = False
+
+ # # Try in the path of the results file.
+ # if not loaded:
+ # try:
+ # loaded = self.load_pdb(file_path=dir + sep +
self.file[i], model=None, struct_index=i)
+ # except RelaxError:
+ # loaded = False
+
+ # # Can't load the file.
+ # if not loaded:
+ # if self.path[i]:
+ # warn(RelaxWarning("The structure file " + `self.file[i]`
+ " cannot be found in the current directory, the directory of the results file
or in the directory" + `self.path[i]` + "."))
+ # else:
+ # warn(RelaxWarning("The structure file " + `self.file[i]`
+ " cannot be found in the current directory or the directory of the results
file."))
def get_model(self, model):
_______________________________________________
relax (http://nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits