Skip to content

Commit 1eb885b

Browse files
committed
fix flake8 formatting issues
Signed-off-by: hwassman <[email protected]>
1 parent 580002c commit 1eb885b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

source/utils.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,31 +51,33 @@ def wrapper(*args: Any, **kwargs: Any) -> T:
5151
return wrapper
5252
return outer
5353

54-
def classattributes(default_attr,more_allowed_attr):
55-
""" class __init__decorator
54+
55+
def classattributes(default_attr, more_allowed_attr):
56+
""" class __init__decorator
5657
Parses kwargs attributes, for optional arguments uses default values,
5758
if not provided with kwargs
5859
Usage:
5960
1st arg is a dict of attributes with default values
6061
2nd arg is a list of additional allowed attributes which may be instantiated or not
6162
"""
6263
def class_decorator(cls):
63-
def new_init(self,**kwargs):
64+
def new_init(self, **kwargs):
6465
allowed_attr = list(default_attr.keys()) + more_allowed_attr
65-
default_attr_to_update = copy.deepcopy(default_attr)
66+
default_attr_to_update = copy.deepcopy(default_attr)
6667
default_attr_to_update.update(kwargs)
67-
self.__dict__.update((k,v) for k,v in default_attr_to_update.items() if k in allowed_attr)
68+
self.__dict__.update((k, v) for k, v in default_attr_to_update.items() if k in allowed_attr)
6869
cls.__init__ = new_init
6970
return cls
7071
return class_decorator
7172

73+
7274
def getTimeMultiplier(timeunit):
73-
'''Translate OpenTSDB time units, ignoring ms (milliseconds)'''
74-
return {
75+
""" Translate OpenTSDB time units, ignoring ms (milliseconds) """
76+
return {
7577
's': 1,
7678
'm': 60,
7779
'h': 3600,
7880
'd': 86400,
7981
'w': 604800,
8082
'n': 2628000,
81-
'y': 31536000, }.get(timeunit, -1)
83+
'y': 31536000, }.get(timeunit, -1)

0 commit comments

Comments
 (0)