# 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 ChangesFileException(DputError):
#     """
#     Thrown when there's an error processing / verifying a .changes file
#     (most often via the :class:`dput.changes.Changes` object)
#     """
# 
#     def __init__(self, message, gpg_stderr=None):
#         super(ChangesFileException, self).__init__(message)
#         self.gpg_stderr = gpg_stderr
# 
# class HookException(DputError):
#     """
#     Thrown when there's an error checking, or creating a checker. Usually
#     thrown by a checker invoked by :class:`dput.checker.run_hooks`.
#     """
#     pass


import os
import subprocess
import dput.changes
from dput.core import logger
from dput.exceptions import (ChangesFileException, HookException)
        }

    ``allowed_keys`` is an optional entry which contains all the keys that
    may upload to this host. This can come in handy if you use more then one
    key to upload to more then one host. Use any length of the last N chars
    of the fingerprint.
    """

    if "allow_unsigned_uploads" in profile:
        if profile['allow_unsigned_uploads']:
            logger.info("Not checking GPG signature due to "
                        "allow_unsigned_uploads being set.")
            return

    gpg = {}
    if 'gpg' in profile:
        gpg = profile['gpg']

    try:
        key = changes.validate_signature()
    except ChangesFileException as e:
        # Sign unsigned files using debsign:
        changes_file = changes.get_changes_file()
        if subprocess.call(['debsign', changes_file]) == 0:
            changes = dput.changes.parse_changes_file(
                changes_file,
                os.path.dirname(changes_file)
            )
        try:
            key = changes.validate_signature()

# 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 ChangesFileException(DputError):
#     """
#     Thrown when there's an error processing / verifying a .changes file
#     (most often via the :class:`dput.changes.Changes` object)
#     """
# 
#     def __init__(self, message, gpg_stderr=None):
#         super(ChangesFileException, self).__init__(message)
#         self.gpg_stderr = gpg_stderr
# 
# class HookException(DputError):
#     """
#     Thrown when there's an error checking, or creating a checker. Usually
#     thrown by a checker invoked by :class:`dput.checker.run_hooks`.
#     """
#     pass


# Path: dput/hooks/gpg.py
import os
import subprocess
import dput.changes
from dput.core import logger
from dput.exceptions import (ChangesFileException, HookException)

        }

    ``allowed_keys`` is an optional entry which contains all the keys that
    may upload to this host. This can come in handy if you use more then one
    key to upload to more then one host. Use any length of the last N chars
    of the fingerprint.
    """

    if "allow_unsigned_uploads" in profile:
        if profile['allow_unsigned_uploads']:
            logger.info("Not checking GPG signature due to "
                        "allow_unsigned_uploads being set.")
            return

    gpg = {}
    if 'gpg' in profile:
        gpg = profile['gpg']

    try:
        key = changes.validate_signature()
    except ChangesFileException as e:
        # Sign unsigned files using debsign:
        changes_file = changes.get_changes_file()
        if subprocess.call(['debsign', changes_file]) == 0:
            changes = dput.changes.parse_changes_file(
                changes_file,
                os.path.dirname(changes_file)
            )
        try:
            key = changes.validate_signature()

        except ChangesFileException as e: