Skip to content

Instantly share code, notes, and snippets.

@mjdorma
Created August 3, 2013 07:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjdorma/6145546 to your computer and use it in GitHub Desktop.
Save mjdorma/6145546 to your computer and use it in GitHub Desktop.
Using begins to expose shutil
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