Esempio n. 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')
Esempio n. 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')
Esempio n. 3
0
def fonts_static_proxy(path):
    print path
    return app.send_static_file(os.path.join('fonts', path))
Esempio n. 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')
Esempio n. 6
0
def gad_gateway_error(error):
    return app.send_static_file('502.html')
Esempio n. 7
0
def showTimestamp(timestamp):
    return app.send_static_file('indexname.html', content=timestamp)
Esempio n. 8
0
def basic_pages(**kwargs):
    return app.send_static_file('index.html')
Esempio n. 9
0
def default():
    return app.send_static_file('js/bundle.js')
Esempio n. 10
0
def js_static_proxy(path):
    return app.send_static_file(os.path.join('js', path))
Esempio n. 11
0
def dist_static_proxy(path):
    # print os.path.join('css', path)
    return app.send_static_file(os.path.join('dist', path))
Esempio n. 12
0
def get_data():
    return app.send_static_file("data.json")
Esempio n. 13
0
def index():
    print('main directory!!!')
    return app.send_static_file('index.html')
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 17
0
def not_found(e):
    return app.send_static_file("index.html")
Esempio n. 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))
Esempio n. 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)))
Esempio n. 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))
Esempio n. 21
0
def bundle():
    return app.send_static_file('css/default.css')
Esempio n. 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))
Esempio n. 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)))
Esempio n. 24
0
def index():
    return app.send_static_file('index.html')
Esempio n. 25
0
def basic_pages(**kwargs):
    return app.send_static_file('index.html')
Esempio n. 26
0
def api_collection_set_geo():
    return app.send_static_file(
        os.path.join('data', 'country-collections.json'))
Esempio n. 27
0
def hello_world():
    return app.send_static_file('untitled.html')
Esempio n. 28
0
def js_static_proxy(path):
    return app.send_static_file(os.path.join('js', path))
Esempio n. 29
0
def send_static_file(filename):
    return app.send_static_file(filename)
Esempio n. 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')
Esempio n. 32
0
def serve():
    return app.send_static_file("index.html")
def requests_error(error):
    return app.send_static_file('500.html')
Esempio n. 34
0
def root1():
    return app.send_static_file('index.html')