Fix - parse header lines with no period
@@ -918,17 +918,32 @@ def configure_metadata_patterns(line, section_name):
unit_re = r"(?P<unit>([0-9]+\s)?[^\s]*)"
# Alternate regular expressions for special cases
+ name_missing_period_re = r"(?P<name>[^:]*):"
+ value_missing_period_re = r"(?P<value>.*)"
value_without_colon_delimiter_re = r"(?P<value>[^:]*)"
value_with_time_colon_re = (
r"(?P<value>.*?)(?:(?<!( [0-2][0-3]| hh| HH)):(?!([0-5][0-9]|mm|MM)))"
)
name_with_dots_re = r"\.?(?P<name>[^.].*[.])\."
no_desc_re = ""
+ no_unit_re = ""
# Configure special cases
- # 1. missing colon delimiter and description field
- # 2. double_dots '..' caused by mnemonic abbreviation (with period)
+ # 1. missing period (assume that only name and value are present)
+ # 2. missing colon delimiter and description field
+ # 3. double_dots '..' caused by mnemonic abbreviation (with period)
# next to the dot delimiter.
+ if ":" in line:
+ if not "." in line[:line.find(":")]:
+ # If there is no period, then we assume that the colon exists and
+ # everything on the left is the name, and everything on the right
+ # is the value - therefore no unit or description field.
+ name_re = name_missing_period_re
+ value_re = value_missing_period_re
+ desc_re = no_desc_re
+ unit_re = no_unit_re
+ value_with_time_colon_re = value_missing_period_re
+
if not ":" in line:
# If there isn't a colon delimiter then there isn't
# a description field either.
