From babd86aa2b758536c010c73b6c3eea307551706c Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Sat, 5 Jan 2019 12:19:03 +1100 Subject: [PATCH] tools/spec: avoid block comment PEP8 warnings for subsections --- tools/spec.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tools/spec.py b/tools/spec.py index ac886c1..bc477f1 100644 --- a/tools/spec.py +++ b/tools/spec.py @@ -105,7 +105,7 @@ class AliasType(Type): return f"using {rename(self.name)} = {rename(self.target)};" -##----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- class AliasValue(Type): """ A value that is an alias for another value. @@ -124,14 +124,14 @@ class AliasValue(Type): } -##----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- class Placeholder(Type): def __init__(self, name: str): super().__init__(name) -##----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- class Unscoped(Type): def __init__(self, name: str): super().__init__(name) @@ -659,7 +659,7 @@ def parse_types(reg: Registry, root): reg.types[name].depends.append(t.attrib['requires']) -##----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- def parse_enums(reg: Registry, root): assert root.tag == 'enums' ownername = root.attrib['name'] @@ -676,7 +676,7 @@ def parse_enums(reg: Registry, root): owner[valuename] = Constant(node) -##----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- def parse_commands(reg: Registry, root): assert root.tag == 'commands' @@ -691,7 +691,7 @@ def parse_commands(reg: Registry, root): reg.types[name] = Command(node) -##----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- def parse_feature(reg: Registry, root): assert root.tag == 'feature' @@ -702,7 +702,7 @@ def parse_feature(reg: Registry, root): reg.types[name] = reg.features[name] -##----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- def parse_extensions(reg: Registry, root): assert root.tag == 'extensions' @@ -765,7 +765,7 @@ def write_header(path: str, q: List[Type], reg: Registry): """) -##----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- def write_icd(path: str, q: List[Type], reg: Registry): with open(path, 'w') as icd: commands = [i for i in q if isinstance(i, Command)] @@ -812,7 +812,7 @@ def write_icd(path: str, q: List[Type], reg: Registry): """) -##----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- def write_dispatch(path: str, q: List[Type], reg: Registry): with open(path, 'w') as dispatch: dispatch.write(""" @@ -883,7 +883,7 @@ def write_dispatch(path: str, q: List[Type], reg: Registry): import argparse -##----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- def main(): logging.getLogger().setLevel(logging.WARNING) @@ -939,6 +939,7 @@ def main(): write_icd(args.icd, q, reg) write_dispatch(args.dispatch, q, reg) -##----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- if __name__ == '__main__': main()