Commit 589da111 authored by juga's avatar juga Committed by Matt Traudt
Browse files

Fix mispelled latest

parent aa1dd5ad
...@@ -18,7 +18,7 @@ KEYVALUE_SEP_V200 = ' ' ...@@ -18,7 +18,7 @@ KEYVALUE_SEP_V200 = ' '
EXTRA_ARG_KEYVALUES = ['software', 'software_version', 'file_created', EXTRA_ARG_KEYVALUES = ['software', 'software_version', 'file_created',
'earliest_bandwidth', 'generator_started'] 'earliest_bandwidth', 'generator_started']
# List of all unordered KeyValues currently being used to generate the file # List of all unordered KeyValues currently being used to generate the file
UNORDERED_KEYVALUES = EXTRA_ARG_KEYVALUES + ['lastest_bandwidth'] UNORDERED_KEYVALUES = EXTRA_ARG_KEYVALUES + ['latest_bandwidth']
# List of all the KeyValues currently being used to generate the file # List of all the KeyValues currently being used to generate the file
ALL_KEYVALUES = ['version'] + UNORDERED_KEYVALUES ALL_KEYVALUES = ['version'] + UNORDERED_KEYVALUES
TERMINATOR = '====' TERMINATOR = '===='
...@@ -71,9 +71,9 @@ class V3BwHeader(object): ...@@ -71,9 +71,9 @@ class V3BwHeader(object):
self.software = kwargs.get('software', 'sbws') self.software = kwargs.get('software', 'sbws')
self.software_version = kwargs.get('software_version', __version__) self.software_version = kwargs.get('software_version', __version__)
self.file_created = kwargs.get('file_created', now_isodt_str()) self.file_created = kwargs.get('file_created', now_isodt_str())
# lastest_bandwidth should not be in kwargs, since it MUST be the # latest_bandwidth should not be in kwargs, since it MUST be the
# same as timestamp # same as timestamp
self.lastest_bandwidth = unixts_to_isodt_str(timestamp) self.latest_bandwidth = unixts_to_isodt_str(timestamp)
[setattr(self, k, v) for k, v in kwargs.items() [setattr(self, k, v) for k, v in kwargs.items()
if k in EXTRA_ARG_KEYVALUES] if k in EXTRA_ARG_KEYVALUES]
...@@ -167,7 +167,7 @@ class V3BwHeader(object): ...@@ -167,7 +167,7 @@ class V3BwHeader(object):
return read_started_ts(conf) return read_started_ts(conf)
@staticmethod @staticmethod
def lastest_bandwidth_from_results(results): def latest_bandwidth_from_results(results):
return round(max([r.time for fp in results for r in results[fp]])) return round(max([r.time for fp in results for r in results[fp]]))
@staticmethod @staticmethod
...@@ -177,11 +177,11 @@ class V3BwHeader(object): ...@@ -177,11 +177,11 @@ class V3BwHeader(object):
@classmethod @classmethod
def from_results(cls, conf, results): def from_results(cls, conf, results):
kwargs = dict() kwargs = dict()
lastest_bandwidth = cls.lastest_bandwidth_from_results(results) latest_bandwidth = cls.latest_bandwidth_from_results(results)
earliest_bandwidth = cls.lastest_bandwidth_from_results(results) earliest_bandwidth = cls.latest_bandwidth_from_results(results)
generator_started = cls.generator_started_from_file(conf) generator_started = cls.generator_started_from_file(conf)
timestamp = str(lastest_bandwidth) timestamp = str(latest_bandwidth)
kwargs['lastest_bandwidth'] = unixts_to_isodt_str(lastest_bandwidth) kwargs['latest_bandwidth'] = unixts_to_isodt_str(latest_bandwidth)
kwargs['earliest_bandwidth'] = unixts_to_isodt_str(earliest_bandwidth) kwargs['earliest_bandwidth'] = unixts_to_isodt_str(earliest_bandwidth)
kwargs['generator_started'] = generator_started kwargs['generator_started'] = generator_started
h = cls(timestamp, **kwargs) h = cls(timestamp, **kwargs)
......
...@@ -11,10 +11,10 @@ software_l = KEYVALUE_SEP_V110.join(['software', 'sbws']) ...@@ -11,10 +11,10 @@ software_l = KEYVALUE_SEP_V110.join(['software', 'sbws'])
software_version_l = KEYVALUE_SEP_V110.join(['software_version', version]) software_version_l = KEYVALUE_SEP_V110.join(['software_version', version])
file_created = '2018-04-25T13:10:57' file_created = '2018-04-25T13:10:57'
file_created_l = KEYVALUE_SEP_V110.join(['file_created', file_created]) file_created_l = KEYVALUE_SEP_V110.join(['file_created', file_created])
lastest_bandwidth = '2018-04-17T14:09:07' latest_bandwidth = '2018-04-17T14:09:07'
lastest_bandwidth_l = KEYVALUE_SEP_V110.join(['lastest_bandwidth', latest_bandwidth_l = KEYVALUE_SEP_V110.join(['latest_bandwidth',
lastest_bandwidth]) latest_bandwidth])
header_ls = [timestamp_l, version_l, file_created_l, lastest_bandwidth_l, header_ls = [timestamp_l, version_l, file_created_l, latest_bandwidth_l,
software_l, software_version_l, TERMINATOR] software_l, software_version_l, TERMINATOR]
header_str = LINE_SEP.join(header_ls) + LINE_SEP header_str = LINE_SEP.join(header_ls) + LINE_SEP
earliest_bandwidth = '2018-04-16T14:09:07' earliest_bandwidth = '2018-04-16T14:09:07'
...@@ -25,7 +25,7 @@ generator_started_l = KEYVALUE_SEP_V110.join(['generator_started', ...@@ -25,7 +25,7 @@ generator_started_l = KEYVALUE_SEP_V110.join(['generator_started',
generator_started]) generator_started])
header_extra_ls = [timestamp_l, version_l, header_extra_ls = [timestamp_l, version_l,
earliest_bandwidth_l, file_created_l, generator_started_l, earliest_bandwidth_l, file_created_l, generator_started_l,
lastest_bandwidth_l, latest_bandwidth_l,
software_l, software_version_l, TERMINATOR] software_l, software_version_l, TERMINATOR]
header_extra_str = LINE_SEP.join(header_extra_ls) + LINE_SEP header_extra_str = LINE_SEP.join(header_extra_ls) + LINE_SEP
......
Supports Markdown
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