Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
njakuschona authored Apr 12, 2023
1 parent e890748 commit 65510cb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,16 @@ def send_movement(video_filename, audio_filename, data_filename, server_url, box
try:
with open(data_filename, 'r') as dataFile:
data = json.load(dataFile)
files = {}
files['videoKey'] = (os.path.basename(video_filename), open(video_filename, 'rb'))
files['audioKey'] = (os.path.basename(audio_filename), open(audio_filename, 'rb'))
files['json'] = (None, json.dumps(data), 'application/json')
except:
os.remove(video_filename)
os.remove(audio_filename)
os.remove(data_filename)

files = {}
files['videoKey'] = (os.path.basename(video_filename), open(video_filename, 'rb'))
files['audioKey'] = (os.path.basename(audio_filename), open(audio_filename, 'rb'))
files['json'] = (None, json.dumps(data), 'application/json')


if dev_mode:
logging.warning('send_movement deactivated')
Expand Down

0 comments on commit 65510cb

Please sign in to comment.