X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Robots%2Fbkmk_rforking_sub.py;h=9b25b5b98e5bd28d514c84c21f735ae5f9d77ae7;hb=29bcfff98ab1f8ebb0e56842d2e1901fe0142934;hp=7a74ffcf37b280e337263f79eec8a035718212d9;hpb=fb7aba15d916410adb1ce09be7027edf3a25a31c;p=bookmarks_db.git diff --git a/Robots/bkmk_rforking_sub.py b/Robots/bkmk_rforking_sub.py index 7a74ffc..9b25b5b 100755 --- a/Robots/bkmk_rforking_sub.py +++ b/Robots/bkmk_rforking_sub.py @@ -1,14 +1,12 @@ #! /usr/bin/env python -"""Check URL - subprocess for the forking robot +"""Subprocess for the forking robot - check URL using bkmk_rurlib robot This file is a part of Bookmarks database and Internet robot. + """ -__version__ = "$Revision$"[11:-2] -__revision__ = "$Id$"[5:-2] -__date__ = "$Date$"[7:-2] __author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 1999-2011 PhiloSoft Design" +__copyright__ = "Copyright (C) 1999-2017 PhiloSoft Design" __license__ = "GNU GPL" __all__ = [] @@ -16,36 +14,36 @@ __all__ = [] import sys, os -lib_dir = os.path.normpath(os.path.dirname(sys.argv[0]) + os.sep + os.pardir) +lib_dir = os.path.normpath(os.path.join(os.path.dirname(sys.argv[0]), os.pardir)) sys.path.append(lib_dir) # for bkmk_objects.py try: - import cPickle - pickle = cPickle + import cPickle + pickle = cPickle except ImportError: - import pickle + import pickle from subproc import RecordFile def run(): - bkmk_in = RecordFile(sys.stdin) - bkmk_out = RecordFile(sys.stdout) + bkmk_in = RecordFile(sys.stdin) + bkmk_out = RecordFile(sys.stdout) - from m_lib.flog import openlog - log = openlog("check2.log") - from bkmk_rsimple import robot_simple - robot = robot_simple(log) + from m_lib.flog import openlog + log = openlog("check2.log") + from robots import robot + robot = robot(log) - while 1: - bookmark = pickle.loads(bkmk_in.read_record()) - log(bookmark.href) - robot.check_url(bookmark) - bkmk_out.write_record(pickle.dumps(bookmark)) - log.outfile.flush() + while 1: + bookmark = pickle.loads(bkmk_in.read_record()) + log(bookmark.href) + robot.check_url(bookmark) + bkmk_out.write_record(pickle.dumps(bookmark)) + log.outfile.flush() - log.close() + log.close() if __name__ == '__main__': - run() + run()