Skip to content

Commit 642c195

Browse files
Merge pull request #95 from NamamiShanker/pep8
Change the coding style to PEP8 #95
2 parents 70f199b + 18b8a78 commit 642c195

File tree

6 files changed

+133
-66
lines changed

6 files changed

+133
-66
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ cython_debug/
3131

3232
# User files related to API testing and authentication
3333
access_token.json
34-
response_data.json
34+
response_data.json
35+
36+
# Selenium
37+
geckodriver.log

main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@
6262
if __name__ == "__main__":
6363
if ARGV.start:
6464
print('''
65-
\U0001F604 Hello and Welcome to Dynamic CLI
66-
\U0001F917 Use the following commands to get started
67-
\U0001F50E Search on StackOverflow with '-s'
68-
\U0001F4C4 Open browser to create new Stack Overflow question with '-n [title(optional)]'
65+
\U0001F604 Hello and Welcome to Dynamic CLI
66+
\U0001F917 Use the following commands to get started
67+
\U0001F50E Search on StackOverflow with '-s'
68+
\U0001F4C4 Open browser to create new Stack Overflow question with '-n [title(optional)]'
6969
\U0001F4C2 Save answer to a file with '-file'
70-
\U00002728 Know the version of Dynamic CLI with '-V'
70+
\U00002728 Know the version of Dynamic CLI with '-V'
7171
\U0001F609 See this message again with '-st'
7272
\U00002755 Get help with '-h'
7373
''')

src/arguments/api_test.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def get_request(cls):
3030
# Ask the user for endpoint if not present in request_url
3131
if not(has_endpoint):
3232
if(request_url[-1] == '/'):
33-
endpoint = input("Input endpoint (Without the starting slash): ")
33+
endpoint = input("Input endpoint " +
34+
"(Without the starting slash): ")
3435
else:
3536
endpoint = input("Input endpoint (With the starting slash): ")
3637
request_url += endpoint
@@ -43,7 +44,8 @@ def get_request(cls):
4344
print(f"Reponse Status Code: {response.status_code}")
4445
response_data = json.loads(response.content)
4546
parsed_json = json.dumps(response_data, indent=4)
46-
output_json = highlight(parsed_json, lexers.JsonLexer(), formatters.TerminalFormatter())
47+
output_json = highlight(parsed_json, lexers.JsonLexer(),
48+
formatters.TerminalFormatter())
4749
print(output_json)
4850

4951
store_data = input('Store response data? (Y/N): ')
@@ -53,7 +55,8 @@ def get_request(cls):
5355
print("Response data stored in response_data.json")
5456

5557
except requests.exceptions.InvalidSchema:
56-
print("Check whether the URL is valid or check if the localhost server is active or not")
58+
print("Check whether the URL is valid or check if " +
59+
"the localhost server is active or not")
5760
except Exception as e:
5861
print(e)
5962

src/arguments/search.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def prompt(self):
2020
print(colored(f"{self.message} : ", 'cyan'), end='')
2121
data = input()
2222
if data == "":
23-
SearchError("\U0001F613 Input data empty", "\U0001F504 Please try again ")
23+
SearchError("\U0001F613 Input data empty",
24+
"\U0001F504 Please try again ")
2425
sys.exit()
2526
else:
2627
return str(data)
@@ -74,21 +75,23 @@ def search_for_results(self, save=False):
7475
questions = self.utility_object.get_que(json_output)
7576
if questions == []:
7677
# evoke an error
77-
search_error = SearchError("\U0001F613 No answer found", "\U0001F604 Please try reddit")
78+
SearchError("\U0001F613 No answer found",
79+
"\U0001F604 Please try reddit")
7880
else:
7981
data = self.utility_object.get_ans(questions)
8082
print('''
81-
\U0001F604 Hopefully you found what you were looking for!
82-
\U0001F4C2 You can save an answer to a file with '-file'
83+
\U0001F604 Hopefully you found what you were looking for!
84+
\U0001F4C2 You can save an answer to a file with '-file'
8385
8486
Not found what you were looking for \U00002754
85-
\U0001F4C4 Open browser and post your question on StackOverflow with '-n [title (optional)]'
86-
87-
\U0001F50E To search more use '-s'
87+
\U0001F4C4 Open browser and post your question
88+
on StackOverflow with '-n [title (optional)]'
89+
90+
\U0001F50E To search more use '-s'
8891
''')
8992

9093
if save:
9194
filename = SaveSearchResults(data)
9295
print(
93-
colored(f"\U0001F604 Answers successfully saved into {filename}",
94-
"green"))
96+
colored("\U0001F604 Answers successfully saved into" +\
97+
filename, "green"))

src/arguments/update.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class UpdateApplication(object):
88
def __init__(self, current_version):
9-
9+
1010
"""
1111
Check for updates in the application
1212
@@ -26,13 +26,16 @@ def check_for_updates(self):
2626
data = data.json()
2727
if 'message' in data:
2828
if data['message'] == "Not Found":
29-
print(colored("The application do not have any release", "yellow"))
29+
print(colored("The application do not have any release",
30+
"yellow"))
3031
return None
3132

3233
if data["tag_name"] == self.current_version:
33-
print(colored("Yeah! You have the latest version", "green"))
34+
print(colored("Yeah! You have the latest version",
35+
"green"))
3436
else:
35-
print(colored(f"New release found - {data.tag_name}", "red"))
37+
print(colored(f"New release found - {data.tag_name}",
38+
"red"))
3639
webbrowser.open(data["html_url"])
3740

3841
except Exception as exception:

0 commit comments

Comments
 (0)