def dispatch(opts, args):
    """ Analyze command line parameters end call the needed function """
    client = get_hbase_client()
    if opts.initdb is True:
        db.schema.initdb(client)

    elif opts.resetdb is True:
        db.schema.dropdb(client)
        db.schema.initdb(client)

    elif opts.feed is not None:
        feeds.aggregate(client, opts.feed, opts.cat or "")

    elif opts.refresh_feeds is True:
        refresh_feeds(client, opts.cat or "")

    elif opts.opml is not None:
        aggregate_opml(client, opts.opml, opts.cat or "")

    elif opts.file is not None:
        aggregate_file(client, opts.file, opts.cat or "")

    elif opts.list is True:
        dump_urls(client, opts.hours, opts.cat or "")

    elif opts.rss is True:
        print get_rss(client, opts.hours, opts.cat or "")

    elif opts.webui is True:
        ui.start(lambda h=None, c='': get_rss(client, h,c))

    elif opts.xmlrpc is True:
        rpc.start(client)
 def testAggregateSingleFeed(self):
     aggregate(self.hbase, self.demo_feed, 'blogs', 'test_')