__init__.py 994 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # -*- coding: utf-8 -*-
  2. # *****************************************************************************
  3. # Copyright (C) 2003-2006 Gary Bishop.
  4. # Copyright (C) 2006-2020 Jorgen Stenarson. <jorgen.stenarson@bostream.nu>
  5. # Copyright (C) 2020 Bassem Girgis. <brgirgis@gmail.com>
  6. #
  7. # Distributed under the terms of the BSD License. The full license is in
  8. # the file COPYING, distributed as part of this software.
  9. # *****************************************************************************
  10. from platform import system
  11. from importlib.metadata import version, PackageNotFoundError
  12. from . import (
  13. clipboard,
  14. console,
  15. lineeditor,
  16. logger,
  17. modes,
  18. rlmain,
  19. unicode_helper,
  20. )
  21. from .rlmain import *
  22. _S = system()
  23. if _S.lower() != "windows":
  24. raise RuntimeError("pyreadline3 is for Windows only, not {}.".format(_S))
  25. del system, _S
  26. try:
  27. __version__ = version("pyreadline3")
  28. except PackageNotFoundError:
  29. # package is not installed
  30. pass