108,10 → 108,6 |
' Print to stderr ' |
sys.stderr.write(s+'\n') |
|
def printen(s): |
' Print to stderr without added newline ' |
sys.stderr.write(s) |
|
def usage(channel): |
' Print help message ' |
def p(s): |
156,6 → 152,10 |
if negate_filter: |
sign = '!=' |
xpath = '%s[@type%s"%s"]' % ( xpath, sign, type_filter ) |
if type_filter != 'folder': |
# Avoid printing folders since all their children are printed |
# alongside |
xpath += '[@type!="folder"]' |
if search_text: |
#xpath = xpath + '//text()' |
needles = [] |
461,13 → 461,13 |
else: |
assert mode == MODE_AND, "Unknown boolean operation mode" |
numhits += dump_entries(xmldata, needles, 'folder', caseInsensitive, True) |
elif needles: # Do a search filtered for each type |
if mode == MODE_OR: |
elif needles: |
if mode == MODE_OR: # Do a search filtered for each type |
for text in needles: |
for ( sfilter, negate ) in searchTypes: |
numhits += dump_entries(xmldata, text, sfilter, caseInsensitive, |
negate_filter=negate) |
else: |
else: # Do a combined search, filter for each type |
assert mode == MODE_AND, "Unknown boolean operation mode" |
for ( sfilter, negate ) in searchTypes: |
numhits += dump_entries(xmldata, needles, sfilter, caseInsensitive, |