# Path: brede/config.py
# CONFIG_FILENAMES = [
#     'brede.cfg',
#     '~/etc/brede.cfg',
#     '~/brede.cfg']
# DEFAULTS = """
# [requests]
# user_agent = brede
# 
# [data]
# data_dir = ~/brede_data
# """


from os import makedirs
from os.path import exists, expanduser, join
from urllib import urlretrieve
from brede.config import config
    from docopt import docopt
import db
    directory http://neuro.compute.dtu.dk/services/bredewiki/download/

    It is loaded with automagically via the DB class in the db.py module,
    os that tables are available from BredeWikiTemplates().tables.

    Example
    -------
    >>> bwt = BredeWikiTemplates()
    >>> papers = bwt.tables.brede_paper.all()
    >>> 11227136 in set(papers._pmid.dropna().astype(int))
    True

    >>> # Brain regions from LPBA40 brain atlas
    >>> brain_regions = bwt.tables.brede_brain_region.all()
    >>> lpba_regions = brain_regions.ix[brain_regions._lpba.notnull(),
    ...                                 ['_name', '_lpba']]
    >>> 'Brain stem' in set(lpba_regions['_name'])
    True

    """

    def __init__(self, redownload=False):
        """Setup directories and filenames.

        Parameters
        ----------
        redownload : bool
            Download the database file a new.

        """

# Path: brede/config.py
# CONFIG_FILENAMES = [
#     'brede.cfg',
#     '~/etc/brede.cfg',
#     '~/brede.cfg']
# DEFAULTS = """
# [requests]
# user_agent = brede
# 
# [data]
# data_dir = ~/brede_data
# """


# Path: brede/data/bredewiki.py
from os import makedirs
from os.path import exists, expanduser, join
from urllib import urlretrieve
from brede.config import config
    from docopt import docopt
import db

    directory http://neuro.compute.dtu.dk/services/bredewiki/download/

    It is loaded with automagically via the DB class in the db.py module,
    os that tables are available from BredeWikiTemplates().tables.

    Example
    -------
    >>> bwt = BredeWikiTemplates()
    >>> papers = bwt.tables.brede_paper.all()
    >>> 11227136 in set(papers._pmid.dropna().astype(int))
    True

    >>> # Brain regions from LPBA40 brain atlas
    >>> brain_regions = bwt.tables.brede_brain_region.all()
    >>> lpba_regions = brain_regions.ix[brain_regions._lpba.notnull(),
    ...                                 ['_name', '_lpba']]
    >>> 'Brain stem' in set(lpba_regions['_name'])
    True

    """

    def __init__(self, redownload=False):
        """Setup directories and filenames.

        Parameters
        ----------
        redownload : bool
            Download the database file a new.

        """

        self.data_dir = expanduser(config.get('data', 'data_dir'))