File tree Expand file tree Collapse file tree 7 files changed +11
-11
lines changed
python-site-connectivity-checker
source_code_final/rpchecker
source_code_step_2/rpchecker
source_code_step_3/rpchecker
source_code_step_4/rpchecker
source_code_step_5/rpchecker Expand file tree Collapse file tree 7 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ def main():
1212 """Run RP Checker."""
1313 user_args = read_user_cli_args ()
1414 urls = _get_websites_urls (user_args )
15- if len ( urls ) == 0 :
15+ if not urls :
1616 print ("Error: no URLs to check" , file = sys .stderr )
1717 sys .exit (1 )
1818
@@ -34,7 +34,7 @@ def _read_urls_from_file(file):
3434 if file_path .is_file ():
3535 with file_path .open () as urls_file :
3636 urls = [url .strip () for url in urls_file ]
37- if len ( urls ) > 0 :
37+ if urls :
3838 return urls
3939 print (f"Error: empty input file, { file } " , file = sys .stderr )
4040 else :
Original file line number Diff line number Diff line change 33
44
55def site_is_online (url , timeout = 2 ):
6- """Return a True if the target URL is online.
6+ """Return True if the target URL is online.
77
88 Raise an exception otherwise.
99 """
Original file line number Diff line number Diff line change 33
44
55def site_is_online (url , timeout = 2 ):
6- """Return a True if the target URL is online.
6+ """Return True if the target URL is online.
77
88 Raise an exception otherwise.
99 """
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ def main():
99 """Run RP Checker."""
1010 user_args = read_user_cli_args ()
1111 urls = _get_websites_urls (user_args )
12- if len ( urls ) == 0 :
12+ if not urls :
1313 print ("Error: no URLs to check" , file = sys .stderr )
1414 sys .exit (1 )
1515 _synchronous_check (urls )
@@ -27,7 +27,7 @@ def _read_urls_from_file(file):
2727 if file_path .is_file ():
2828 with file_path .open () as urls_file :
2929 urls = [url .strip () for url in urls_file ]
30- if len ( urls ) > 0 :
30+ if urls :
3131 return urls
3232 print (f"Error: empty input file, { file } " , file = sys .stderr )
3333 else :
Original file line number Diff line number Diff line change 33
44
55def site_is_online (url , timeout = 2 ):
6- """Return a True if the target URL is online.
6+ """Return True if the target URL is online.
77
88 Raise an exception otherwise.
99 """
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ def main():
1212 """Run RP Checker."""
1313 user_args = read_user_cli_args ()
1414 urls = _get_websites_urls (user_args )
15- if len ( urls ) == 0 :
15+ if not urls :
1616 print ("Error: no URLs to check" , file = sys .stderr )
1717 sys .exit (1 )
1818
@@ -34,7 +34,7 @@ def _read_urls_from_file(file):
3434 if file_path .is_file ():
3535 with file_path .open () as urls_file :
3636 urls = [url .strip () for url in urls_file ]
37- if len ( urls ) > 0 :
37+ if urls :
3838 return urls
3939 print (f"Error: empty input file, { file } " , file = sys .stderr )
4040 else :
Original file line number Diff line number Diff line change 66
77
88def site_is_online (url , timeout = 2 ):
9- """Return a True if the target URL is online.
9+ """Return True if the target URL is online.
1010
1111 Raise an exception otherwise.
1212 """
@@ -26,7 +26,7 @@ def site_is_online(url, timeout=2):
2626
2727
2828async def site_is_online_async (url , timeout = 2 ):
29- """Return a True if the target URL is online.
29+ """Return True if the target URL is online.
3030
3131 Raise an exception otherwise.
3232 """
You can’t perform that action at this time.
0 commit comments