# Path: bibserver/dao.py
# def make_id(data):
# def init_db():
# def get_conn():
#     def __init__(self, **kwargs):
#     def id(self):
#     def version(self):
#     def save(self):
#     def delete(self):
#     def get(cls, id_):
#     def get_mapping(cls):
#     def get_facets_from_mapping(cls,mapping=False,prefix=''):
#     def upsert(cls, data, state=None):
#     def bulk_upsert(cls, dataset, state=None):
#     def delete_by_query(cls, query):
#     def query(cls, q='', terms=None, facet_fields=None, flt=False, default_operator='AND', **kwargs):
#     def raw_query(self, query_string):
#     def about(cls, id_):
#     def records(self):
#     def get_by_owner_coll(cls,owner,coll):
#     def delete(self):
#     def __len__(self):
#     def set_password(self, password):
#     def check_password(self, password):
#     def is_super(self):
#     def collections(self):
#     def notes(self):
#     def delete(self):
# class InvalidDAOIDException(Exception):
# class DomainObject(UserDict.IterableUserDict):
# class Record(DomainObject):
# class Note(DomainObject):
# class Collection(DomainObject):
# class Account(DomainObject, UserMixin):


import os
import sys
import optparse
import inspect
    import test.base
    import bibserver.parsers.BibTexParser
    import json
    import bibserver.importer
from bibserver import dao
#!/usr/bin/env python

# does setup of cfg


def rebuild_db():
    '''Rebuild the db'''
    conn, db = dao.get_conn()
    conn.delete_index(db)
    conn.create_index(db)

def fixtures():
    for dict_ in test.base.fixtures['records']:

# Path: bibserver/dao.py
# def make_id(data):
# def init_db():
# def get_conn():
#     def __init__(self, **kwargs):
#     def id(self):
#     def version(self):
#     def save(self):
#     def delete(self):
#     def get(cls, id_):
#     def get_mapping(cls):
#     def get_facets_from_mapping(cls,mapping=False,prefix=''):
#     def upsert(cls, data, state=None):
#     def bulk_upsert(cls, dataset, state=None):
#     def delete_by_query(cls, query):
#     def query(cls, q='', terms=None, facet_fields=None, flt=False, default_operator='AND', **kwargs):
#     def raw_query(self, query_string):
#     def about(cls, id_):
#     def records(self):
#     def get_by_owner_coll(cls,owner,coll):
#     def delete(self):
#     def __len__(self):
#     def set_password(self, password):
#     def check_password(self, password):
#     def is_super(self):
#     def collections(self):
#     def notes(self):
#     def delete(self):
# class InvalidDAOIDException(Exception):
# class DomainObject(UserDict.IterableUserDict):
# class Record(DomainObject):
# class Note(DomainObject):
# class Collection(DomainObject):
# class Account(DomainObject, UserMixin):


# Path: cli.py
import os
import sys
import optparse
import inspect
    import test.base
    import bibserver.parsers.BibTexParser
    import json
    import bibserver.importer
from bibserver import dao

#!/usr/bin/env python

# does setup of cfg


def rebuild_db():
    '''Rebuild the db'''
    conn, db = dao.get_conn()
    conn.delete_index(db)
    conn.create_index(db)

def fixtures():
    for dict_ in test.base.fixtures['records']:

        dao.Record.upsert(dict_)