
import rr_config
import rr_util

###

DB = rr_config.DB

###

class NothingFound ( Exception ):
    pass
#
###

def search_unowned ( result, start_date, end_date, mime_type ):
    res = DB.find_unowned_resources(start_date, end_date, mime_type)
    if not res:
        raise NothingFound
    for r in res:
        d = {}
        d['resource_url'] = r['path']
        d['resource_date'] = r['lastmodified']
        d['resource_url'] = r['path']
        d['resource_size'] = int(r['getcontentlength'])
        d['resource_type'] = r['getcontenttype']
        result.append_resource(d)
    return
#
