def mousePressed(event, data): # use event.x and event.y for option in data.options: if option.clicked(event.x, event.y): option.doOption(data) if data.voiceIcon.clicked(event.x, event.y): voiceInput = getUserVoice() #run feature based on voice input if 'stats' in voiceInput.lower(): userStats.run(data.user) elif 'nutrition' in voiceInput.lower(): cmuNutritionData.run(data.width, data.height) elif 'trajectory' in voiceInput.lower(): trajectory.run(data.user) elif 'meal history' in voiceInput.lower(): mealHistory.run(data.user, data.width, data.height) elif 'log' in voiceInput.lower(): todaysMealLog.run(data.user, data.width, data.height) elif 'recommend' in voiceInput.lower(): recommend.run(data.user) elif 'facebook' in voiceInput.lower(): share.run(data.user) elif 'search' in voiceInput.lower(): search.run() elif 'about us' in voiceInput.lower(): aboutUs.run() else: tm.showerror('Uh Oh! :(', "I can't understand what you're saying. Could you be a bit more specific?'")
def run(): print("Creating whole project") index.run() e404.run() timeline.run() contestants.run() search.run() static_files.run()
def run(): print("Creating the whole project") index.run() e404.run() timeline.run() countries.run() search.run() static_files.run()
def run(): print("Creating whole project") index.run() e404.run() timeline.run() countries.run() search.run() static_files.run() backward_compatibility.run()
def doOption(self, data): #user has clicked on option, open new page according to option r, c = self.row, self.col if r == 0 and c == 0: userStats.run(data.user) elif r == 0 and c == 1: cmuNutritionData.run(data.width, data.height) elif r == 0 and c == 2: trajectory.run(data.user) elif r == 1 and c == 0: mealHistory.run(data.user, data.width, data.height) elif r == 1 and c == 1: todaysMealLog.run(data.user, data.width, data.height) elif r == 1 and c == 2: recommend.run(data.user) elif r == 2 and c == 0: share.run(data.user) elif r == 2 and c == 1: search.run(data.user) elif r == 2 and c == 2: aboutUs.run()
def searcher(query): # can use templates to write html code that depends on arguments # template html files have to be in templates folder !!! tuple_search = search.run(query) return render_template("results.html", query=query, results=tuple_search[0], seconds=tuple_search[1])
def make_menu(root, account): root_menu = Menu(root) root.config(menu=root_menu) file_menu = Menu(root_menu, tearoff=False) # file_menu.add_command(label='Открыть...', command=do_nothing) open_menu = Menu(file_menu, tearoff=False) open_menu.add_command( label='Таблицы...', command=(lambda: db_viewer.run(TABLES, root, account))) open_menu.add_command( label='Представления...', command=(lambda: db_viewer.run(VIEWS, root, account))) file_menu.add_cascade(label='Открыть', menu=open_menu) file_menu.add_separator() file_menu.add_command(label='Настройки...', command=do_nothing) file_menu.add_separator() file_menu.add_command(label='Выход из аккаунта', command=(lambda: login.run(root))) file_menu.add_command(label='Выход', command=root.quit) root_menu.add_cascade(label='Файл', menu=file_menu) report_menu = Menu(root_menu, tearoff=False) # report_names = db_helper.get_report_names() # print('REPORT NAMES :', report_names) # print('get_number_of_kilometers_traveled :', db_helper.get_number_of_kilometers_traveled(2)) # print('get_driver_path_lengths :', db_helper.get_driver_path_lengths()) # print('get_profit_on_period :', db_helper.get_profit_on_period((12, 1, 2015), (12, 4, 2015))) # print('count_costs_on_company_development :', # db_helper.count_costs_on_company_development((12, 3, 2015), (13, 3, 2015))) # print('year_profit_statistics :', db_helper.year_profit_statistics()) report_menu.add_command(label='Сгенерировать...', command=(lambda: reports.run(root, account))) root_menu.add_cascade(label='Отчет', menu=report_menu) tools_menu = Menu(root_menu, tearoff=False) tools_menu.add_command(label='Поиск по соединению таблиц...', command=(lambda: search.run(root, account))) if account.is_admin(): tools_menu.add_command( label='SQL запрос к базе данных...', command=(lambda: raw_query.make_raw_query(root))) tools_menu.add_separator() tools_menu.add_command(label='Статистика', command=(lambda: do_nothing())) root_menu.add_cascade(label='Инструменты', menu=tools_menu) help_menu = Menu(root_menu, tearoff=False) help_menu.add_command(label='Просмотреть справку') help_menu.add_separator() help_menu.add_command(label='О программе') root_menu.add_cascade(label='Справка', menu=help_menu)
def command_line_runner(): """ 执行命令行操作 """ parser = get_parser() args = vars(parser.parse_args()) if args['version']: print(VERSION) return if not args["keyword"]: parser.print_help() else: magnets = search.run(kw=args["keyword"], num=args["num"], sort=args["sort"]) if args["output"]: utils.save_file(magnets, args["output"]) else: utils.print_format(magnets) print("搜索完成 ...")
def cxTime(self): self.ip = self.e.get() self.serverName = self.f.get() self.sel0(), self.sel1(), self.sel2(), self.sel3(), self.sel4( ), self.sel5() if self.ets0 != NONE and self.ete0 != NONE: print(self.ete0) sVal = search.run(self.ip, self.serverName, self.ets0, self.ete0) print(type(sVal)) for k, v in enumerate(sVal): Label(self, text=v).grid(row=k + 10, column=1) if self.ets1 != NONE and self.ete1 != NONE: print(self.ete1) sVal = search.run(self.ip, self.serverName, self.ets1, self.ete1) for k, v in enumerate(sVal): Label(self, text=v).grid(row=k + 10, column=2) if self.ets2 != NONE and self.ete2 != NONE: print(self.ete2) sVal = search.run(self.ip, self.serverName, self.ets2, self.ete2) for k, v in enumerate(sVal): Label(self, text=v).grid(row=k + 10, column=3) if self.ets3 != NONE and self.ete3 != NONE: print(self.ip) sVal = search.run(self.ip, self.serverName, self.ets3, self.ete3) for k, v in enumerate(sVal): Label(self, text=v).grid(row=k + 10, column=4) if self.ets4 != NONE and self.ete4 != NONE: print(self.ip) sVal = search.run(self.ip, self.serverName, self.ets4, self.ete4) for k, v in enumerate(sVal): Label(self, text=v).grid(row=k + 10, column=5) if self.ets5 != NONE and self.ete5 != NONE: print(self.ip) sVal = search.run(self.ip, self.serverName, self.ets5, self.ete5) for k, v in enumerate(sVal): Label(self, text=v).grid(row=k + 10, column=6)
def run(params, reducer, dispatcher, bl): search.run(params, reducer, dispatcher, bl)
import utils import search r = utils.get_filename("rick") # print(r) search.run("game of thrones", "torrents")
def make_toolbar(root, account): global toolbar toolbar = Frame(root) toolbar.pack(side=TOP, fill=X) toolbar.config(padx=5, pady=3) toolbar.config(bg='#CCF') # FFA clear_main_frame_button = ToolbarButton(toolbar, text='Очистить main_frame') # clear_main_frame_button.pack(side=LEFT, fill=Y) clear_main_frame_button.config( command=(lambda: clear_main_frame(root, account))) open_table_button = ToolbarButton(toolbar, text='Таблицы') open_table_button.pack(side=LEFT, fill=Y) open_table_button.config( command=(lambda: db_viewer.run(TABLES, root, account))) open_view_button = ToolbarButton(toolbar, text='Представления') open_view_button.pack(side=LEFT, fill=Y) open_view_button.config(command=(lambda: db_viewer.run( VIEWS, root, account, ))) if account.is_admin(): make_row_query_button = ToolbarButton( toolbar, text='SQL запрос к базе данных...') make_row_query_button.pack(side=LEFT, fill=Y) make_row_query_button.config( command=(lambda: raw_query.make_raw_query(root))) make_report_button = ToolbarButton(toolbar, text='Отчеты') make_report_button.pack(side=LEFT, fill=Y) make_report_button.config(command=(lambda: reports.run(root, account))) make_report_button = ToolbarButton(toolbar, text='Поиск по соединению таблиц') make_report_button.pack(side=LEFT, fill=Y) make_report_button.config(command=(lambda: search.run(root, account))) logout_button = ToolbarButton(toolbar) logout_image_path = '../TransportationsDBInterface/resourses/logout2.png' logout_image = PhotoImage(file=logout_image_path) logout_button.config(image=logout_image, bg='#CCF', relief=FLAT) logout_button.image = logout_image logout_button.config(width=50, height=50) logout_button.pack(side=RIGHT) logout_button.config(command=(lambda: login.run(root))) logout_button.config(activebackground='#CCF', bd=0) preferencies_button = ToolbarButton(toolbar, text='Настройки') blue_referencies_path = '../TransportationsDBInterface/resourses/blue_preferencies2.png' blue_referencies_image = PhotoImage(file=blue_referencies_path) preferencies_button.config(image=blue_referencies_image, bg='#CCF', relief=FLAT) # bg='#CCF' preferencies_button.image = blue_referencies_image preferencies_button.pack(side=RIGHT, fill=Y) preferencies_button.config(activebackground='#CCF', bd=0) search_button = ToolbarButton(toolbar) lens_image_path = '../TransportationsDBInterface/resourses/blue_lens.png' lens_image = PhotoImage(file=lens_image_path) search_button.config( image=lens_image, bg='#CCF', relief=FLAT) # relief ::= FLAT, SUNKEN, RAISED, GROOVE, SOLID, RIDGE search_button.image = lens_image search_button.config(width=50, height=50) search_button.pack(side=RIGHT) # search_button.bind('<ButtonPress>', lambda event: search_button.config(bg='#CCF')) search_button.config(activebackground='#CCF', bd=0)
print path mtime = lambda f: os.stat(os.path.join(path, f)).st_mtime files = list(sorted(os.listdir(path), key=mtime, reverse=True)) return path + "/" + files[0] def generate_view(): bulk_data_for_sunburst.run() bulk_data_for_chart.run() bulk_data_for_sunburst.run() if __name__ == "__main__": argvs = sys.argv if len(argvs) < 1: print "You need decoder directory" filename = "textsum/log_root/decode" driver = webdriver.Chrome("shellscript/chromedriver") #driver.get('file:///Users/keiohigh2nd/deepKarte/view/ATE.html') driver.get( "file:///Users/keiohigh2nd/deepKarte/view/find_similar_patient.html") while True: updated_file = sorted_ls(filename) search.run(updated_file) generate_view() time.sleep(5) # Let the user actually see something! driver.refresh()
def search_youtube(query): query = escape(query) search.run(query, "youtube") return redirect("/result/" + query)