mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-07 01:41:11 +07:00
Previously, it used an odd convention with lowercased names of test data files (with nothing separating individual words), which made adding new tests quite tedious. Also, I removed the test data "exit.py" as it wasn't used by any test. GitOrigin-RevId: 92b1963c67ed01977f5b7ad020984056c9fe045d
14 lines
705 B
Python
14 lines
705 B
Python
def help(object, spacing=foo, collapse=1):
|
|
"""Выводит методы и строки документации.
|
|
|
|
В качестве аргумента может использоваться модуль, класс, список, словарь
|
|
или строка."""
|
|
methodList = [method for method in dir(object) if callable(getattr(object, method))]
|
|
processFunc = collapse and (lambda s: " ".join(s.split())) or (lambda s: s)
|
|
print "\n".join(["%s %s" %
|
|
(method.ljust(spacing),
|
|
processFunc(str(getattr(object, method).__doc__)))
|
|
for method in methodList])
|
|
|
|
if __name__ == "__main__":
|
|
print help.__doc__ |