Goulash as a library

Apart from command-line usage, goulash is also a toolbox/utility module. Random examples:

The entire library will probably never be documented, but this page will just cover some of the highlights.n a lot of cases, I've just adapted

Of course the goulash command-line utilities can also be used componentwise from the library. Or look over here! It's a quick and dirty HTTP fileserver that's actually multithreaded.

But it pretty much goes on like this forever..

Missing from the OS module

Decorator patterns

>>> from tunl import api
>>> api.list_tunnels()
{'mongo': {'local_port': 27000,
  'remote_host': 'host',
  'remote_port': 27017,
  'status': 'down',
  'user': 'admin'},
 'jenkins': {'key': '~/.ssh/key.pem',
  'local_port': 8081,
  'remote_host': 'jenkins',
  'remote_port': 8080,
  'status': 'down',
  'user': 'ubuntu'}}
>>> start_success = api.start_tunnel('mongo')
tunl: ssh  -M -S /home/vagrant/.tunl/mongo -fnNT -L 27000:localhost:27017 admin@host
>>> print start_success
True

Caching & Memoization

Contributing

Github is here. Pull requests welcome.

Running tests

To run the unittests:

  $ cd tunl
  $ source venv/bin/activate
  $ pip install tox
  $ tox

Building documentation

To rebuild this documentation:

  $ cd tunl
  $ source venv/bin/activate
  $ pip install tox
  $ tox -e docs_deploy

  1. os.makedirs fails if the target already exists 

  2. importlib and __import__ have to be combined with loops and getattr() calls to fish out objects from modules 

  3. check out goulash.decorators