# Path: multiscanner/config.py
# CONFIG = determine_configuration_path(None)
# 
# Path: multiscanner/common/utils.py
#     SSH = True
#     SSH = False
# def load_module(name, path):
# def list2cmdline(list):
# def convert_encoding(data, encoding='UTF-8', errors='replace'):
# def parse_config(config_object):
# def get_config_path(config_file, component):
# def dirname(path):
# def basename(path):
# def parseDir(directory, recursive=False, exclude=['__init__']):
# def parseFileList(FileList, recursive=False):
# def chunk_file_list(filelist, cmdlength=7191):
# def queue2list(queue):
# def hashfile(fname, hasher, blocksize=65536):
# def sshconnect(hostname, port=22, username=None, password=None, pkey=None,
#                key_filename=None, timeout=None, allow_agent=True,
#                look_for_keys=True, compress=False, sock=None):
# def sessionexec(client, cmd):
# def sshexec(hostname, cmd, port=22, username=None, password=None,
#             key_filename=None):


import codecs
import configparser
import inspect
import os
import time
import threading
from builtins import *  # noqa: F401,F403
from future import standard_library
from multiscanner.config import CONFIG as MS_CONFIG
from multiscanner.common import utils
    for module in keys:
        if module in config_object:
            continue
        try:
            conf = module.DEFAULTCONF
        except Exception as e:
            # TODO: log exception
            continue
        ConfNeedsWrite = True
        config_object.add_section(module)
        for key in conf:
            config_object.set(module, key, str(conf[key]))

    if ConfNeedsWrite:
        with codecs.open(filepath, 'w', 'utf-8') as f:
            config_object.write(f)
        return True
    return False


def _get_storage_classes(dir_path=STORAGE_DIR):
    storage_classes = {}
    dir_list = utils.parseDir(dir_path, recursive=True)
    dir_list.remove(os.path.join(dir_path, 'storage.py'))
    # dir_list.remove(os.path.join(dir_path, '__init__.py'))
    dir_list.remove(os.path.join(dir_path, 'sql_driver.py'))
    for filename in dir_list:
        if filename.endswith('.py'):
            modname = os.path.basename(filename[:-3])
            moddir = os.path.dirname(filename)

# Path: multiscanner/config.py
# CONFIG = determine_configuration_path(None)
# 
# Path: multiscanner/common/utils.py
#     SSH = True
#     SSH = False
# def load_module(name, path):
# def list2cmdline(list):
# def convert_encoding(data, encoding='UTF-8', errors='replace'):
# def parse_config(config_object):
# def get_config_path(config_file, component):
# def dirname(path):
# def basename(path):
# def parseDir(directory, recursive=False, exclude=['__init__']):
# def parseFileList(FileList, recursive=False):
# def chunk_file_list(filelist, cmdlength=7191):
# def queue2list(queue):
# def hashfile(fname, hasher, blocksize=65536):
# def sshconnect(hostname, port=22, username=None, password=None, pkey=None,
#                key_filename=None, timeout=None, allow_agent=True,
#                look_for_keys=True, compress=False, sock=None):
# def sessionexec(client, cmd):
# def sshexec(hostname, cmd, port=22, username=None, password=None,
#             key_filename=None):


# Path: multiscanner/storage/storage.py
import codecs
import configparser
import inspect
import os
import time
import threading
from builtins import *  # noqa: F401,F403
from future import standard_library
from multiscanner.config import CONFIG as MS_CONFIG
from multiscanner.common import utils

    for module in keys:
        if module in config_object:
            continue
        try:
            conf = module.DEFAULTCONF
        except Exception as e:
            # TODO: log exception
            continue
        ConfNeedsWrite = True
        config_object.add_section(module)
        for key in conf:
            config_object.set(module, key, str(conf[key]))

    if ConfNeedsWrite:
        with codecs.open(filepath, 'w', 'utf-8') as f:
            config_object.write(f)
        return True
    return False


def _get_storage_classes(dir_path=STORAGE_DIR):
    storage_classes = {}
    dir_list = utils.parseDir(dir_path, recursive=True)
    dir_list.remove(os.path.join(dir_path, 'storage.py'))
    # dir_list.remove(os.path.join(dir_path, '__init__.py'))
    dir_list.remove(os.path.join(dir_path, 'sql_driver.py'))
    for filename in dir_list:
        if filename.endswith('.py'):
            modname = os.path.basename(filename[:-3])
            moddir = os.path.dirname(filename)

            mod = utils.load_module(os.path.basename(modname), [moddir])