This shows how to use the search incrementally. This can allow you to have a progress bar, or do some background work while searching.
This will demonstrate the use of the following services:
import reven
rvn = reven.reven_connection("localhost", 13370)
count = rvn.run_get_sequence_count("Execution run") - 1
range = reven.execution_range(0, count)
search = reven.search_request(reven.filter_criterion_address(0x400000))
search.max_results = 1
search.max_sequences = count / 100
while range.begin() < range.end():
print 'Searching... %d%% done.' % ((range.sequence_identifier * 100) / count)
result = rvn.run_search_sequences(range, search)
if len(result.content) > 0:
print 'Found result at %d' % result.content[0].sequence.index
break
range = result.remaining_range