docs: modernize 2 examples

issue510
David Wilson 6 years ago
parent d5cb98fa87
commit 73c7b5daeb

@ -185,9 +185,9 @@ nested.py:
.. code-block:: python
import os
import mitogen.utils
import mitogen
@mitogen.utils.run_with_router
@mitogen.main()
def main(router):
mitogen.utils.log_to_file()

@ -351,6 +351,7 @@ usual into the slave process.
os.system('tar zxvf my_app.tar.gz')
@mitogen.main()
def main(broker):
if len(sys.argv) != 2:
print(__doc__)
@ -359,10 +360,6 @@ usual into the slave process.
context = mitogen.ssh.connect(broker, sys.argv[1])
context.call(install_app)
if __name__ == '__main__' and mitogen.is_master:
import mitogen.utils
mitogen.utils.run_with_broker(main)
Event-driven IO
###############

Loading…
Cancel
Save