Show More
@@ -112,14 +112,20 b' def docstrings(path):' | |||||
112 |
|
112 | |||
113 | for func, rstrip in functions: |
|
113 | for func, rstrip in functions: | |
114 | if func.__doc__: |
|
114 | if func.__doc__: | |
|
115 | funcmod = inspect.getmodule(func) | |||
|
116 | extra = '' | |||
|
117 | if funcmod.__package__ == funcmod.__name__: | |||
|
118 | extra = '/__init__' | |||
|
119 | actualpath = '%s%s.py' % (funcmod.__name__.replace('.', '/'), extra) | |||
|
120 | ||||
115 | src = inspect.getsource(func) |
|
121 | src = inspect.getsource(func) | |
116 | name = "%s.%s" % (path, func.__name__) |
|
122 | name = "%s.%s" % (actualpath, func.__name__) | |
117 | lineno = inspect.getsourcelines(func)[1] |
|
123 | lineno = inspect.getsourcelines(func)[1] | |
118 | doc = func.__doc__ |
|
124 | doc = func.__doc__ | |
119 | if rstrip: |
|
125 | if rstrip: | |
120 | doc = doc.rstrip() |
|
126 | doc = doc.rstrip() | |
121 | lineno += offset(src, doc, name, 1) |
|
127 | lineno += offset(src, doc, name, 1) | |
122 | print(poentry(path, lineno, doc)) |
|
128 | print(poentry(actualpath, lineno, doc)) | |
123 |
|
129 | |||
124 |
|
130 | |||
125 | def rawtext(path): |
|
131 | def rawtext(path): |
General Comments 0
You need to be logged in to leave comments.
Login now