Package compatibility with the previous version

The following code fragments can be used to ensure that code can run with both the old and the new API (as long as it does not use the new abilities of the new API of course).

Adapting to the new package structure:

try:
from recoll import recoll
from recoll import rclextract
hasextract = True
except:
import recoll
hasextract = False

Adapting to the change of nature of the next Query member. The same test can be used to choose to use the scroll() method (new) or set the next value (old).

rownum = query.next if type(query.next) == int else query.rownumber