Commit 063ea2a9 by Michelle Awh

added help manual

parent d33638a0
......@@ -4,6 +4,20 @@ import PySimpleGUI as sg
import SearchResults
import webbrowser
help_message = "Welcome to WikiWikiHow! \n\n Here you can Filter your WikiHow requests to better focus your search! \n\n \
To add required words to your search, put single or double quotations around them e.g 'purple' \n\n \
to add forbidden words to your search, put them behind a hyphen i.e - gun fight \n\n \
Filters Include: \n\n ChildSafety: Removes forbidden or otherwise inappropriate words \n\n \
date_updated: Filters how recent (in months) you'd like your article to be \n\n \
Expert Co-authored: Only returns Articles that have been Expert Co-Authored \n\n \
Quality Tested: Only returns Articles that have been Quality Tested \n\n \
Minimum % viewers who found it helpful: The Minimum Percentage voters who would have voted the articles helpful \n\n \
Number of people who voted on helpfulness: The minimum number of people who voted on helpfulness of the Article \n\n \
Number of sources cited: The minimum number of sources cited by the article \n\n \
Views: the minimum number of views an article can have \n\n \
Language: what Language the article is Required to be available in"
def interact(filters = {}):
......@@ -13,9 +27,7 @@ def interact(filters = {}):
can be entered.
The window can be closed by clicking the x at the top right of the box.
'''
layout = [[sg.Text('Wikihow Tool')],
layout = [[sg.Text('Wikihow Tool'), sg.Button('Help')],
[sg.Text('Search Here'), sg.Input(key = 'Query'), sg.Button('Search')],
[sg.Text('Filters', font = ('Helvetica', 15, 'underline'))],
[sg.Text('ChildSafety'), sg.CBox('On', key = 'child_safe'), sg.Spin([i for i in range(53)], initial_value=0, key = "date_updated"), sg.Text('Max time (months) since last update')],
......@@ -27,20 +39,22 @@ def interact(filters = {}):
[sg.Combo(['English', 'Español', 'Português', 'Italiano', 'Français', 'русский язык', 'Deutsch', '简体中文', 'Nederlands', 'Čeština', 'Bahasa', '日本語', 'हिंदी', 'ภาษาไทย',' العَرَبِيةُ', 'Tiếng Việt', '한국말', 'Türkçe',' فارسی'], key = 'language'), sg.Text('Available in')]]
#layout_x = layout
window = sg.Window('WikiHow Search and Filters', layout)
results_pg_active = False
window = sg.Window('WikiHow Search and Filters', layout)
results_pg_active = False
while True:
event, values = window.read()
if event == sg.WIN_CLOSED:
break
elif not results_pg_active and event == 'Search':
results_pg_active = True
filters = values
wh_query = values['Query']
display_results(filters, results_pg_active)
results_pg_active = False
window.close()
while True:
event, values = window.read()
if event == sg.WIN_CLOSED:
break
elif event == 'Help':
sg.popup_scrolled(help_message, title='WikiWikiHow Manual :)')
elif not results_pg_active and event == 'Search':
results_pg_active = True
filters = values
wh_query = values['Query']
display_results(filters, results_pg_active)
results_pg_active = False
window.close()
def display_results(filters, results_pg_active):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment