#epilog="""With <query> you select the range of record/docnames/single files to work on. Note that some actions e.g. delete, append, revise etc. works at the docname level, while others like --set-comment, --set-description, at single file level and other can be applied in an iterative way to many records in a single run. Note that specifing docid(2) takes precedence over recid(2) which in turns takes precedence over pattern/collection search.""",
parser.add_option('-H','--human-readable',dest='human_readable',action='store_true',default=False,help='print sizes in human readable format (e.g., 1KB 234MB 2GB)')
"""Check if any format-related inconsistences exists."""
count=0
duplicate=False
forrecidinrecid_set:
bibrecdocs=BibRecDocs(recid)
ifnotbibrecdocs.check_duplicate_docnames():
print>>sys.stderr,"recid %s has duplicate docnames!"
broken=True
duplicate=True
else:
broken=False
fordocnameinbibrecdocs.get_bibdoc_names():
ifnotbibrecdocs.check_format(docname):
print>>sys.stderr,"recid %s with docname %s need format fixing"%(recid,docname)
broken=True
ifbroken:
count+=1
ifcount:
result="%d out of %d records need their formats to be fixed."%(count,len(recid_set))
else:
result="All records appear to be correct with respect to formats."
ifduplicate:
result+=" Note however that at least one record appear to have duplicate docnames. You should better fix this situation by using --fix-duplicate-docnames."