Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def do_init(r):
m = CollectionsManager(r.coll_name, must_exist=False)
m.add_collection()
def do_index(r):
m = CollectionsManager(r.coll_name)
m.index_merge(r.files, m.DEF_INDEX_FILE)
def do_reindex(r):
m = CollectionsManager(r.coll_name)
m.reindex()
def do_add(r):
m = CollectionsManager(r.coll_name)
m.add_warcs(r.files)
def do_migrate(r):
m = CollectionsManager('', must_exist=False)
m.migrate_cdxj(r.path, r.force)
def do_add_template(r):
m = CollectionsManager(r.coll_name, must_exist=False)
if r.add:
m.add_template(r.add, r.force)
elif r.remove:
m.remove_template(r.remove, r.force)
elif r.list:
m.list_templates()