(module_name, template)
| 63 | |
| 64 | |
| 65 | def _infer_path(module_name, template): |
| 66 | if template is None: |
| 67 | if CONFIG.pages_folder: |
| 68 | pages_module = str(Path(CONFIG.pages_folder).name) |
| 69 | path = ( |
| 70 | module_name.split(pages_module)[-1] |
| 71 | .replace("_", "-") |
| 72 | .replace(".", "/") |
| 73 | .lower() |
| 74 | ) |
| 75 | else: |
| 76 | path = module_name.replace("_", "-").replace(".", "/").lower() |
| 77 | else: |
| 78 | # replace the variables in the template with "none" to create a default path if |
| 79 | # no path is supplied |
| 80 | path = re.sub("<.*?>", "none", template) |
| 81 | path = "/" + path if not path.startswith("/") else path |
| 82 | return path |
| 83 | |
| 84 | |
| 85 | def _module_name_is_package(module_name): |
no test coverage detected
searching dependent graphs…