tomerfiliba/plumbum — pull request #45 by agfor (2012-11-09 23:16:35+00:00)
Title: Move plumbum.cmd hack into __init__.py

I found it a bit confusing that you could

from plumbum.cmd import some_command

but you couldn't

import plumbum.cmd

I went looking at `__init__.py` and found it wasn't there at all, as I would expect it to be.

This patch moves the module hack into `__init__.py` so it can be easily found, and gives it a name (in addition to adding it to `sys.modules`) so it can be directly imported.

It also simplifies the code slightly, removes the hardcoded use of `plumbum` as the package name so that plumbum can be used as a subpackage, and allows:

plumbum.cmd["some_command"]

as `local` does.