Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route('/_saveEDL', methods=['GET','POST'])
- def saveEDL():
- if request.method == 'POST':
- jsonData = request.json
- columns = ['#','In','Out','Notes']
- if session['username'] in os.listdir(os.curdir + '/mysite/static/edl/'):
- pass
- else:
- os.mkdir(os.curdir + '/mysite/static/edl/' + session['username'])
- with open(os.curdir + '/mysite/static/edl/' + session['username'] + '/' + str(datetime.datetime.now())[:19].replace(':','') + '-' + session['username'] + '-EDL.csv', 'w') as edl:
- typer = csv.writer(edl)
- typer.writerow(columns)
- i = 1
- for x in jsonData['edits']:
- tempRow = []
- tempRow.append(i)
- tempRow.append(x['inPoint'])
- tempRow.append(x['outPoint'])
- try:
- tempRow.append(x['note'])
- except:
- tempRow.append('')
- typer.writerow(tempRow)
- i += 1
- edl.close()
- session['downloadEDL'] = True
- return redirect(url_for('index'))
- return redirect(url_for('index'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement