# Path: wwb_scanner/utils/numpyjson.py
# PY3 = sys.version_info.major >= 3
# class NumpyEncoder(object):
#     def encode(self, obj):
#     def decode(self, d):
# def dumps(obj, **kwargs):
# def loads(s, **kwargs):
# def dump(*args, **kwargs):
# def load(*args, **kwargs):


import os
import datetime
import tinydb
from tinydb import TinyDB, where
from wwb_scanner.utils import numpyjson
        db = self._db
        if db is None:
            self._check_dirs()
            db = self._db = TinyDB(self.DB_PATH, storage=JSONStorage)
        return db
    @property
    def scan_db(self):
        db = self._scan_db
        if db is None:
            self._check_dirs()
            db = self._scan_db = TinyDB(self.SCAN_DB_PATH, storage=JSONStorage)
        return db
    def _check_dirs(self):
        if not os.path.exists(os.path.dirname(self.DB_PATH)):
            os.makedirs(os.path.dirname(self.DB_PATH))
        if not os.path.exists(os.path.dirname(self.SCAN_DB_PATH)):
            os.makedirs(os.path.dirname(self.SCAN_DB_PATH))
    def migrate_db(self):
        for table_name in ['scans_performed', 'scans_imported']:
            if table_name not in self.db.tables():
                continue
            print('migrating table "{}"'.format(table_name))
            old_table = self.db.table(table_name)
            new_table = self.scan_db.table(table_name)
            eids = []
            for item in old_table.all():
                eids.append(item.eid)
                new_table.insert(item)
            old_table.remove(eids=eids)
            self.db.purge_table(table_name)

# Path: wwb_scanner/utils/numpyjson.py
# PY3 = sys.version_info.major >= 3
# class NumpyEncoder(object):
#     def encode(self, obj):
#     def decode(self, d):
# def dumps(obj, **kwargs):
# def loads(s, **kwargs):
# def dump(*args, **kwargs):
# def load(*args, **kwargs):


# Path: wwb_scanner/utils/dbstore.py
import os
import datetime
import tinydb
from tinydb import TinyDB, where
from wwb_scanner.utils import numpyjson

        db = self._db
        if db is None:
            self._check_dirs()
            db = self._db = TinyDB(self.DB_PATH, storage=JSONStorage)
        return db
    @property
    def scan_db(self):
        db = self._scan_db
        if db is None:
            self._check_dirs()
            db = self._scan_db = TinyDB(self.SCAN_DB_PATH, storage=JSONStorage)
        return db
    def _check_dirs(self):
        if not os.path.exists(os.path.dirname(self.DB_PATH)):
            os.makedirs(os.path.dirname(self.DB_PATH))
        if not os.path.exists(os.path.dirname(self.SCAN_DB_PATH)):
            os.makedirs(os.path.dirname(self.SCAN_DB_PATH))
    def migrate_db(self):
        for table_name in ['scans_performed', 'scans_imported']:
            if table_name not in self.db.tables():
                continue
            print('migrating table "{}"'.format(table_name))
            old_table = self.db.table(table_name)
            new_table = self.scan_db.table(table_name)
            eids = []
            for item in old_table.all():
                eids.append(item.eid)
                new_table.insert(item)
            old_table.remove(eids=eids)
            self.db.purge_table(table_name)

    def add_scan_config(self, config, force_insert=False):