66 lg.warning('There was something wrong with the data.json; fixing...')
67if not 'sha' in data.keys():
68 data['sha'] = {}
69if not 'last' in data.keys(): 70 lg.warning('No last update date found; setting standard')
71 data['last'] = '1999-12-01'
72
64 lg.warning('data.json not found; creating...')
65except json.JSONDecodeError:
66 lg.warning('There was something wrong with the data.json; fixing...')
67if not 'sha' in data.keys(): 68 data['sha'] = {}
69if not 'last' in data.keys():
70 lg.warning('No last update date found; setting standard')
Consider iterating the dictionary directly instead of calling .keys()
.
Using for key in dictionary
would always iterate the dictionary keys.
sounds = {"cow": "moo", "dog": "bark"}
for key in sounds.keys():
print(key)
sounds = {"cow": "moo", "dog": "bark"}
for key in sounds:
print(key)