Commit 392d902d authored by Stavros Sachtouris's avatar Stavros Sachtouris

Rename foo --> func everywhere

parent d7a3393c
......@@ -496,7 +496,7 @@ def is_non_API(parser):
return False
def main(foo):
def main(func):
def wrap():
try:
exe = basename(argv[0])
......@@ -517,7 +517,7 @@ def main(foo):
global _colors
exclude = ['ansicolors'] if not _colors == 'on' else []
suggest_missing(exclude=exclude)
foo(exe, parser)
func(exe, parser)
except CLIError as err:
print_error_message(err)
if _debug:
......
......@@ -42,19 +42,19 @@ from sys import stdin, stdout, stderr
log = get_logger(__name__)
def DontRaiseKeyError(foo):
def DontRaiseKeyError(func):
def wrap(*args, **kwargs):
try:
return foo(*args, **kwargs)
return func(*args, **kwargs)
except KeyError:
return None
return wrap
def addLogSettings(foo):
def addLogSettings(func):
def wrap(self, *args, **kwargs):
try:
return foo(self, *args, **kwargs)
return func(self, *args, **kwargs)
finally:
self._set_log_params()
return wrap
......
......@@ -67,17 +67,17 @@ _commands = [
service_commands, commission_commands, endpoint_commands]
def with_temp_token(foo):
""" Set token to self.client.token, run foo, recover old token """
def with_temp_token(func):
""" Set token to self.client.token, run func, recover old token """
def wrap(self, *args, **kwargs):
try:
token = kwargs.pop('token')
except KeyError:
raise CLISyntaxError('A token is needed for %s' % foo)
raise CLISyntaxError('A token is needed for %s' % func)
token_bu = self.client.token
try:
self.client.token = token or token_bu
return foo(self, *args, **kwargs)
return func(self, *args, **kwargs)
finally:
self.client.token = token_bu
return wrap
......@@ -606,9 +606,9 @@ _project_specs = """{
"""
def apply_notification(foo):
def apply_notification(func):
def wrap(self, *args, **kwargs):
r = foo(self, *args, **kwargs)
r = func(self, *args, **kwargs)
self.writeln('Application is submitted successfully')
return r
return wrap
......
This diff is collapsed.
......@@ -55,11 +55,11 @@ def activate(name):
old_logger.setLevel(_blacklist.pop(name, old_logger.level))
def if_logger_enabled(foo):
def if_logger_enabled(func):
def wrap(name, *args, **kwargs):
if name in _blacklist:
return logging.getLogger(name)
return foo(name, *args, **kwargs)
return func(name, *args, **kwargs)
return wrap
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment