From e8835504ff83f60f086544d60ec418a96ba08da2 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Fri, 25 Mar 2016 13:32:43 +0530 Subject: [PATCH] Reformat, add notifications and errors. Signed-off-by: Arun Prakash Jana --- buku | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/buku b/buku index 47f0c33..7772aea 100755 --- a/buku +++ b/buku @@ -147,7 +147,9 @@ def getPageResp(url, redir=False): url = url.replace(" ", "%20") else: url = unquote(url) - print("unquote: %s" % url) + + if debug: + print("unquoted: %s" % url) if url.find("https://") >= 0: # Secure connection server = url[8:] @@ -166,6 +168,7 @@ def getPageResp(url, redir=False): server = server[:marker] urlconn = HTTPConnection(server, timeout=30) else: + print("\x1b[1mWARNING:\x1b[21m Not a valid HTTP(S) url") return (None, None) if debug: @@ -207,7 +210,7 @@ def fetchTitle(url): # break same URL redirection loop if url == redirurl: - print("\x1b[1mERROR:\x1b[21m Detected repeated reirection to same URL") + print("\x1b[1mERROR:\x1b[21m Detected repeated redirection to same URL") break url = redirurl