From a given filename, construct a key we use for api objects.
(filename)
| 108 | |
| 109 | |
| 110 | def _FileNameToKey(filename): |
| 111 | """From a given filename, construct a key we use for api objects.""" |
| 112 | |
| 113 | def _ReplaceDashWithCaps(matchobj): |
| 114 | match = matchobj.group(0) |
| 115 | return match[1].upper() |
| 116 | |
| 117 | base_filename = os.path.basename(filename) |
| 118 | base_filename_without_ext = os.path.splitext(base_filename)[0] |
| 119 | api_object_key = re.sub('((-[a-z]){1})', _ReplaceDashWithCaps, |
| 120 | base_filename_without_ext) |
| 121 | return api_object_key |
| 122 | |
| 123 | |
| 124 | def _VerifyNoSubclassOfMessageVisitor(path, parent, unused_children): |
no test coverage detected