Utilities Classes¶
All following classes are defined in geekcms.utils.
Path Resolve¶
-
class
PathResolver¶ -
project_path¶ The path of project.
-
classmethod
set_project_path(cls, path)¶ Set the project_path with path.
-
classmethod
inputs(cls, *, ensure_exist=False)¶ Return the path of inputs directory of project. If ensure_exist is
Trueand the directory of inputs do not exist, then an empty directory would be created.
-
classmethod
outputs(cls, *, ensure_exist=False)¶ Return the path of outputs directory of project. If ensure_exist is
Trueand the directory of outputs do not exist, then an empty directory would be created.
-
classmethod
themes(cls, *, ensure_exist=False)¶ Return the path of themes directory of project. If ensure_exist is
Trueand the directory of themes do not exist, then an empty directory would be created.
-
classmethod
states(cls, *, ensure_exist=False)¶ Return the path of states directory of project. If ensure_exist is
Trueand the directory of states do not exist, then an empty directory would be created.
-
classmethod
theme_state(cls, theme_name, *, ensure_exist=False)¶ Return the path of directory contains state of theme. Such path is generated by joining
cls.states()and theme_name. If ensure_exist isTrueand the directory of theme’s state do not exist, then an empty directory would be created.
-
classmethod
theme_dir(cls, theme_name, *, ensure_exist=False)¶ Return the path of directory contains code of theme. Such path is generated by joining
cls.themes()and theme_name. If ensure_exist isTrueand the directory of theme’s dir do not exist, then an empty directory would be created.
-
PathResolver can be helpful for development,
with which developer could easily get the path of specific directory,
and create specific directory if such directory does not exist.