-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0577dd1
commit cb7bd87
Showing
8 changed files
with
323 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Module hack: ``from plumbum.cmd import ls`` | ||
""" | ||
import sys | ||
from types import ModuleType | ||
from plumbum.local_machine import local | ||
|
||
__all__ = [] | ||
|
||
class LocalModule(ModuleType): | ||
"""The module-hack that allows us to use ``from plumbum.cmd import some_program``""" | ||
def __init__(self, name): | ||
ModuleType.__init__(self, name, __doc__) | ||
self.__file__ = None | ||
self.__package__ = ".".join(name.split(".")[:-1]) | ||
def __getattr__(self, name): | ||
return local[name] | ||
|
||
LocalModule = LocalModule("plumbum.cmd") | ||
sys.modules[LocalModule.__name__] = LocalModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
version = (1, 0, 0) | ||
version_string = "1.0.0" | ||
release_date = "2012.08.01" | ||
release_date = "2012.10.06" |
Oops, something went wrong.