Pep8 formatting changes

This commit is contained in:
Vansh Comar 2021-11-18 12:40:56 +05:30
parent 92577330b6
commit 2158998009

View File

@ -224,10 +224,10 @@ def add_ip_card(html_soup: BeautifulSoup, ip: str) -> BeautifulSoup:
ref_element.insert_before(ip_tag) ref_element.insert_before(ip_tag)
return html_soup return html_soup
def check_currency(response: str): def check_currency(response: str):
"""Check whether the results have currency conversion """Check whether the results have currency conversion
Args: Args:
response: Search query Result response: Search query Result
@ -240,20 +240,25 @@ def check_currency(response: str):
tag = a.find('a') tag = a.find('a')
if tag and tag['href'] == 'https://g.co/gfd': if tag and tag['href'] == 'https://g.co/gfd':
currency1 = soup.find(class_="xUrNXd UMOHqf") currency1 = soup.find(class_="xUrNXd UMOHqf")
currency2 = soup.select_one('.kCrYT' currency2 = soup.select_one('.kCrYT'
' .BNeawe.iBp4i.AP7Wnd .BNeawe.iBp4i.AP7Wnd') ' .BNeawe.iBp4i.AP7Wnd '
'.BNeawe.iBp4i.AP7Wnd')
currency1 = currency1.text.rstrip('=').split(' ', 1) currency1 = currency1.text.rstrip('=').split(' ', 1)
currency2 = currency2.text.split(' ', 1) currency2 = currency2.text.split(' ', 1)
return [float(currency1[0]), currency1[1], float(currency2[0]), currency2[1]] return [float(currency1[0]), currency1[1],
float(currency2[0]), currency2[1]]
return None return None
def add_currency_b(soup: BeautifulSoup, conversion_details: list) -> BeautifulSoup: def add_currency_b(soup: BeautifulSoup,
conversion_details: list) -> BeautifulSoup:
"""Adds the conversion input boxes to the search result """Adds the conversion input boxes to the search result
Args: Args:
soup: The parsed search result containing currency conversion soup: The parsed search result
conversion_details: floating point number to be used for conversion containing currency conversion
conversion_details: Floating point number
to be used for conversion
Returns: Returns:
BeautifulSoup BeautifulSoup