util.rst 819 B

12345678910111213141516171819202122232425262728293031
  1. :mod:`modulegraph.util` --- Utilies functions
  2. =============================================
  3. .. module:: modulegraph.util
  4. :synopsis: Utilitie functions
  5. .. function:: imp_find_module(name, path=None)
  6. This function has the same interface as
  7. :func:`imp.find_module`, but also works with
  8. dotted names.
  9. .. function:: imp_walk(name)
  10. yields the namepart and importer information
  11. for every part of a dotted module name, and
  12. raises :exc:`ImportError` when the *name*
  13. cannot be found.
  14. The result elements are tuples with two
  15. elements, the first is a module name,
  16. the second is the result for :func:`imp.find_module`
  17. for that module (taking into account :pep:`302`
  18. importers)
  19. .. deprecated:: 0.10
  20. .. function:: guess_encoding(fp)
  21. Returns the encoding of a python source file.