def parse_date(line=""): """ Parses the date from one line of log. :param <string> line: the line to be parsed. :return: <datetime> object representing the parsed date. """ date = util.parse_ha_date_from_line(line) return date.date()
def line_has_correct_date(self, line, exact_date): try: line_date = util.parse_ha_date_from_line(line) self.check_max_date(line_date.date()) if exact_date == line_date.date(): return True except: # some wrongly formatted line, just skip it return False
def line_has_correct_date(self, line, exact_date): try: line_date = util.parse_ha_date_from_line(line) self.check_max_date(line_date.date()) if exact_date == line_date.date(): return True except: # some wrongly formatted line, just skip it return False