예제 #1
0
 def listing_functions(self):
     funcs = []
     for col in self.listing_columns:
         functree, pos = parse_function(col.function)
         assert pos == len(col.function)
         funcs.append((col, functree))
     return funcs
예제 #2
0
 def filter_functions(self):
     funcs = []
     for spec in self.filter_specs.values():
         if spec.name in ('f_comments', 'f_status', 'f_tags'):
             continue
         functree = parse_function(spec.function)
         funcs.append((spec, functree))
     return funcs
예제 #3
0
 def filter_functions(self):
     funcs = []
     for spec in self.filter_specs.values():
         if spec.name in ('comments', 'status', 'tags'):
             continue
         functree, pos = parse_function(spec.function)
         assert pos == len(spec.function)
         funcs.append((spec, functree))
     return funcs
예제 #4
0
def parse_summary(items):
    summary = []
    for item in items:
        functree, pos = parse_function(item.function)
        assert pos == len(item.function)
        dct = item._asdict()
        functree = flatten_syntax(functree)
        dct['function'] = functree
        summary.append(dct)
    return summary
예제 #5
0
 def summary_items(self):
     summary = []
     for line in self.section.listing_summary:
         item = make_summary_item(line)
         dct = item._asdict()
         functree = parse_function(item.function)
         try:
             functree = postprocess_functree(*functree)
         except ConfigError as exc:
             raise ConfigError(
                 f'Collection {self.name!r} listing_summary: {exc}'
             ) from None
         dct['function'] = functree
         summary.append(dct)
     return summary