INNER CODE UNIT · Python
_infer_app_name
rio-labs/rio · rio/app.py:550
def _infer_app_name(self) -> str:
main_file_path = self._main_file_path
name = main_file_path.stem
if name in ("main", "__main__", "__init__"):
name = main_file_path.absolute().parent.name
return name.replace("_", " ").title()
def _infer_pages(self) -> list[rio.ComponentPage]:
pages_dir = self._base_dir_for_relative_paths / "pages"
# No `pages` folder exists? No pages, then.
if not pages_dir.exists():
return []
# In order to import the pages correctly correctly we must know the
# correct module name to use. We know that the `pages` folder is a