fixing some issues with the configuration table generator

This commit is contained in:
kakwa 2016-09-10 03:22:04 +02:00
parent 0278c1e65f
commit 4375280ce1
2 changed files with 35 additions and 30 deletions

View File

@ -123,7 +123,7 @@ Main configuration section (mostly http configuration).
| throttle | Limit download speed for clients. | \*=0 |
| | | |
| | throttle is a comma-separated list of key=value pairs: | |
| | - * -> limit speed for all connections | |
| | - \* -> limit speed for all connections | |
| | - x.x.x.x/mask -> limit speed for specified subnet | |
| | | |
| | The value is a floating-point number of bytes per second, | |
@ -194,6 +194,7 @@ Example of timestamp section configuration.
| tsa_name | Must the TSA name be included in the reply? (optional, default: no) | yes |
+-----------------------------+---------------------------------------------------------------------+--------------------------------------+
Building
--------

View File

@ -27,7 +27,7 @@ with open(tsq_path) as f:
if m:
text = m.group(1)
if text_buf:
text_buf += '\n '
text_buf += '\n'
text_buf += text
m = re.search('^#?([^\s]*)\s*=\s*(.*)', line)
@ -75,8 +75,12 @@ for section in sorted(docs):
for line in docs[section]['vars'][var]['desc'].split('\n'):
if first:
first = False
print_line(var, line, docs[section]['vars'][var]['val'])
print_line(
re.sub('\*', '\\*', var),
re.sub('\*', '\\*', line),
re.sub('\*', '\\*', docs[section]['vars'][var]['val']),
)
else:
print_line('', line, '')
print_line('', re.sub('\*', '\\*', line), '')
print('+-' + '-' * max_var + '-+-' + '-' * max_desc + '-+-' + '-' * max_val + '-+')
print('')