Mercurial > p > roundup > code
comparison roundup/admin.py @ 7371:a210f4437b49
Incomplete work to generate config doc from config.ini
This is an incomplete attempt to allow generation of the config.ini
documentation in reference.txt. It reformats the output of
'roundup_admin.py genconfig'. So it now includes all of the
settings. Using a Makefile rule like:
tracker_config.txt: ../roundup/configuration.py
python3 ../roundup/scripts/roundup_admin.py \
genconfig _temp_config.txt
sed -e '1,8d' \
-e 's/^\[\([a-z]*\)\]/\n.. index:: config.ini; sections \1\n\n.. code:: ini\n\n [\1]/' \
-e 's/^\([^[]\)/ \1/' \
_temp_config.txt > tracker_config.txt
rm -f _temp_config.txt
results in the config.ini split by section and index links being put
in place. However some sections have a comment before the [section]
marker. This comment is orphaned at the end of the prior section
rather than starting the new section. A simple sed won't allow the
lookahead needed to target the [section] marker and include the prior
comment block. Also there are still have some long lines generated (>
65 characters). Maybe a python script can import configuration.py and
output proper restructured text output?
reference.txt:
add a commented out include:: tracker_config.txt directive
roundup/admin.py:
don't require a tracker home for genconfig. So user can generate a
clean config.ini on demand. Tracker home is still required for
updateconfig.
roundup/configuration.py:
wrap lines better. A number of them are generating comments > 65
characters which is the targeted line length. This cleans up
config.ini too, so is a good thing.
website/www/conf.py:
ignore doc/tracker_config.ini when processing.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 17 May 2023 13:34:36 -0400 |
| parents | 209e94ed0277 |
| children | 9bd7ed918121 |
comparison
equal
deleted
inserted
replaced
| 7370:f37c1df6de34 | 7371:a210f4437b49 |
|---|---|
| 1932 self.help_commands() | 1932 self.help_commands() |
| 1933 self.help_all() | 1933 self.help_all() |
| 1934 return 0 | 1934 return 0 |
| 1935 if command == 'templates': | 1935 if command == 'templates': |
| 1936 return self.do_templates(args[1:]) | 1936 return self.do_templates(args[1:]) |
| 1937 return 0 | |
| 1938 if command == 'genconfig': | |
| 1939 return self.do_genconfig(args[1:]) | |
| 1940 return 0 | |
| 1937 | 1941 |
| 1938 # figure what the command is | 1942 # figure what the command is |
| 1939 try: | 1943 try: |
| 1940 functions = self.commands.get(command) | 1944 functions = self.commands.get(command) |
| 1941 except KeyError: | 1945 except KeyError: |
