]> git.phdru.name Git - bookmarks_db.git/commitdiff
Adapt to the latest code
authorOleg Broytman <phd@phdru.name>
Sun, 29 Jun 2014 16:06:20 +0000 (20:06 +0400)
committerOleg Broytman <phd@phdru.name>
Sun, 29 Jun 2014 16:06:20 +0000 (20:06 +0400)
bkmk-add.py

index fd9723b4a3dd3b686781b5f07beb22d8ddb23fcf..a350292a2adf415534a339e67f6338d72a3b5401 100755 (executable)
@@ -2,15 +2,16 @@
 """Add a bookmark to the database
 
 This file is a part of Bookmarks database and Internet robot.
 """Add a bookmark to the database
 
 This file is a part of Bookmarks database and Internet robot.
+
 """
 
 __author__ = "Oleg Broytman <phd@phdru.name>"
 """
 
 __author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 2002-2012 PhiloSoft Design"
+__copyright__ = "Copyright (C) 2002-2014 PhiloSoft Design"
 __license__ = "GNU GPL"
 
 import sys, os, time
 from bkmk_objects import Bookmark
 __license__ = "GNU GPL"
 
 import sys, os, time
 from bkmk_objects import Bookmark
-from Robots.bkmk_rsimple import robot_simple
+from robots import robot
 
 
 def run():
 
 
 def run():
@@ -51,8 +52,10 @@ def run():
    now = int(time.time())
    bookmark = Bookmark(href, str(now), '0', '0')
    bookmark.name = ''
    now = int(time.time())
    bookmark = Bookmark(href, str(now), '0', '0')
    bookmark.name = ''
+   bookmark.parent = None
 
 
-   robot = robot_simple(None)
+   global robot
+   robot = robot(None)
 
    if robot.check_url(bookmark): # get real title and last modified date
       if title: # forced title
 
    if robot.check_url(bookmark): # get real title and last modified date
       if title: # forced title
@@ -61,6 +64,7 @@ def run():
          bookmark.name = bookmark.real_title
       if report_stats:
          sys.stdout.write("Adding %s with title '%s'\n" % (href, bookmark.name))
          bookmark.name = bookmark.real_title
       if report_stats:
          sys.stdout.write("Adding %s with title '%s'\n" % (href, bookmark.name))
+      del bookmark.parent
       root_folder.append(bookmark)
 
       if report_stats:
       root_folder.append(bookmark)
 
       if report_stats: