# 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



APP_PATH = os.path.expanduser('~/wwb_scanner_data')

class JSONStorage(tinydb.JSONStorage):
    def read(self):
        # Get the file size
        self._handle.seek(0, os.SEEK_END)
        size = self._handle.tell()

        if not size:
            # File is empty
            return None
        else:
            self._handle.seek(0)
            return numpyjson.load(self._handle)
    def write(self, data):
        self._handle.seek(0)

# 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




APP_PATH = os.path.expanduser('~/wwb_scanner_data')

class JSONStorage(tinydb.JSONStorage):
    def read(self):
        # Get the file size
        self._handle.seek(0, os.SEEK_END)
        size = self._handle.tell()

        if not size:
            # File is empty
            return None
        else:
            self._handle.seek(0)
            return numpyjson.load(self._handle)
    def write(self, data):
        self._handle.seek(0)

        serialized = numpyjson.dumps(data)