示例#1
0
def chart_form():
    #print("chart_form logic")
    if request.method == 'POST':
        CountryCode = [
            request.form['country-1'], request.form['country-2'],
            request.form['country-3']
        ]
        indicator1 = request.form['indicator-1']
        indicator2 = request.form['indicator-2']
        country1 = request.form['country-1']
        country2 = request.form['country-2']
        country3 = request.form['country-3']
        startY = request.form['start-year']
        endY = request.form['end-year']
        cleanedList = [x for x in CountryCode if str(x) != 'NaN']
        if (startY == endY and country1 == 'NaN' and country2 == 'NaN'
                and country3 == 'NaN' and indicator2 == 'NaN'
                and indicator1 != 'NaN'):
            return pyecharts(indicator1, startY, endY)
        elif (startY == endY and country1 == 'NaN' and country2 == 'NaN'
              and country3 == 'NaN' and indicator2 != 'NaN'
              and indicator1 != 'NaN'):
            return chart3(indicator1, indicator2, startY, endY)
        elif ((int(endY) - int(startY)) > 5 and indicator1 != 'NaN'
              and indicator2 == 'NaN' and
              (country1 != 'NaN' or country2 != 'NaN' or country3 != 'NaN')):
            return chart2(indicator1, cleanedList, startY, endY)
        elif (startY <= endY and indicator1 != 'NaN' and indicator2 == 'NaN'
              and
              (country1 != 'NaN' or country2 != 'NaN' or country3 != 'NaN')):
            return chart1(indicator1, cleanedList, startY, endY)
        elif (startY <= endY and indicator1 != 'NaN' and indicator2 != 'NaN'
              and country1 != 'NaN'):
            return chart4(indicator1, indicator2, country1, country2, country3,
                          startY, endY)
        else:
            return app.send_static_file('chart_form.html')
    else:
        return app.send_static_file('chart_form.html')
示例#2
0
def loginPage():
    html = '<!DOCTYPE html>\n<html>\n<body>\n'
    html += '<p>Click the button to open a new browser window.</p>'
    html += '<button onclick="myFunction()">Try it</button>'
    html += '<script>'
    html += 'function myFunction(){'
    #    html += 'window.open("https://www.w3schools.com/jsref/met_win_open.asp");'
    html += 'var w = window.open("", "MsgWindow", "width=200,height=100");'
    html += 'w.document.write("<p>This is MsgWindow. I am 200px wide and 100px tall!</p>");'
    html += '}'
    html += '</script>'
    html += '</body></html>'
    #    return html
    # return jsonify("unter construction")
    return app.send_static_file('login.html')
示例#3
0
def fonts_static_proxy(path):
    print path
    return app.send_static_file(os.path.join('fonts', path))
示例#4
0
def dist_static_proxy(path):
    # print os.path.join('css', path)
    return app.send_static_file(os.path.join('dist', path))
def page_not_found(error):
    return app.send_static_file('404.html')
示例#6
0
def gad_gateway_error(error):
    return app.send_static_file('502.html')
示例#7
0
def showTimestamp(timestamp):
    return app.send_static_file('indexname.html', content=timestamp)
示例#8
0
def basic_pages(**kwargs):
    return app.send_static_file('index.html')
示例#9
0
def default():
    return app.send_static_file('js/bundle.js')
示例#10
0
def js_static_proxy(path):
    return app.send_static_file(os.path.join('js', path))
示例#11
0
def dist_static_proxy(path):
    # print os.path.join('css', path)
    return app.send_static_file(os.path.join('dist', path))
示例#12
0
def get_data():
    return app.send_static_file("data.json")
示例#13
0
def index():
    print('main directory!!!')
    return app.send_static_file('index.html')
示例#14
0
def img_static_proxy(path):
    # send_static_file will guess the correct MIME type
    return app.send_static_file(os.path.join('img', path))
示例#15
0
def partials_static_proxy(path):
    # send_static_file will guess the correct MIME type
    return app.send_static_file(os.path.join('partials', path))
示例#16
0
def libs_static_proxy(path):
    # send_static_file will guess the correct MIME type
    return app.send_static_file(os.path.join('bower_components', path))
示例#17
0
def not_found(e):
    return app.send_static_file("index.html")
示例#18
0
def libs_static_proxy(path):
    # send_static_file will guess the correct MIME type
    return app.send_static_file(os.path.join('bower_components', path))
示例#19
0
def frontend_path_files(filepath, extension):
    print "match file {0}".format(filepath)
    from server import app
    return app.send_static_file(os.path.join("{0}.{1}".format(filepath, extension)))
示例#20
0
def partials_static_proxy(path):
    # send_static_file will guess the correct MIME type
    return app.send_static_file(os.path.join('partials', path))
示例#21
0
def bundle():
    return app.send_static_file('css/default.css')
示例#22
0
def img_static_proxy(path):
    # send_static_file will guess the correct MIME type
    return app.send_static_file(os.path.join('img', path))
示例#23
0
def frontend_path_files(filepath, extension):
    print "match file {0}".format(filepath)
    from server import app
    return app.send_static_file(
        os.path.join("{0}.{1}".format(filepath, extension)))
示例#24
0
def index():
    return app.send_static_file('index.html')
示例#25
0
def basic_pages(**kwargs):
    return app.send_static_file('index.html')
示例#26
0
def api_collection_set_geo():
    return app.send_static_file(
        os.path.join('data', 'country-collections.json'))
示例#27
0
def hello_world():
    return app.send_static_file('untitled.html')
示例#28
0
def js_static_proxy(path):
    return app.send_static_file(os.path.join('js', path))
示例#29
0
def send_static_file(filename):
    return app.send_static_file(filename)
示例#30
0
def api_collection_set_geo():
    return app.send_static_file(os.path.join('data', 'country-collections.json'))
def hello_world():
    return app.send_static_file('index.html')
示例#32
0
def serve():
    return app.send_static_file("index.html")
def requests_error(error):
    return app.send_static_file('500.html')
示例#34
0
文件: routes.py 项目: a2975667/QV-app
def root1():
    return app.send_static_file('index.html')