You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
3.3 KiB

4 years ago
  1. Metadata-Version: 1.2
  2. Name: terminado
  3. Version: 0.8.1
  4. Summary: Terminals served to xterm.js using Tornado websockets
  5. Home-page: https://github.com/jupyter/terminado
  6. License: UNKNOWN
  7. Author: Jupyter Development Team
  8. Author-email: jupyter@googlegroups.com
  9. Classifier: Environment :: Web Environment
  10. Classifier: License :: OSI Approved :: BSD License
  11. Classifier: Programming Language :: Python :: 2
  12. Classifier: Programming Language :: Python :: 3
  13. Classifier: Topic :: Terminals :: Terminal Emulators/X Terminals
  14. Requires-Dist: ptyprocess;os_name!='nt'
  15. Requires-Dist: pywinpty (>=0.5);os_name=='nt'
  16. Requires-Dist: tornado (>=4)
  17. This is a `Tornado <http://tornadoweb.org/>`_ websocket backend for the
  18. `Xterm.js <https://xtermjs.org/>`_ Javascript terminal emulator
  19. library.
  20. It evolved out of `pyxterm <https://github.com/mitotic/pyxterm>`_, which was
  21. part of `GraphTerm <https://github.com/mitotic/graphterm>`_ (as lineterm.py),
  22. v0.57.0 (2014-07-18), and ultimately derived from the public-domain `Ajaxterm
  23. <http://antony.lesuisse.org/software/ajaxterm/>`_ code, v0.11 (2008-11-13) (also
  24. on Github as part of `QWeb <https://github.com/antonylesuisse/qweb>`_).
  25. Modules:
  26. * ``terminado.management``: controls launching virtual terminals,
  27. connecting them to Tornado's event loop, and closing them down.
  28. * ``terminado.websocket``: Provides a websocket handler for communicating with
  29. a terminal.
  30. * ``terminado.uimodule``: Provides a ``Terminal`` Tornado `UI Module
  31. <http://www.tornadoweb.org/en/stable/guide/templates.html#ui-modules>`_.
  32. JS:
  33. * ``terminado/_static/terminado.js``: A lightweight wrapper to set up a
  34. term.js terminal with a websocket.
  35. Usage example:
  36. .. code:: python
  37. import os.path
  38. import tornado.web
  39. import tornado.ioloop
  40. # This demo requires tornado_xstatic and XStatic-term.js
  41. import tornado_xstatic
  42. import terminado
  43. STATIC_DIR = os.path.join(os.path.dirname(terminado.__file__), "_static")
  44. class TerminalPageHandler(tornado.web.RequestHandler):
  45. def get(self):
  46. return self.render("termpage.html", static=self.static_url,
  47. xstatic=self.application.settings['xstatic_url'],
  48. ws_url_path="/websocket")
  49. if __name__ == '__main__':
  50. term_manager = terminado.SingleTermManager(shell_command=['bash'])
  51. handlers = [
  52. (r"/websocket", terminado.TermSocket,
  53. {'term_manager': term_manager}),
  54. (r"/", TerminalPageHandler),
  55. (r"/xstatic/(.*)", tornado_xstatic.XStaticFileHandler,
  56. {'allowed_modules': ['termjs']})
  57. ]
  58. app = tornado.web.Application(handlers, static_path=STATIC_DIR,
  59. xstatic_url = tornado_xstatic.url_maker('/xstatic/'))
  60. # Serve at http://localhost:8765/ N.B. Leaving out 'localhost' here will
  61. # work, but it will listen on the public network interface as well.
  62. # Given what terminado does, that would be rather a security hole.
  63. app.listen(8765, 'localhost')
  64. try:
  65. tornado.ioloop.IOLoop.instance().start()
  66. finally:
  67. term_manager.shutdown()
  68. See the `demos directory <https://github.com/takluyver/terminado/tree/master/demos>`_
  69. for more examples. This is a simplified version of the ``single.py`` demo.
  70. Run the unit tests with:
  71. $ nosetests