File: gen_parser_list.py

package info (click to toggle)
hachoir 3.1.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 3,364 kB
  • sloc: python: 50,349; makefile: 129; sh: 26
file content (24 lines) | stat: -rwxr-xr-x 599 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python3
import os.path

def writeReadme(out):
    from hachoir.parser.parser_list import HachoirParserList

    # Write parser list
    format = "rest"
    if format == "rest":
        print("Parser list", file=out)
        print("===========", file=out)
        print(file=out)
    HachoirParserList().print_(out=out, format=format)

def main():
    path = os.path.dirname(__file__)
    filename = os.path.join(path, 'parser_list.rst')
    with open(filename, 'w') as readme:
        writeReadme(readme)
    print("%s regenerated" % filename)

if __name__ == "__main__":
    main()