Created
August 3, 2013 07:08
-
-
Save mjdorma/6145546 to your computer and use it in GitHub Desktop.
Using begins to expose shutil
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
import shutil | |
import begin | |
begin.subcommand(shutil.copy) | |
begin.subcommand(shutil.copy2) | |
begin.subcommand(shutil.copyfile) | |
begin.subcommand(shutil.copymode) | |
begin.subcommand(shutil.copystat) | |
begin.subcommand(shutil.copytree) | |
begin.subcommand(shutil.move) | |
begin.subcommand(shutil.rmtree) | |
# Patch in doc before the func is wrapped by begin.start | |
def patch_doc(doc): | |
def decorate(func): | |
func.__doc__ = doc | |
return func | |
return decorate | |
@begin.start | |
@patch_doc(shutil.__doc__) | |
def main(): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment