Guess whether a path refers to a package directory.
(path)
| 312 | # ----------------------------------------------------- module manipulation |
| 313 | |
| 314 | def ispackage(path): |
| 315 | """Guess whether a path refers to a package directory.""" |
| 316 | warnings.warn('The pydoc.ispackage() function is deprecated', |
| 317 | DeprecationWarning, stacklevel=2) |
| 318 | if os.path.isdir(path): |
| 319 | for ext in ('.py', '.pyc'): |
| 320 | if os.path.isfile(os.path.join(path, '__init__' + ext)): |
| 321 | return True |
| 322 | return False |
| 323 | |
| 324 | def source_synopsis(file): |
| 325 | """Return the one-line summary of a file object, if present""" |