def main(): import logging logging.basicConfig(level=logging.INFO) material_file, category_file, mysql_uri, image_dir = parse_args() FoodMaterialCleaner(material_file=file(material_file), category_file=file(category_file), mysqldb=uri2service(mysql_uri), image_dir=image_dir).process()
def build_cache(mysql_uri, redis_uri): mysqldb = uri2service(mysql_uri) redisdb = uri2service(redis_uri) IndexCacher(mysqldb=mysqldb, redisdb=redisdb).build()