- s = "Checking: "
- sys.stdout.write(s)
- sys.stdout.flush()
-
- if show_pbar:
- pbar = ttyProgressBar(0, objects)
-
- urls_no = 0
- object_count = 0
- size = 0
-
- checked = {}
- rcode = 1
-
- for object_no in range(objects):
- if show_pbar:
- pbar.display(object_no+1)
-
- object = root_folder.linear[object_no]
- object_count = object_count + 1
-
- if object.isBookmark:
- href = object.href
- if (href.startswith('place:') # Firefox SmartBookmarks
- or '%s' in href): # Bookmark with keyword
- log("Skipped %s" % href)
- continue
-
- if only_errors:
- if hasattr(object, "error"):
- delattr(object, "error")
- else:
- continue
-
- if checked.has_key(href):
- log("Already checked %s" % href)
- old_object = root_folder.linear[checked[href]]
- for attr_name in (
- "last_visit", "last_modified",
- "error", "no_error", "moved", "size", "md5", "real_title",
- "last_tested", "test_time", "icon", "charset",
- ):
- if hasattr(old_object, attr_name):
- setattr(object, attr_name, getattr(old_object, attr_name))
- else:
- log("Checking %s" % href)
- rcode = robot.check_url(object)
-
- if rcode:
- checked[href] = object_no
- urls_no = urls_no + 1
- try:
- size = size + int(object.size)
- except (AttributeError, TypeError, ValueError):
- pass # Some object does not have a size :(
- else:
- log("Interrupted by user (^C)")
- break
- robot.stop()
-
- if show_pbar:
- del pbar
+ print("""\
+ Title: %s
+ URL: %s
+ LastModified: %s
+ Moved: %s
+ Size: %s
+ Md5: %s
+ IconURI: %s
+ Icon: %s
+ Charset: %s
+ """ % (
+ getattr(bookmark, 'real_title', None)
+ or getattr(bookmark, 'title', None),
+ bookmark.href,
+ strftime(bookmark.last_modified),
+ getattr(bookmark, 'moved', None),
+ getattr(bookmark, 'size', None),
+ getattr(bookmark, 'md5', None),
+ bookmark.icon_href, bookmark.icon, bookmark.charset,
+ )
+ )