| 1 | from string import Formatter |
| 2 | |
| 3 | |
| 4 | def get_path(route): |
| 5 | path_info = route.resource.get_info() |
| 6 | return path_info.get("path") or path_info.get("formatter") |
| 7 | |
| 8 | |
| 9 | def get_path_keys(path): |
| 10 | return [i[1] for i in Formatter().parse(path) if i[1]] |
| 11 | |
| 12 | |
| 13 | def issubclass_py37fix(cls, cls_info): |
| 14 | try: |
| 15 | return issubclass(cls, cls_info) |
| 16 | except TypeError: |
| 17 | return False |