## ecr.core.path

src/ecr/core/path.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    import os

    def getGlobalBasePath() -> str:
        return os.path.expanduser("~")

    def getMainPath(basepath: str)->str:
        return os.path.join(basepath, ".ecr")

    def getConfigPath(basepath: str) -> str:
        return os.path.join(getMainPath(basepath), "config.yml")

    def getExecutorPath(basepath: str) -> str:
        return os.path.join(getMainPath(basepath), "executor.yml")

    def getJudgerConfigPath(basepath: str) -> str:
        return os.path.join(getMainPath(basepath), "judger.yml")

    def getTemplateConfigPath(basepath: str) -> str:
        return os.path.join(getMainPath(basepath), "template.yml")

    def getTemplatePath(basepath: str) -> str:
        return os.path.join(getMainPath(basepath), "templates")

    def getJudgerPath(basepath: str) -> str:
        return os.path.join(getMainPath(basepath), "judgers")

    def getFileInputPath(basepath: str) -> str:
        return os.path.join(getMainPath(basepath), "input.data")

    def getFileOutputPath(basepath: str) -> str:
        return os.path.join(getMainPath(basepath), "output.data")

    def getFileStdPath(basepath: str) -> str:
        return os.path.join(getMainPath(basepath), "std.data")

    def getCodeDirConfigPath(basepath: str) -> str:
        return os.path.join(basepath, "config.yml")

    # def getCodeDirDataPath(basepath: str) -> str:
        # return os.path.join(basepath, "data")

    def getFileExt(filename: str) -> str:
        return os.path.splitext(filename)[1][1:]

    def getCoreJudgerPath() -> str:
        return os.path.join(os.path.dirname(os.path.dirname(__file__)), "data", "judgers")

    def getCoreTemplatePath() -> str:
        return os.path.join(os.path.dirname(os.path.dirname(__file__)), "data", "templates")