WebApp

Check-in [1fb09ada1a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Viewlog updated.Context manager fully implemented
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:1fb09ada1af23e0e6c8c2bc29e720eafe5e8fd389dd345aec40800d281055bbb
User & Date: sebpc 2018-05-20 18:03:09
Context
2018-05-24
16:25
Testing session with quick_session.py check-in: 797f77c5d7 user: sebpc tags: trunk
2018-05-20
18:03
Viewlog updated.Context manager fully implemented check-in: 1fb09ada1a user: sebpc tags: trunk
2018-05-19
08:50
Unnecessary files deletion check-in: 1d62c4f5b4 user: sebpc tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to vsearch4web.py.

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@app.route('/')
@app.route('/entry')
def entry_page() -> 'html':
	return render_template('entry.html', the_title='Welcome to search4letters on the web')

@app.route('/viewlog')
def view_the_log() -> str:
    contents = []
    with open('vsearch.log') as log:
        for line in log:
            contents.append([])
            for item in line.split('|'):
                contents[-1].append(escape(item))
    titles = ('Form Data', 'Remote_addr', 'User_agent', 'Results')
    return render_template('viewlog.html',
                               the_title = 'View Log',
                               the_row_titles = titles,
                               the_data = contents,)

#if '__name__' == '__main__':
app.run(debug=True)







|
|
|
|
|
<
|







36
37
38
39
40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
55
@app.route('/')
@app.route('/entry')
def entry_page() -> 'html':
	return render_template('entry.html', the_title='Welcome to search4letters on the web')

@app.route('/viewlog')
def view_the_log() -> str:
    with UseDatabase(db) as cursor:
        _SQL = """select phrase, letters, ip, browser_string, results
        from log;"""
        cursor.execute(_SQL)
        contents = cursor.fetchall()

    titles = ('Phraise', 'Letters', 'Remote addr', 'User_agent', 'Results')
    return render_template('viewlog.html',
                               the_title = 'View Log',
                               the_row_titles = titles,
                               the_data = contents,)

#if '__name__' == '__main__':
app.run(debug=True)