mailr7399 - in /1.3: data/__init__.py data/pipe_container.py generic_fns/results.py generic_fns/structure/api_base.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on September 27, 2008 - 01:45:
Author: bugman
Date: Sat Sep 27 01:45:19 2008
New Revision: 7399

URL: http://svn.gna.org/viewcvs/relax?rev=7399&view=rev
Log:
Propagation of the results file directory all the way through to the 
structure reading code.


Modified:
    1.3/data/__init__.py
    1.3/data/pipe_container.py
    1.3/generic_fns/results.py
    1.3/generic_fns/structure/api_base.py

Modified: 1.3/data/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/data/__init__.py?rev=7399&r1=7398&r2=7399&view=diff
==============================================================================
--- 1.3/data/__init__.py (original)
+++ 1.3/data/__init__.py Sat Sep 27 01:45:19 2008
@@ -160,11 +160,13 @@
         self.current_pipe = pipe_name
 
 
-    def from_xml(self, file, verbosity=1):
+    def from_xml(self, file, dir=None, verbosity=1):
         """Parse a XML document representation of a data pipe, and load it 
into the relax data store.
 
         @param file:        The open file object.
         @type file:         file
+        @keyword dir:       The name of the directory containing the results 
file.
+        @type dir:          str
         @keyword verbosity: A flag specifying the amount of information to 
print.  The higher the value,
                             the greater the verbosity.
         @type verbosity:    int
@@ -180,7 +182,7 @@
         relax_version = str(relax_node.getAttribute('version'))
 
         # Fill the pipe.
-        self[self.current_pipe].from_xml(relax_node)
+        self[self.current_pipe].from_xml(relax_node, dir=dir)
 
 
     def to_xml(self, file):

Modified: 1.3/data/pipe_container.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/data/pipe_container.py?rev=7399&r1=7398&r2=7399&view=diff
==============================================================================
--- 1.3/data/pipe_container.py (original)
+++ 1.3/data/pipe_container.py Sat Sep 27 01:45:19 2008
@@ -96,11 +96,13 @@
         return text
 
 
-    def from_xml(self, relax_node):
+    def from_xml(self, relax_node, dir=None):
         """Read a pipe container XML element and place the contents into 
this pipe.
 
         @param relax_node:  The relax XML node.
         @type relax_node:   xml.dom.minidom.Element instance
+        @keyword dir:       The name of the directory containing the results 
file.
+        @type dir:          str
         """
 
         # Test if empty.
@@ -159,7 +161,7 @@
 
             # Fill its contents.
             if not fail:
-                self.structure.from_xml(str_nodes[0])
+                self.structure.from_xml(str_nodes[0], dir=dir)
 
 
     def is_empty(self):

Modified: 1.3/generic_fns/results.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/results.py?rev=7399&r1=7398&r2=7399&view=diff
==============================================================================
--- 1.3/generic_fns/results.py (original)
+++ 1.3/generic_fns/results.py Sat Sep 27 01:45:19 2008
@@ -130,7 +130,7 @@
 
     # XML results.
     if format == 'xml':
-        read_function = ds.from_xml(file)
+        read_function = ds.from_xml(file, dir=directory)
 
     # Columnar results.
     elif format == 'columnar':

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=7399&r1=7398&r2=7399&view=diff
==============================================================================
--- 1.3/generic_fns/structure/api_base.py (original)
+++ 1.3/generic_fns/structure/api_base.py Sat Sep 27 01:45:19 2008
@@ -217,11 +217,13 @@
         raise RelaxImplementError
 
 
-    def from_xml(self, str_node):
+    def from_xml(self, str_node, dir=None):
         """Recreate the structural object from the XML structural object 
node.
 
         @param str_node:    The structural object XML node.
         @type str_node:     xml.dom.minicompat.Element instance
+        @keyword dir:       The name of the directory containing the results 
file.
+        @type dir:          str
         """
 
         # Recreate all the data structures.
@@ -233,6 +235,10 @@
         # 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)
+
+        # Try in the path of the results file.
+        if not loaded:
+            loaded = self.load_pdb(file_path=dir + sep + self.file[0], 
model=None)
 
         # Can't load the file.
         if not loaded:




Related Messages


Powered by MHonArc, Updated Sat Sep 27 14:20:02 2008