@@ -6,7 +6,7 @@ def __init__(self, eleType, eleId, concept, question, answer):
6
6
self .question = question
7
7
self .answer = answer
8
8
9
- def generatePropertiesDictionary (self ):
9
+ def generate_properties_dict (self ):
10
10
return {
11
11
'type' : self .eleType ,
12
12
'id' : self .eleId ,
@@ -16,7 +16,7 @@ def generatePropertiesDictionary(self):
16
16
}
17
17
18
18
@staticmethod
19
- def _validateAttributes (attrib ):
19
+ def _validate_attributes (attrib ):
20
20
if 'type' not in attrib :
21
21
raise Exception ('Element' , 'type' )
22
22
@@ -33,17 +33,17 @@ def _validateAttributes(attrib):
33
33
raise Exception ('Element' , 'answer' )
34
34
35
35
@staticmethod
36
- def createElement (attrib ):
37
- Element ._validateAttributes (attrib )
36
+ def create_element (attrib ):
37
+ Element ._validate_attributes (attrib )
38
38
39
39
if attrib ['type' ] == 'MULTI_SELECT' :
40
- return MultiSelectElement ._createElement (attrib )
40
+ return MultiSelectElement ._create_element (attrib )
41
41
if attrib ['type' ] == 'ENTRY' :
42
- return EntryElement ._createElement (attrib )
42
+ return EntryElement ._create_element (attrib )
43
43
if attrib ['type' ] == 'PICTURE' :
44
- return PictureElement ._createElement (attrib )
44
+ return PictureElement ._create_element (attrib )
45
45
if attrib ['type' ] == 'GPS' :
46
- return GPSElement ._createElement (attrib )
46
+ return GPSElement ._create_element (attrib )
47
47
48
48
raise Exception ('Element' , 'type' )
49
49
@@ -60,20 +60,20 @@ def __init__(self, eleId, concept, question, choices, answer):
60
60
61
61
self .choices = choices
62
62
63
- def generatePropertiesDictionary (self ):
64
- propDict = super (MultiSelectElement , self ).generatePropertiesDictionary ()
63
+ def generate_properties_dict (self ):
64
+ propDict = super (MultiSelectElement , self ).generate_properties_dict ()
65
65
propDict ['choices' ] = self .choices
66
66
67
67
return propDict
68
68
69
69
@staticmethod
70
- def _validateAttributes (attrib ):
70
+ def _validate_attributes (attrib ):
71
71
if 'choices' not in attrib :
72
72
raise Exception ('MultiSelectElement' , 'choices' )
73
73
74
74
@staticmethod
75
- def _createElement (attrib ):
76
- MultiSelectElement ._validateAttributes (attrib )
75
+ def _create_element (attrib ):
76
+ MultiSelectElement ._validate_attributes (attrib )
77
77
78
78
eleId = attrib ['id' ]
79
79
concept = attrib ['concept' ]
@@ -101,15 +101,15 @@ def __init__(self, eleId, concept, question, answer, numeric=None):
101
101
)
102
102
self .numeric = numeric
103
103
104
- def generatePropertiesDictionary (self ):
105
- propDict = super (EntryElement , self ).generatePropertiesDictionary ()
104
+ def generate_properties_dict (self ):
105
+ propDict = super (EntryElement , self ).generate_properties_dict ()
106
106
if self .numeric is not None :
107
107
propDict ['numeric' ] = self .numeric
108
108
109
109
return propDict
110
110
111
111
@staticmethod
112
- def _createElement (attrib ):
112
+ def _create_element (attrib ):
113
113
eleId = attrib ['id' ]
114
114
concept = attrib ['concept' ]
115
115
question = attrib ['question' ]
@@ -136,7 +136,7 @@ def __init__(self, eleId, concept, question, answer):
136
136
)
137
137
138
138
@staticmethod
139
- def _createElement (attrib ):
139
+ def _create_element (attrib ):
140
140
eleId = attrib ['id' ]
141
141
concept = attrib ['concept' ]
142
142
question = attrib ['question' ]
@@ -161,7 +161,7 @@ def __init__(self, eleId, concept, question, answer):
161
161
)
162
162
163
163
@staticmethod
164
- def _createElement (attrib ):
164
+ def _create_element (attrib ):
165
165
eleId = attrib ['id' ]
166
166
concept = attrib ['concept' ]
167
167
question = attrib ['question' ]
@@ -189,14 +189,14 @@ def __init__(self, title, author):
189
189
def __contains__ (self , page ):
190
190
return page in self .pages
191
191
192
- def generatePropertiesDictionary (self ):
192
+ def generate_properties_dict (self ):
193
193
return {
194
194
'title' : self .title ,
195
195
'author' : self .author
196
196
}
197
197
198
198
@staticmethod
199
- def createProcedure (attrib ):
199
+ def create_procedure (attrib ):
200
200
if 'title' not in attrib :
201
201
raise Exception ('Procedure' , 'title' )
202
202
0 commit comments