Converts `name` into the form expected for python-stix and python-cybox properties. This is used when attempting to access the property getter/setter via the __dict__ instance var entries. Example: >>> attr_name("id") 'id_' >>> attr_name("Title") 'ti
(name)
| 180 | |
| 181 | |
| 182 | def attr_name(name): |
| 183 | """Converts `name` into the form expected for python-stix and |
| 184 | python-cybox properties. |
| 185 | |
| 186 | This is used when attempting to access the property getter/setter via |
| 187 | the __dict__ instance var entries. |
| 188 | |
| 189 | Example: |
| 190 | >>> attr_name("id") |
| 191 | 'id_' |
| 192 | >>> attr_name("Title") |
| 193 | 'title |
| 194 | |
| 195 | """ |
| 196 | name = name.lower() |
| 197 | |
| 198 | if name.startswith("_"): |
| 199 | name = name[1:] |
| 200 | |
| 201 | if name in CONFLICTING_NAMES: |
| 202 | name += "_" |
| 203 | |
| 204 | return name |
| 205 | |
| 206 | |
| 207 | def key_name(name): |
no outgoing calls
no test coverage detected