Metadata-Version: 1.1
Name: oi
Version: 0.3.2
Summary: A library for writing long running processes with a cli interface
Home-page: https://github.com/walkr/oi
Author: Tony Walker
Author-email: walkr.walkr@gmail.com
License: MIT
Description: oi
        ==
        
        python library for writing long running processes with a cli interface
        
        |Build Status|
        
        .. figure:: http://i.imgur.com/iH08GNq.png
           :alt: oi image
        
           oi image
        
        Usage
        ~~~~~
        
        1. Write your long running program
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        
        .. code:: python
        
            # programd.py
        
            import oi
        
            program = oi.Program('my program', 'ipc:///tmp/program.sock')
            program.add_command('ping', lambda p: 'pong')
            program.add_command('state', lambda p: p.state)
            program.run()  # program will run forever
        
        2. Add a ctl interface
        ^^^^^^^^^^^^^^^^^^^^^^
        
        .. code:: python
        
            # programctl.py
        
            import oi
        
            ctl = oi.CtlProgram('ctl program', address='ipc:///tmp/program.sock')
            ctl.run()
        
        3. Run program, then connect to it via ctl
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        
        .. code:: shell
        
            $ python programd --config /etc/program.conf
        
            $ python programctl  # enter ctl loop
            programctl > ping
            pong
        
            $ python programctl ping # OR ping end exit
        
        Quickly get started with a new project
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        
        .. code:: shell
        
            $ mkdir xprogram
            $ cd xprogram
        
            $ oi init
            $ make install
        
            # Start your program
            $ xprogramd
        
            # Start ctl program
            $ xprogramctl
            ctl > ping
            pong
        
            # Upload to pypi (Edit setup.py before distributing)
            $ make distribute
        
        Now the interesting bit. Are you ready?
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        
        Run your program on one computer, then control it from another with a
        single line change (actually two).
        
        Just change the address ``ipc:///tmp/program.sock`` to a tcp address,
        such as ``tcp://192.168.1.100:5000`` in both your ``programd.py`` and
        ``programctl.py``. That's it! (:
        
        TODO
        ^^^^
        
        -  Add more testing
        
        License
        ^^^^^^^
        
        MIT License
        
        .. |Build Status| image:: https://travis-ci.org/walkr/oi.svg?branch=master
           :target: https://travis-ci.org/walkr/oi
        
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
