Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
global question_post
if self.cachedQuestions[index] != None:
question_post = self.cachedQuestions[index]
LOOP.widget = question_post
else:
if not google_search:
url = sourl + url
question_title, question_desc, question_stats, answers = get_question_stats_and_answer(url)
question_post = QuestionPage((answers, question_title, question_desc, question_stats, url))
self.cachedQuestions[index] = question_post
LOOP.widget = question_post
global header_for_display
global question_page
global LOOP
header_for_display = Header()
try:
if google_search:
questions = get_questions_for_query_google(query)
else:
questions = get_questions_for_query(query)
question_page = SelectQuestionPage(questions)
LOOP = EditedMainLoop(question_page, palette)
LOOP.run()
except UnicodeEncodeError:
print_warning("\n\nEncoding error: Use \"chcp 65001\" command before using socli...")
sys.exit(0)
except requests.exceptions.ConnectionError as e:
print_fail("Please check your internet connectivity...")
except Exception as e:
def dispres(url):
"""
Display result page
:param url: URL of the search result
:return:
"""
global question_post
global header_for_display
global LOOP
randomheaders()
res_page = requests.get(url, headers=header)
captchacheck(res_page.url)
header_for_display = Header()
question_title, question_desc, question_stats, answers = get_question_stats_and_answer(url)
question_post = QuestionPage((answers, question_title, question_desc, question_stats, url))
LOOP = EditedMainLoop(question_post, palette)
LOOP.run()