Closed dbrenden closed 9 years ago
Regarding your question on IRC about my try/except suggestion.
Consider this
try:
with open(your_file) as fd:
old_stuff = json.load(fd)
except IOError:
old_stuff = {}
next_id = 1
for key, value in old_stuff.iteritems():
do_more_things()
If there is nothing from a previous run to load, then the loop will simply do nothing. This is more Pythonic than having branches and repeated logic for each case. We want to be as DRY as possible.
Thanks for your contribution!
Refactored code of recording api setup, teardown, and endpoint functions.
Added a get_current_state_str() method to Multimedia to make some code in recording api cleaner.
Fix to recording api logic determining next_id. Fix to test_server.py teardown to undo patching to media_dict
closes #629