]> git.phdru.name Git - bookmarks_db.git/commitdiff
Style(Robots): Rename `check_url` to `check_bookmark`
authorOleg Broytman <phd@phdru.name>
Wed, 7 Aug 2024 15:28:49 +0000 (18:28 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 7 Aug 2024 15:28:49 +0000 (18:28 +0300)
Also rename `smart_get` to `get_url`.

Robots/bkmk_rforking.py
Robots/bkmk_rforking_sub.py
Robots/bkmk_robot_base.py
bkmk-add.py
check_urls.py
check_urls_db.py
get_url.py

index c956d135e8d73f2186d1064abcfe014d2ed494e7..ca845b843afaebdda609173496cbf944c3168f1c 100644 (file)
@@ -54,7 +54,7 @@ _set_subproc = True
 class robot_forking(Robot):
     subproc = 'urllib'  # Default subprocess
 
-    def check_url(self, bookmark):
+    def check_bookmark(self, bookmark):
         global _set_subproc
         if _set_subproc:
             _set_subproc = False
index 8bbf68f57028b7c2bfc80c68407ab3d94a9afbe5..76d070d3939fbbbd9716bdf0ccc1ae01be56e813 100755 (executable)
@@ -40,7 +40,7 @@ def run():
     while 1:
         bookmark = pickle.loads(bkmk_in.read_record())
         log(bookmark.href)
-        robot.check_url(bookmark)
+        robot.check_bookmark(bookmark)
         bkmk_out.write_record(pickle.dumps(bookmark))
         log.outfile.flush()
 
index 6d3479a236131460aaab2a872d9ced802f402d8a..bb90d8801d8cd47ec306bdd5541246da21cb593f 100644 (file)
@@ -97,13 +97,13 @@ class robot_base(Robot):
     def version_str(self):
         return self.__class__.__name__
 
-    def check_url(self, bookmark):
+    def check_bookmark(self, bookmark):
         try:
             self.start = int(time.time())
             bookmark.icon = None
 
             error, http_status_code, redirect_to, headers, content = \
-                self.smart_get(bookmark, bookmark.href, True)
+                self.get_url(bookmark, bookmark.href, True)
 
             if error is not None:
                 bookmark.error = error
@@ -217,7 +217,7 @@ class robot_base(Robot):
                                     icon_error, \
                                         icon_status_code, icon_redirect_to, \
                                         icon_headers, icon_data = \
-                                        self.smart_get(bookmark, _icon_url)
+                                        self.get_url(bookmark, _icon_url)
                                     if icon_error:
                                         raise IOError("No icon: " + icon_error)
                                         break
@@ -336,7 +336,7 @@ class robot_base(Robot):
         finally:
             self.finish_check_url(bookmark)
 
-    def smart_get(self, bookmark, url, accept_charset=False):
+    def get_url(self, bookmark, url, accept_charset=False):
         split_results = urlsplit(url)
         url_proto = split_results.scheme
         url_host = split_results.hostname
index d4c1addddbc1780939c78535acc677d344dd5e27..8259df5934b1057a753af6a9fb2abf32970646e5 100755 (executable)
@@ -59,7 +59,7 @@ def run():
     print("Using", robot)
     robot = robot(None)
 
-    robot.check_url(bookmark)  # get real title and last modified date
+    robot.check_bookmark(bookmark)  # get real title and last modified date
     robot.stop()
 
     if title:  # forced title
index 9009d006b1a5f5ef80b99b123f3d74649c17f6ad..e7d68f9246b3afe2e81059b4134025661a449ad0 100755 (executable)
@@ -48,7 +48,7 @@ def run():
         bookmark = Bookmark(href=url, add_date=None)
         bookmark.parent = None
 
-        robot.check_url(bookmark)
+        robot.check_bookmark(bookmark)
 
         if hasattr(bookmark, 'error'):
             print(bookmark.error)
index dbab6bf0f31d51ebb3d9db3e91820068b2ba904d..515bbfc3c034126e9c12fd68a24392695f84232a 100755 (executable)
@@ -133,7 +133,7 @@ def run():
                                 getattr(old_object, attr_name))
             else:
                 log("Checking %s" % href)
-                robot.check_url(object)
+                robot.check_bookmark(object)
 
                 checked[href] = object_no
                 urls_no = urls_no + 1
index 996b829ac0dc497629aa42c43404f3fd28ce95db..2a411e5da119360b8bfeba49e77b4c2d5cb25565 100755 (executable)
@@ -32,7 +32,7 @@ def run():
     bookmark.parent = None
 
     error, redirect_code, redirect_to, headers, content = \
-        robot.smart_get(bookmark, url, True)
+        robot.get_url(bookmark, url, True)
 
     if error:
         sys.stderr.write(error + '\n')