Last active
August 29, 2015 14:06
-
-
Save jorge-lavin/b84409bd9244eb9427c8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class JLI(object): | |
"""JLI""" | |
def __init__(self): | |
pass | |
def check_verbose(self): | |
try: | |
self.verbose | |
except AttributeError: | |
return False | |
return self.verbose | |
def set_verbose(self): | |
self.verbose = True | |
def call(self, *args, **kwargs): | |
if self.check_verbose() is True: | |
self.verbose_run(*args, **kwargs) | |
else: | |
self.run(*args) | |
def run(self, *args): | |
print('Running {0}'.format(' '.join(*args))) | |
def verbose_run(self, *args, **kwargs): | |
error_message = kwargs.get('error_message') | |
print('Verbose running {0}'.format(' '.join(*args))) | |
print('{0} happened'.format(error_message)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment