# Path: pyhindsight/utils.py
# def dict_factory(cursor, row):
# def text_factory(row_data):
# def open_sqlite_db(chrome, database_path, database_name):
# def format_plugin_output(name, version, items):
# def format_meta_output(name, content):
#     def default(self, obj):
# def to_datetime(timestamp, timezone=None):
# def friendly_date(timestamp):
# def get_ldb_records(ldb_path, prefix=''):
# def read_varint(source):
# def read_string(input_bytes, ptr):
# def read_int32(input_bytes, ptr):
# def read_int64(input_bytes, ptr):
# class MyEncoder(json.JSONEncoder):


import hashlib
import logging
import sqlite3
import sys
import urllib.parse
from pyhindsight import utils
            self.artifacts_display = {}

        if self.preferences is None:
            self.preferences = []

        if self.origin_hashes is None:
            self.origin_hashes = {}

    @staticmethod
    def format_processing_output(name, items):
        width = 80
        left_side = width*0.55
        count = '{:>6}'.format(str(items))
        pretty_name = "{name:>{left_width}}:{count:^{right_width}}" \
            .format(name=name, left_width=int(left_side), count=' '.join(['[', count, ']']),
                    right_width=(width - int(left_side)-2))
        return pretty_name

    @staticmethod
    def format_profile_path(profile_path):
        if len(profile_path) > 68:
            profile_path = "...{}".format(profile_path[-65:])
        return "\n    Profile: {}".format(profile_path)

    def build_structure(self, path, database):

        if database not in list(self.structure.keys()):
            self.structure[database] = {}

            # Copy and connect to copy of SQLite DB

# Path: pyhindsight/utils.py
# def dict_factory(cursor, row):
# def text_factory(row_data):
# def open_sqlite_db(chrome, database_path, database_name):
# def format_plugin_output(name, version, items):
# def format_meta_output(name, content):
#     def default(self, obj):
# def to_datetime(timestamp, timezone=None):
# def friendly_date(timestamp):
# def get_ldb_records(ldb_path, prefix=''):
# def read_varint(source):
# def read_string(input_bytes, ptr):
# def read_int32(input_bytes, ptr):
# def read_int64(input_bytes, ptr):
# class MyEncoder(json.JSONEncoder):


# Path: pyhindsight/browsers/webbrowser.py
import hashlib
import logging
import sqlite3
import sys
import urllib.parse
from pyhindsight import utils

            self.artifacts_display = {}

        if self.preferences is None:
            self.preferences = []

        if self.origin_hashes is None:
            self.origin_hashes = {}

    @staticmethod
    def format_processing_output(name, items):
        width = 80
        left_side = width*0.55
        count = '{:>6}'.format(str(items))
        pretty_name = "{name:>{left_width}}:{count:^{right_width}}" \
            .format(name=name, left_width=int(left_side), count=' '.join(['[', count, ']']),
                    right_width=(width - int(left_side)-2))
        return pretty_name

    @staticmethod
    def format_profile_path(profile_path):
        if len(profile_path) > 68:
            profile_path = "...{}".format(profile_path[-65:])
        return "\n    Profile: {}".format(profile_path)

    def build_structure(self, path, database):

        if database not in list(self.structure.keys()):
            self.structure[database] = {}

            # Copy and connect to copy of SQLite DB

            conn = utils.open_sqlite_db(self, path, database)