from bkmk_objects import __version__, Robot
from parse_html import parse_html
+import bkmk_objects
# Fake headers to pretend this is a real browser
self.log(bookmark.error)
except:
+ tty_pbar = bkmk_objects.tty_pbar
+ if tty_pbar:
+ tty_pbar.erase()
import traceback
traceback.print_exc()
bookmark.error = "Exception!"
self.log(' Exception: %s' % bookmark.error)
+ if tty_pbar:
+ tty_pbar.redraw()
finally:
self.finish_check_url(bookmark)
params = params.items()
for key, value in params:
setattr(obj, key, value)
+
+
+# Global var to use in robots
+tty_pbar = None
"""
from __future__ import print_function
-import sys
__author__ = "Oleg Broytman <phd@phdru.name>"
__license__ = "GNU GPL"
+import sys
+
+import bkmk_objects
from bkmk_objects import copy_bkmk
sys.stdout.flush()
if show_pbar:
- pbar = ttyProgressBar(0, objects)
+ bkmk_objects.tty_pbar = pbar = ttyProgressBar(0, objects)
urls_no = 0
object_count = 0
pass # Some object does not have a size :(
if show_pbar:
+ bkmk_objects.tty_pbar = None
del pbar
if report_stats: