示例#1
0
文件: context.py 项目: beowulf11/glm
 def report_file_name(self) -> str:
     if not hasattr(self, "__report_file_name"):
         try:
             self.__report_file_name = read_line_file(
                 get_file_path(Filenames.REPORT_FILENAME.value))
         except FileNotFoundError:
             self.__report_file_name = "report.txt"
     return self.__report_file_name
示例#2
0
文件: context.py 项目: beowulf11/glm
 def remote_report_branch_name(self) -> str:
     if not hasattr(self, "__remote_report_branch_name"):
         try:
             self.__remote_report_branch_name = read_line_file(
                 get_file_path(Filenames.REMOTE_REPORT_BRANCH_NAME.value))
         except FileNotFoundError:
             self.__remote_report_branch_name = "report"
     return self.__remote_report_branch_name
示例#3
0
文件: context.py 项目: beowulf11/glm
    def template_repository_name(self) -> str:
        if (not hasattr(self, "__template_repository_name")
                or self.__template_repository_name is None):
            try:
                template_repository_name_file_path = get_file_path(
                    Filenames.TEMPLATE_REPOSITORY_NAME.value)
                template_repository_name = read_line_file(
                    template_repository_name_file_path)
            except FileNotFoundError:
                raise ConfigFileException(
                    "File 'template_repository_name' was not found",
                    "Create template_repository_name file in localconfig or config directory",
                    True,
                )
            self.__template_repository_name = template_repository_name

        return self.__template_repository_name
示例#4
0
文件: context.py 项目: beowulf11/glm
    def organization_name(self) -> str:
        if not hasattr(
                self,
                "__organization_name") or self.__organization_name is None:
            try:
                organization_name_file_path = get_file_path(
                    Filenames.ORGANIZATION_NAME.value)
                organization_name = read_line_file(organization_name_file_path)
                self.__organization_name = organization_name
            except FileNotFoundError:
                raise ConfigFileException(
                    "File 'organization_name' was not found",
                    "Create organization_name file in localconfig or config directory",
                    True,
                )

        return self.__organization_name
示例#5
0
文件: context.py 项目: beowulf11/glm
    def user_repository_prefix(self) -> str:
        if (not hasattr(self, "__user_repository_prefix")
                or self.__user_repository_prefix is None):
            try:
                user_repository_prefix_file_path = get_file_path(
                    Filenames.USER_REPOSITORY_PREFIX.value)
                user_repository_prefix = read_line_file(
                    user_repository_prefix_file_path)
            except FileNotFoundError:
                raise ConfigFileException(
                    "File 'user_repository_prefix' was not found",
                    "Create user_repository_prefix file in localconfig or config directory",
                    True,
                )

            self.__user_repository_prefix = user_repository_prefix

        return self.__user_repository_prefix