-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
32 lines (28 loc) · 827 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from os import link
from flask import Flask, request, render_template, redirect, url_for
from components import WebBrowser
import webbrowser
import main
# app = Flask(__name__)
app = Flask(__name__, static_url_path='/static')
link = ""
run = False
@app.route('/')
def searchify():
return render_template('index.html')
@app.route('/', methods=['POST'])
def searchify_results():
global link
playName = request.form['playName']
playLen = request.form['playLen']
link = str(main.createPlaylist(playName, playLen))
#WebBrowser.printLink(link)
return redirect(url_for("link_share"))
@app.route('/results')
def link_share():
global link
#webbrowser.open_new_tab(link)
return render_template('results.html')
#return redirect(url_for("searchify"))
if __name__ == "__main__":
app.run()