def install_git(path):
 hook = op.join(path, 'pre-commit')
 with open(hook, 'w') as fd:
  fd.write("#!/usr/bin/env python\nimport sys\nfrom pylama.hook import git_hook\n\nif __name__ == '__main__':\n    sys.exit(git_hook())\n")
 chmod(hook, 484)

def install_git ( path ) : hook = op . join ( path , 'pre-commit' ) with open ( hook , 'w' ) as fd : fd . write ( "#!/usr/bin/env python\nimport sys\nfrom pylama.hook import git_hook\n\nif __name__ == '__main__':\n    sys.exit(git_hook())\n" ) chmod ( hook , 484 )
install hook in git repository .