Get action descriptions from docstrings

This commit is contained in:
jtc42 2019-11-19 22:46:50 +00:00
parent c2d27e8f56
commit 347bd2207a
6 changed files with 48 additions and 9 deletions

View file

@ -5,6 +5,12 @@ from collections import abc
from functools import reduce
from contextlib import contextmanager
def get_docstring(obj):
ds = obj.__doc__
if ds:
return ds.strip()
else:
return ""
def camel_to_snake(name):
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)