mailr9509 - /1.3/generic_fns/state.py


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

Header


Content

Posted by edward on September 11, 2009 - 10:16:
Author: bugman
Date: Fri Sep 11 10:16:04 2009
New Revision: 9509

URL: http://svn.gna.org/viewcvs/relax?rev=9509&view=rev
Log:
Absorbed the load_xml() function into load_state().

After shifting the data store check to load_state() for all formats, the 
function only had one
statement.


Modified:
    1.3/generic_fns/state.py

Modified: 1.3/generic_fns/state.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/state.py?rev=9509&r1=9508&r2=9509&view=diff
==============================================================================
--- 1.3/generic_fns/state.py (original)
+++ 1.3/generic_fns/state.py Fri Sep 11 10:16:04 2009
@@ -116,9 +116,13 @@
     # Determine the format of the file.
     format = determine_format(file)
 
+    # Make sure that the data store is empty.
+    if not ds.is_empty():
+        raise RelaxError("The relax data store is not empty.")
+
     # XML state.
     if format == 'xml':
-        load_xml(file)
+        ds.from_xml(file)
 
     # Pickled state.
     elif format == 'pickle':
@@ -127,21 +131,6 @@
     # Bad state file.
     else:
         raise RelaxError("The saved state " + repr(state) + " is not 
compatible with this version of relax.")
-
-
-def load_xml(file):
-    """Load the program state from the XML file.
-
-    @param file:    The file object containing the relax state.
-    @type file:     file object
-    """
-
-    # Make sure that the data store is empty.
-    if not ds.is_empty():
-        raise RelaxError("The relax data store is not empty.")
-
-    # Load the XML.
-    ds.from_xml(file)
 
 
 def save_state(state=None, dir_name=None, compress_type=1, force=False, 
pickle=True):




Related Messages


Powered by MHonArc, Updated Fri Sep 11 10:40:02 2009