Get action descriptions from docstrings
This commit is contained in:
parent
c2d27e8f56
commit
347bd2207a
6 changed files with 48 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue