mailr9703 - in /branches/bmrb: bmrblib/experimental_details/software.py generic_fns/bmrb_saveframes.py


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

Header


Content

Posted by edward on October 09, 2009 - 18:38:
Author: bugman
Date: Fri Oct  9 18:38:35 2009
New Revision: 9703

URL: http://svn.gna.org/viewcvs/relax?rev=9703&view=rev
Log:
Added the missing Task tag to the Software saveframe.


Modified:
    branches/bmrb/bmrblib/experimental_details/software.py
    branches/bmrb/generic_fns/bmrb_saveframes.py

Modified: branches/bmrb/bmrblib/experimental_details/software.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/bmrblib/experimental_details/software.py?rev=9703&r1=9702&r2=9703&view=diff
==============================================================================
--- branches/bmrb/bmrblib/experimental_details/software.py (original)
+++ branches/bmrb/bmrblib/experimental_details/software.py Fri Oct  9 
18:38:35 2009
@@ -53,7 +53,7 @@
         self.add_tag_categories()
 
 
-    def add(self, name, version=None, vendor_name=None, vendor_address=None, 
vendor_eaddress=None):
+    def add(self, name, version=None, vendor_name=None, vendor_address=None, 
vendor_eaddress=None, task=None):
         """Add the software info to the data nodes.
 
         @param name:                The name of the software program.
@@ -66,7 +66,13 @@
         @type vendor_address:       None or str
         @keyword vendor_eaddress:   The vendor electronic address.
         @type vendor_eaddress:      None or str
-        """
+        @keyword task:              The task of the software.
+        @type task:                 str
+        """
+
+        # Check.
+        if not isinstance(task, str):
+            raise NameError, "The task argument '%s' is invalid." % task
 
         # Place the args into the namespace.
         self.program_name = name
@@ -74,6 +80,7 @@
         self.vendor_name = [translate(vendor_name)]
         self.vendor_address = [translate(vendor_address)]
         self.vendor_eaddress = [translate(vendor_eaddress)]
+        self.task = [translate(task)]
 
         # Increment the ID number.
         self.software_num = self.software_num + 1
@@ -88,6 +95,7 @@
         # Create the tag categories.
         self.Software.create()
         self.Vendor.create()
+        self.Task.create()
 
         # Add the saveframe to the data nodes.
         self.datanodes.append(self.frame)
@@ -149,6 +157,38 @@
 
 class Task(TagCategory):
     """Base class for the Task tag category."""
+
+    def create(self):
+        """Create the Task tag category."""
+
+        # Keys and objects.
+        info = [
+            ['Task',                'task'],
+            ['SoftwareID',          'software_id_num']
+        ]
+
+        # Get the TabTable.
+        table = self.create_tag_table(info)
+
+        # Add the tagtable to the save frame.
+        self.sf.frame.tagtables.append(table)
+
+
+    def tag_setup(self, tag_category_label=None, sep=None):
+        """Replacement method for setting up the tag names.
+
+        @keyword tag_category_label:    The tag name prefix specific for the 
tag category.
+        @type tag_category_label:       None or str
+        @keyword sep:                   The string separating the tag name 
prefix and suffix.
+        @type sep:                      str
+        """
+
+        # Execute the base class tag_setup() method.
+        TagCategory.tag_setup(self, tag_category_label='Task', sep=sep)
+
+        # Tag names for the relaxation data.
+        self.tag_names['Task'] = 'Task'
+        self.tag_names['SoftwareID'] = 'SoftwareID'
 
 
 class Vendor(TagCategory):

Modified: branches/bmrb/generic_fns/bmrb_saveframes.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/generic_fns/bmrb_saveframes.py?rev=9703&r1=9702&r2=9703&view=diff
==============================================================================
--- branches/bmrb/generic_fns/bmrb_saveframes.py (original)
+++ branches/bmrb/generic_fns/bmrb_saveframes.py Fri Oct  9 18:38:35 2009
@@ -35,4 +35,4 @@
     """
 
     # The relax info.
-    star.software.add(name='relax', version=version, vendor_name='The relax 
development team', vendor_eaddress='http://nmr-relax.com')
+    star.software.add(name='relax', version=version, vendor_name='The relax 
development team', vendor_eaddress='http://nmr-relax.com', task='data 
processing')




Related Messages


Powered by MHonArc, Updated Fri Oct 09 19:00:02 2009