コード例 #1
0
 def get_started(file, start):
     """
     Get the started line number from log.
     :param file: file
     :param start: time after start
     :return: int(line number)
     """
     if PlatformHelper.is_win():
         search_pattern = re.compile("^(.*\s.*)\s.*\.exe.*$", re.IGNORECASE)
     elif PlatformHelper.is_Linux():
         search_pattern = re.compile("^(.*)\.\d{6}.*$", re.IGNORECASE)
     indices = FileHelper.find_text_indices(file, search_pattern)
     return indices[0]
コード例 #2
0
    def get_backup_start(file):
        search_pattern = "start backup"
        if PlatformHelper.is_win():
            search_pattern = "Starting backup:"
        elif PlatformHelper.is_Linux():
            search_pattern = "Executing : start"
        elif PlatformHelper.is_mac():
            search_pattern = "Starting backup:"
        else:
            pass

        indices = FileHelper.find_text_indices(file, search_pattern)
        if indices:
            return indices[-1]