More module descriptions

This commit is contained in:
Dima Gerasimov 2020-02-26 16:32:03 +01:00
parent ab77b1d919
commit d00e09d1a1
17 changed files with 92 additions and 15 deletions

View file

@ -26,13 +26,31 @@ Short example to give you an idea: "which subreddits I find most interesting?"
* Supported modules
#+begin_src python :results output :python "with_my python3"
#+begin_src python :results output drawer :exports output :python "with_my python3"
from pathlib import Path
import re
import importlib
def ignored(m: str):
return re.match('^my.kython', m)
excluded = [
'kython.*',
'bluemaestro.check',
'body',
'books',
'calendar',
'coding',
'coding.codeforces',
'coding.topcoder',
'media',
'mycfg_stub',
'reading',
'takeout',
'_rss',
'common',
'error',
]
exs = '|'.join(excluded)
return re.match(f'^my.({exs})$', m)
for f in sorted(Path('my/').glob('**/*.py')):
if f.name == '__init__.py':
@ -40,19 +58,25 @@ for f in sorted(Path('my/').glob('**/*.py')):
m = str(f.with_suffix('')).replace('/', '.')
if ignored(m):
continue
# TODO module link?
# TODO I've done this for infra diagram already...
try:
mod = importlib.import_module(m)
doc = mod.__doc__
if doc is None:
print(m, ": NO DOCS!")
pass # TODO
# print(m, ": NO DOCS!")
else:
fline = doc.strip().splitlines()[0]
print('-', m, ':', fline)
except Exception as e:
print(m, e) # TODO
pass
# print(m, e) # TODO
#+end_src
* Setting up
** =mycfg= package for private paths/repositories (optional)
If you're not planning to use private configuration (some modules don't need it) you can skip straight to the next step. Still, I'd recommend you to read anyway.