Skip to content
Snippets Groups Projects

Refactor to match PEP 8

Merged taylor-jaydee requested to merge dev-v1.0a1.04 into master
2 files
+ 36
33
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 8
7
from datetime import datetime
def latestTimeStamp(data):
def latest_timestamp(data):
time_string_format = '%Y-%m-%dT%H:%M:%SZ'
newesttimestamp = datetime.strptime('2020-01-01T00:00:00Z', time_string_format)
_new_time = datetime.strptime('2020-01-01T00:00:00Z', time_string_format)
for state in data:
state_timestamp = datetime.strptime(state['dateChecked'], time_string_format) # example line from .yaml file: dateChecked: '2020-04-14T21:31:00Z'
if state_timestamp > newesttimestamp:
newesttimestamp = state_timestamp
return newesttimestamp
state_timestamp = datetime.strptime(state['dateChecked'],
time_string_format) # example line from .yaml file: dateChecked: '2020-04-14T21:31:00Z'
if state_timestamp > _new_time:
_new_time = state_timestamp
return _new_time
Loading