Add root_dir() and assets_path() to paths module
A few more repo paths.
This commit is contained in:
parent
342a4af782
commit
6f8987d393
1 changed files with 19 additions and 2 deletions
|
|
@ -4,16 +4,33 @@
|
||||||
import os.path as osp
|
import os.path as osp
|
||||||
|
|
||||||
|
|
||||||
|
def root_dir() -> str:
|
||||||
|
'''Return the path to the root of the repository.'''
|
||||||
|
return osp.normpath(osp.join(osp.dirname(__file__), '..', '..'))
|
||||||
|
|
||||||
|
|
||||||
|
def assets_path() -> str:
|
||||||
|
'''Return the path to the assets directory.'''
|
||||||
|
path = osp.join(root_dir(), 'assets')
|
||||||
|
return path
|
||||||
|
|
||||||
|
|
||||||
def content_path() -> str:
|
def content_path() -> str:
|
||||||
'''Return the path to the content directory.'''
|
'''Return the path to the content directory.'''
|
||||||
path = osp.abspath(osp.join(osp.dirname(__file__), '..', '..', 'content'))
|
path = osp.join(root_dir(), 'content')
|
||||||
assert osp.isdir(path)
|
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
def blog_path() -> str:
|
def blog_path() -> str:
|
||||||
|
'''Return the path to the blog content directory.'''
|
||||||
return osp.join(content_path(), 'blog')
|
return osp.join(content_path(), 'blog')
|
||||||
|
|
||||||
|
|
||||||
def photos_path() -> str:
|
def photos_path() -> str:
|
||||||
|
'''Return the path to the photos content directory.'''
|
||||||
return osp.join(content_path(), 'photos')
|
return osp.join(content_path(), 'photos')
|
||||||
|
|
||||||
|
|
||||||
|
content_dir = content_path
|
||||||
|
blog_dir = blog_path
|
||||||
|
photos_dir = photos_path
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue