Skip to content
Snippets Groups Projects
Commit f0800c32 authored by James Michael DuPont's avatar James Michael DuPont
Browse files

Rewrote expression

Made a little simpler to understand

* scripts/parse_supported_params.py:
parent 22b53e4e
Branches
Tags
No related merge requests found
*.pyc
*~
#!/usr/bin/python3
# coding: utf-8
import argparse
import re
import sys
import urllib.request
from html_table_parser import HTMLTableParser
# Regex for parsing options on MySQL documentation pages
# Options are (normally) specified as command-line options
# as anchor tags on the page. Certain documentation pages only
......@@ -141,11 +144,16 @@ def print_yaml_options(sections, parser, file=sys.stdout):
A YAML library could be used, but we avoid extra dependencies by
just using string formatting.
"""
for section, url, yaml in sections:
options = parser(url, section)
print(yaml % {'section': section,
'options': '\n - '.join(options),
'url': url}, end='', file=file)
options_string = '\n - '.join(options)
string = yaml % {
'section': section,
'options': options_string,
'url': url
}
print(string,file=file,end= "")
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment