1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """The method saveframe category.
24
25 For example, see http://www.bmrb.wisc.edu/dictionary/3.1html_frame/frame_SaveFramePage.html#method
26 """
27
28
29 from bmrblib.base_classes import BaseSaveframe, TagCategory, TagCategoryFree
30
31
33 """The method saveframe class."""
34
35
36 sf_label = 'method'
37
46
47
48
50 """Base class for the Method tag category."""
51
53 """Setup the Method tag category.
54
55 @param sf: The saveframe object.
56 @type sf: saveframe instance
57 """
58
59
60 super(Method, self).__init__(sf)
61
62
63 self.add(key='MethodID', tag_name='ID', var_name='count_str')
64 self.add(key='Details', tag_name='Details', var_name='details')
65
66
67
69 """Base class for the MethodCitation tag category."""
70
72 """Setup the MethodCitation tag category.
73
74 @param sf: The saveframe object.
75 @type sf: saveframe instance
76 """
77
78
79 super(MethodCitation, self).__init__(sf)
80
81
82 self.add(key='CitationID', tag_name='Citation_ID', var_name='cite_ids')
83 self.add(key='MethodID', tag_name='Method_ID', var_name='count_str')
84
85
87 """Check if the citation tag category is empty.
88
89 @return: The state of emptiness.
90 @rtype: bool
91 """
92
93
94 if not hasattr(self.sf, 'cite_ids') or not len(self.sf.cite_ids):
95 return True
96
97
98 return False
99
100
102 """Base class for the MethodFile tag category."""
103
105 """Setup the MethodFile tag category.
106
107 @param sf: The saveframe object.
108 @type sf: saveframe instance
109 """
110
111
112 super(MethodFile, self).__init__(sf)
113
114
115 self.add(key='Name', tag_name='Name', var_name='file_name', missing=False)
116 self.add(key='TextFormat', tag_name='Text_format', var_name='text_format')
117 self.add(key='Text', tag_name='Text', var_name='file_text', missing=False)
118 self.add(key='MethodID', tag_name='Method_ID', var_name='count_str')
119
120
121
123 """Base class for the MethodParam tag category."""
124
126 """Setup the MethodParam tag category.
127
128 @param sf: The saveframe object.
129 @type sf: saveframe instance
130 """
131
132
133 super(MethodParam, self).__init__(sf)
134
135
136 self.add(key='FileName', tag_name='File_name', var_name='param_file_name')
137 self.add(key='TextFormat', tag_name='Text_format', var_name='text_format')
138 self.add(key='Text', tag_name='Text', var_name='param_file_text')
139 self.add(key='MethodID', tag_name='Method_ID', var_name='count_str')
140