X-Git-Url: https://git.phdru.name/?p=bookmarks_db.git;a=blobdiff_plain;f=Robots%2Fbkmk_robot_base.py;h=30a26bf137138ef40b4da218efeab4be64acc399;hp=80079b4d9006a45793d212b898b319c004a3a5c9;hb=1322d04c660325532fe6e2bd0aa10ab8a4693440;hpb=c19fbf714f025012d089aa86e4fa8e3b46f3a01e diff --git a/Robots/bkmk_robot_base.py b/Robots/bkmk_robot_base.py index 80079b4..30a26bf 100644 --- a/Robots/bkmk_robot_base.py +++ b/Robots/bkmk_robot_base.py @@ -32,13 +32,13 @@ reloc_dict = { } -def get_error(msg): - if isinstance(msg, str): - return msg +def get_error(e): + if isinstance(e, str): + return e else: s = [] - for i in msg: + for i in e: s.append("'%s'" % str(i).replace('\n', "\\n")) return "(%s)" % ' '.join(s) @@ -95,7 +95,7 @@ class robot_base(Robot): bookmark.last_modified = last_modified md5 = md5wrapper() - if urllib._urlopener.type == "ftp": # Pass welcome message through MD5 + if url_type == "ftp": # Pass welcome message through MD5 md5.update(self.get_ftp_welcome()) md5.update(content) @@ -222,8 +222,5 @@ class robot_base(Robot): def finish_check_url(self, bookmark): start = self.start bookmark.last_tested = str(start) - now = int(time.time()) bookmark.test_time = str(now - start) - - self.cleanup()