mailr18729 - in /branches/frame_order_testing: ./ specific_fns/api_common.py


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

Header


Content

Posted by edward on March 09, 2013 - 11:49:
Author: bugman
Date: Sat Mar  9 11:49:07 2013
New Revision: 18729

URL: http://svn.gna.org/viewcvs/relax?rev=18729&view=rev
Log:
Merged revisions 18728 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r18728 | bugman | 2013-03-09 11:48:35 +0100 (Sat, 09 Mar 2013) | 5 lines
  
  All of the specific API data and error returning common methods can now 
handle missing data/errors.
  
  This affects the _return_data_relax_data() and _return_value_general() 
methods.
........

Modified:
    branches/frame_order_testing/   (props changed)
    branches/frame_order_testing/specific_fns/api_common.py

Propchange: branches/frame_order_testing/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Mar  9 11:49:07 2013
@@ -1,1 +1,1 @@
-/trunk:1-18726
+/trunk:1-18728

Modified: branches/frame_order_testing/specific_fns/api_common.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/specific_fns/api_common.py?rev=18729&r1=18728&r2=18729&view=diff
==============================================================================
--- branches/frame_order_testing/specific_fns/api_common.py (original)
+++ branches/frame_order_testing/specific_fns/api_common.py Sat Mar  9 
11:49:07 2013
@@ -236,7 +236,13 @@
         # Convert to a list.
         data = []
         for ri_id in cdp.ri_ids:
-            data.append(spin.ri_data[ri_id])
+            # Handle missing data.
+            if ri_id not in spin.ri_data:
+                data.append(None)
+
+            # Append the value.
+            else:
+                data.append(spin.ri_data[ri_id])
 
         # Return the list.
         return data
@@ -350,9 +356,18 @@
 
         # Dictionary object.
         if key:
-            value = value[key]
+            # Handle missing data.
+            if key not in value:
+                value = None
+            else:
+                value = value[key]
+
             if error:
-                error = error[key]
+                # Handle missing errors.
+                if key not in error:
+                    error = None
+                else:
+                    error = error[key]
 
         # Return the data.
         if sim == None:




Related Messages


Powered by MHonArc, Updated Sat Mar 09 12:00:02 2013