Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaspuff authored May 18, 2018
1 parent c57946d commit 22114a6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tomodachi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,14 @@
'schedule', 'heartbeat', 'minutely', 'hourly', 'daily', 'monthly']

CLASS_ATTRIBUTE = 'TOMODACHI_SERVICE_CLASS'
EMPTY_LAMBDA = lambda: None


def service(cls: Any) -> Any:
setattr(cls, CLASS_ATTRIBUTE, True)
if not getattr(cls, 'log', None):
cls.log = tomodachi.helpers.logging.log
elif callable(cls.log) and inspect.getfullargspec(cls.log) == inspect.getfullargspec(EMPTY_LAMBDA):
cls.log = tomodachi.helpers.logging.log
if not getattr(cls, 'log_setup', None):
cls.log_setup = tomodachi.helpers.logging.log_setup
elif callable(cls.log_setup) and inspect.getfullargspec(cls.log_setup) == inspect.getfullargspec(EMPTY_LAMBDA):
cls.log_setup = tomodachi.helpers.logging.log_setup
return cls


Expand Down

0 comments on commit 22114a6

Please sign in to comment.