aboutsummaryrefslogtreecommitdiffhomepage
path: root/libs/tld/helpers.py
blob: 6c1ad2387728d3b9fa5db651981f095541b8c0a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from os.path import abspath, join

from .conf import get_setting

__author__ = 'Artur Barseghyan'
__copyright__ = '2013-2020 Artur Barseghyan'
__license__ = 'MPL-1.1 OR GPL-2.0-only OR LGPL-2.1-or-later'
__all__ = (
    'project_dir',
    'PROJECT_DIR',
)


def project_dir(base: str) -> str:
    """Project dir."""
    tld_names_local_path_parent = get_setting('NAMES_LOCAL_PATH_PARENT')
    return abspath(
        join(tld_names_local_path_parent, base).replace('\\', '/')
    )


PROJECT_DIR = project_dir