# Path: dput/core.py
# CONFIG_LOCATIONS = {
#     "/usr/share/dput-ng/": 30,
#     "/etc/dput.d/": 20,
#     os.path.expanduser("~/.dput.d"): 10,
#     "skel/": 100
# }
# DPUT_CONFIG_LOCATIONS = {
#     "/etc/dput.cf": 15,
#     os.path.expanduser("~/.dput.cf"): 5
# }
# SCHEMA_DIRS = [
#     "/usr/share/dput-ng/schemas",
#     "skel/schemas"
# ]
# def _write_upload_log(logfile, full_log):
# def _enable_debugging(level):
# def mangle_sys():
# def maybe_print_traceback(debug_level, stack):
# def get_local_username():
# 
# Path: dput/exceptions.py
# class NoSuchConfigError(DputError):
#     """
#     Thrown when dput can not find a Configuration file or block that is
#     requested.
#     """
#     pass
# 
# class DputConfigurationError(DputError):
#     """
#     Errors in the parsing or retrieving of configuration files should raise
#     an instance of this, or a subclass thereof.
#     """
#     pass
# 
# class InvalidConfigError(DputError):
#     """
#     Config file was loaded properly, but it was missing part of it's
#     required fields.
#     """
#     pass


import os
import json
import shlex
import importlib
import subprocess
import dput.core
        import validictory
from contextlib import contextmanager
from dput.core import logger
from dput.exceptions import (NoSuchConfigError, DputConfigurationError,
                             InvalidConfigError)
        metainfo = load_config(
            "metas",
            ret['meta'],
            default={}
        )  # configs=configs)
        # Erm, is this right? For some reason, I don't think it is. Meta
        # handling is a hemorrhoid in my ass. Fuck it, it works. Ship it.
        #   -- PRT
        for key in metainfo:
            if not key in ret:
                ret[key] = metainfo[key]
            else:
                logger.trace("Ignoring key %s for %s (%s)" % (
                    key,
                    ret['meta'],
                    metainfo[key]
                ))

    obj = ret
    if config_cleanup:
        obj = _config_cleanup(ret)

    if obj != {}:
        return obj

    if default is not None:
        return default

    logger.debug("Failed to load configuration %s" % (config_name))


# Path: dput/core.py
# CONFIG_LOCATIONS = {
#     "/usr/share/dput-ng/": 30,
#     "/etc/dput.d/": 20,
#     os.path.expanduser("~/.dput.d"): 10,
#     "skel/": 100
# }
# DPUT_CONFIG_LOCATIONS = {
#     "/etc/dput.cf": 15,
#     os.path.expanduser("~/.dput.cf"): 5
# }
# SCHEMA_DIRS = [
#     "/usr/share/dput-ng/schemas",
#     "skel/schemas"
# ]
# def _write_upload_log(logfile, full_log):
# def _enable_debugging(level):
# def mangle_sys():
# def maybe_print_traceback(debug_level, stack):
# def get_local_username():
# 
# Path: dput/exceptions.py
# class NoSuchConfigError(DputError):
#     """
#     Thrown when dput can not find a Configuration file or block that is
#     requested.
#     """
#     pass
# 
# class DputConfigurationError(DputError):
#     """
#     Errors in the parsing or retrieving of configuration files should raise
#     an instance of this, or a subclass thereof.
#     """
#     pass
# 
# class InvalidConfigError(DputError):
#     """
#     Config file was loaded properly, but it was missing part of it's
#     required fields.
#     """
#     pass


# Path: dput/util.py
import os
import json
import shlex
import importlib
import subprocess
import dput.core
        import validictory
from contextlib import contextmanager
from dput.core import logger
from dput.exceptions import (NoSuchConfigError, DputConfigurationError,
                             InvalidConfigError)

        metainfo = load_config(
            "metas",
            ret['meta'],
            default={}
        )  # configs=configs)
        # Erm, is this right? For some reason, I don't think it is. Meta
        # handling is a hemorrhoid in my ass. Fuck it, it works. Ship it.
        #   -- PRT
        for key in metainfo:
            if not key in ret:
                ret[key] = metainfo[key]
            else:
                logger.trace("Ignoring key %s for %s (%s)" % (
                    key,
                    ret['meta'],
                    metainfo[key]
                ))

    obj = ret
    if config_cleanup:
        obj = _config_cleanup(ret)

    if obj != {}:
        return obj

    if default is not None:
        return default

    logger.debug("Failed to load configuration %s" % (config_name))


    nsce = NoSuchConfigError("No such configuration: '%s' in class '%s'" % (