Guess whether a path refers to a package directory.
(path)
| 377 | # ----------------------------------------------------- module manipulation |
| 378 | |
| 379 | def ispackage(path): |
| 380 | """Guess whether a path refers to a package directory.""" |
| 381 | warnings.warn('The pydoc.ispackage() function is deprecated', |
| 382 | DeprecationWarning, stacklevel=2) |
| 383 | if os.path.isdir(path): |
| 384 | for ext in ('.py', '.pyc'): |
| 385 | if os.path.isfile(os.path.join(path, '__init__' + ext)): |
| 386 | return True |
| 387 | return False |
| 388 | |
| 389 | def source_synopsis(file): |
| 390 | """Return the one-line summary of a file object, if present""" |