示例#1
0
 def select_question(self, url, index):
     if self.cachedQuestions[index] is not None:
         tui.question_post = self.cachedQuestions[index]
         tui.MAIN_LOOP.widget = tui.question_post
     else:
         if not search.google_search:
             url = search.so_url + url
         question_title, question_desc, question_stats, answers = search.get_question_stats_and_answer(url)
         question_post = tui.QuestionPage((answers, question_title, question_desc, question_stats, url))
         self.cachedQuestions[index] = question_post
         tui.MAIN_LOOP.widget = question_post
示例#2
0
文件: printer.py 项目: souveekp/socli
def display_results(url):
    """
    Display result page
    :param url: URL of the search result
    :return:
    """
    search.random_headers()
    res_page = requests.get(url, headers=search.header)
    search.captcha_check(res_page.url)
    tui.display_header = tui.Header()
    question_title, question_desc, question_stats, answers = search.get_question_stats_and_answer(url)
    tui.question_post = tui.QuestionPage((answers, question_title, question_desc, question_stats, url))
    tui.MAIN_LOOP = tui.EditedMainLoop(tui.question_post, palette)
    tui.MAIN_LOOP.run()
示例#3
0
 def test07_searchStats(self):
     try:
         _search.get_question_stats_and_answer(self.surl)
     except Exception:
         raise SoCLITestingException("Search SO stats test failed.")