Skip to content

Commit 0b86f0c

Browse files
shitalmule04ganeshhubale
authored andcommitted
readit accepts Yes or No option in lowercase (#124)
* readit accepts Yes or No option in lowercase * added yes in update * accepts yes in lowercase in the update option * Fixed some PEP 8 compliants * Eliminated elif condition for yes/no options
1 parent 01e8688 commit 0b86f0c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

readit/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ def option_yes_no(url):
129129
"""
130130
Asks whether to bookmark invalid URLs or Offline URLs to database.
131131
"""
132-
option = input("Still you want to bookmark: Yes/No --> ")
133-
if option == "Yes" or option == "Y" or option == "y":
132+
option = input("Still you want to bookmark: Yes/No ? ")
133+
if option.lower() in ['yes', 'y']:
134134
database_connection.add_url(url)
135135
else:
136136
sys.exit(0)
@@ -140,8 +140,8 @@ def tag_option_yes_no(tag_name, tagged_url):
140140
"""
141141
Asks whether to tag and bookmark invalid URLs or Offline URLs.
142142
"""
143-
option = input("Still you want to update: Yes/No --> ")
144-
if option == "Yes" or option == "Y" or option == "y":
143+
option = input("Still you want to update: Yes/No ? ")
144+
if option.lower() in ['yes', 'y']:
145145
database_connection.tag_url(tag_name, tagged_url)
146146
else:
147147
sys.exit(0)
@@ -151,6 +151,6 @@ def update_option_yes_no(url_id, url):
151151
"""
152152
Asks whether to update existing bookmark with invalid URLs or Offline URLs
153153
"""
154-
option = input("Still you want to update: Yes/No --> ")
155-
if option == "Yes" or option == "Y" or option == "y":
154+
option = input("Still you want to update: Yes/No ? ")
155+
if option.lower() in ['yes', 'y']:
156156
database_connection.update_url(url_id, url)

0 commit comments

Comments
 (0)