# Path: pokedex/defaults.py
# def get_default_db_uri_with_origin():
# def get_default_index_dir_with_origin():
# def get_default_csv_dir_with_origin():
# def get_default_db_uri():
# def get_default_index_dir():
# def get_default_csv_dir():


import argparse
import os
import sys
import pokedex.cli.search
import pokedex.db
import pokedex.db.load
import pokedex.db.tables
import pokedex.lookup
from pokedex import defaults
        raise ValueError("get_lookup() needs an explicit session to regen the index")

    index_dir = args.index_dir
    got_from = 'command line'

    if index_dir is None:
        index_dir, got_from = defaults.get_default_index_dir_with_origin()

    if args.verbose:
        print("Opened lookup index %(index_dir)s (from %(got_from)s)"
            % dict(index_dir=index_dir, got_from=got_from))

    lookup = pokedex.lookup.PokedexLookup(index_dir, session=session)

    if recreate:
        lookup.rebuild_index()

    return lookup


def get_csv_directory(args):
    """Prints and returns the csv directory we're about to use."""

    if not args.verbose:
        return

    csvdir = args.directory
    got_from = 'command line'

    if csvdir is None:

# Path: pokedex/defaults.py
# def get_default_db_uri_with_origin():
# def get_default_index_dir_with_origin():
# def get_default_csv_dir_with_origin():
# def get_default_db_uri():
# def get_default_index_dir():
# def get_default_csv_dir():


# Path: pokedex/main.py
import argparse
import os
import sys
import pokedex.cli.search
import pokedex.db
import pokedex.db.load
import pokedex.db.tables
import pokedex.lookup
from pokedex import defaults

        raise ValueError("get_lookup() needs an explicit session to regen the index")

    index_dir = args.index_dir
    got_from = 'command line'

    if index_dir is None:
        index_dir, got_from = defaults.get_default_index_dir_with_origin()

    if args.verbose:
        print("Opened lookup index %(index_dir)s (from %(got_from)s)"
            % dict(index_dir=index_dir, got_from=got_from))

    lookup = pokedex.lookup.PokedexLookup(index_dir, session=session)

    if recreate:
        lookup.rebuild_index()

    return lookup


def get_csv_directory(args):
    """Prints and returns the csv directory we're about to use."""

    if not args.verbose:
        return

    csvdir = args.directory
    got_from = 'command line'

    if csvdir is None:

        csvdir, got_from = defaults.get_default_csv_dir_with_origin()