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