Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making sure all Commands use run in __call__. #48

Merged
merged 1 commit into from Sep 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions nox/command.py
Expand Up @@ -112,7 +112,8 @@ def run(self, path_override=None, env_fallback=None, **kwargs):
logger.error('Interrupted...')
raise

__call__ = run
def __call__(self, *args, **kwargs):
return self.run(*args, **kwargs)


class FunctionCommand(object):
Expand Down Expand Up @@ -141,7 +142,8 @@ def run(self):

raise CommandFailed(e)

__call__ = run
def __call__(self, *args, **kwargs):
return self.run(*args, **kwargs)

def __str__(self):
return '{}(args={!r}, kwargs={!r})'.format(
Expand All @@ -165,7 +167,8 @@ def __init__(self, deps):
def run(self, venv):
venv.install(*self.deps)

__call__ = run
def __call__(self, *args, **kwargs):
return self.run(*args, **kwargs)

def __str__(self):
return ' '.join(self.deps)
Expand Down