subp_pipe = RecordFile(check_subp)
+_set_subproc = True
+
class robot_forking(Robot):
+ subproc = 'urllib' # Default subprocess
+
def check_url(self, bookmark):
+ global _set_subproc
+ if _set_subproc:
+ _set_subproc = False
+ os.environ['BKMK_ROBOT'] = self.subproc
+
if not check_subp:
restart_subp(self.log) # Not restart, just start afresh
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:
from m_lib.flog import openlog
log = openlog("check2.log")
- from bkmk_rurllib import robot_urllib
- robot = robot_urllib(log)
+ from robots import robot
+ robot = robot(log)
while 1:
bookmark = pickle.loads(bkmk_in.read_record())
BKMK_ROBOT=forking:subproc=urllib or
BKMK_STORAGE=json:filename=bookmarks_db.json.
+ Pass subproc parameter to the subprocess to allow different robots.
+
WHERE TO GET
Home page: http://phdru.name/Software/Python/#bookmarks_db
Requires: Python 2.5+, m_lib 2.0+.
+
AUTHOR
Oleg Broytman <phd@phdru.name>
BKMK_ROBOT=forking:subproc=urllib or
BKMK_STORAGE=json:filename=bookmarks_db.json.
+ Pass subproc parameter to the subprocess to allow different robots.
+
WHAT'S NEW in version 4.5.6 (2014-01-14)