# Path: django_sonic_screwdriver/settings.py
# USER_SETTINGS = getattr(settings, "SONIC_SCREWDRIVER", None)
# DEFAULTS = {
#     "DEBUG": False,
#     # Returns file where the version number is located
#     "VERSION_FILE": "setup.py",
#     "RELEASE_SEPARATOR": "",
#     "PATCH_AUTO_TAG": False,
#     # Git
#     "GIT_DIR": settings.BASE_DIR,
#     # Git Tagging
#     "GIT_TAG_AUTO_TAG_PUSH": False,
#     "GIT_STAGING_PRE_TAG": "staging",
#     "GIT_ACTIVATE_PRE_TAG": "activate",
#     "SECURE_TAGGING": True,
#     # App Ban
#     "BAN_REMOTE_ADDR_HEADER": "REMOTE_ADDR",
#     "BAN_DEFAULT_END_TIME": 60 * 60,
# }
# class APISettings(object):
#     def __init__(self, user_settings=None, defaults=None):
#     def __getattr__(self, attr):
# 
# Path: django_sonic_screwdriver/version.py
# RELEASE_TAGS = {
#     # pre-release
#     "ALPHA": "a",
#     "BETA": "b",
#     "RC": "rc",
#     # dev-release
#     "DEV": "dev",
#     # post-release
# }
# RELEASE_SEPARATORS = {"DOT": ".", "MINUS": "-", "UNDERSCORE": "_"}
# class Version:
#     def get_version():
#     def set_version(old_version, new_version):
#     def get_patch_version(version):
#     def get_current_RELEASE_SEPARATOR(patch):
#     def get_current_pre_release_tag(patch):
#     def set_major(self):
#     def set_minor(self):
#     def set_patch(self, pre_release_tag=""):
#     def __init__(self, release_tags=None):
#     def __getattr__(self, attr):
# 
# Path: django_sonic_screwdriver/utils/shell.py
# ANSCI_ESCAPE = re.compile(r"\x1b[^m]*m")
# STDERR_WRITER = getwriter("utf-8")(stderr.buffer)
# STDOUT_WRITER = getwriter("utf-8")(stdout.buffer)
#     __HEADER = "\033[95m"
#     __OK_BLUE = "\033[94m"
#     __OK_GREEN = "\033[92m"
#     __WARNING = "\033[93m"
#     __FAIL = "\033[91m"
#     __ENDC = "\033[0m"
#     __BOLD = "\033[1m"
#     __UNDERLINE = "\033[4m"
# def ansi_clean(string):
# def write_to_stream(stream, msg):
#     def msg(self, msg, append_new_line=True):
#     def success(self, msg, append_new_line=True):
#     def warn(self, msg, append_new_line=True):
#     def fail(self, msg, append_new_line=True):
#     def debug(self, msg, append_new_line=True):
#     def __text(self, msg, color):
#     def __out(self, msg, color=None, append_new_line=False):
# class Shell:
# 
# Path: django_sonic_screwdriver/git/decorators.py
# def git_available(func):
#     """
#     Check, if a git repository exists in the given folder.
#     """
# 
#     def inner(*args):
# 
#         os.chdir(api_settings.GIT_DIR)
# 
#         if call(["git", "rev-parse"]) == 0:
#             return func(*args)
# 
#         shell.fail("There is no git repository!")
#         return exit(1)
# 
#     return inner


from subprocess import call, check_output
from django_sonic_screwdriver.settings import api_settings
from django_sonic_screwdriver.version import version
from django_sonic_screwdriver.utils import shell
from django_sonic_screwdriver.git.decorators import git_available

        if not call(command):
            return True
        return False

    @staticmethod
    @git_available
    def __git_tag_gpg(git_tag):
        """
        Create new tag with GPG signature.
        The function call will return 0 if the command success.
        """
        command = ["git", "tag", "-s", git_tag, "-m", "'" + git_tag + "'"]
        shell.msg("Create signed tag version " + git_tag + " with GPG")

        if api_settings.DEBUG:
            Git.__debug(command, False)

        if not call(command):
            return True
        return False

    @staticmethod
    @git_available
    def __git_tag_push():
        """
        Push all tags.
        The function call will return 0 if the command success.
        """
        command = ["git", "push", "origin", "--tags"]

# Path: django_sonic_screwdriver/settings.py
# USER_SETTINGS = getattr(settings, "SONIC_SCREWDRIVER", None)
# DEFAULTS = {
#     "DEBUG": False,
#     # Returns file where the version number is located
#     "VERSION_FILE": "setup.py",
#     "RELEASE_SEPARATOR": "",
#     "PATCH_AUTO_TAG": False,
#     # Git
#     "GIT_DIR": settings.BASE_DIR,
#     # Git Tagging
#     "GIT_TAG_AUTO_TAG_PUSH": False,
#     "GIT_STAGING_PRE_TAG": "staging",
#     "GIT_ACTIVATE_PRE_TAG": "activate",
#     "SECURE_TAGGING": True,
#     # App Ban
#     "BAN_REMOTE_ADDR_HEADER": "REMOTE_ADDR",
#     "BAN_DEFAULT_END_TIME": 60 * 60,
# }
# class APISettings(object):
#     def __init__(self, user_settings=None, defaults=None):
#     def __getattr__(self, attr):
# 
# Path: django_sonic_screwdriver/version.py
# RELEASE_TAGS = {
#     # pre-release
#     "ALPHA": "a",
#     "BETA": "b",
#     "RC": "rc",
#     # dev-release
#     "DEV": "dev",
#     # post-release
# }
# RELEASE_SEPARATORS = {"DOT": ".", "MINUS": "-", "UNDERSCORE": "_"}
# class Version:
#     def get_version():
#     def set_version(old_version, new_version):
#     def get_patch_version(version):
#     def get_current_RELEASE_SEPARATOR(patch):
#     def get_current_pre_release_tag(patch):
#     def set_major(self):
#     def set_minor(self):
#     def set_patch(self, pre_release_tag=""):
#     def __init__(self, release_tags=None):
#     def __getattr__(self, attr):
# 
# Path: django_sonic_screwdriver/utils/shell.py
# ANSCI_ESCAPE = re.compile(r"\x1b[^m]*m")
# STDERR_WRITER = getwriter("utf-8")(stderr.buffer)
# STDOUT_WRITER = getwriter("utf-8")(stdout.buffer)
#     __HEADER = "\033[95m"
#     __OK_BLUE = "\033[94m"
#     __OK_GREEN = "\033[92m"
#     __WARNING = "\033[93m"
#     __FAIL = "\033[91m"
#     __ENDC = "\033[0m"
#     __BOLD = "\033[1m"
#     __UNDERLINE = "\033[4m"
# def ansi_clean(string):
# def write_to_stream(stream, msg):
#     def msg(self, msg, append_new_line=True):
#     def success(self, msg, append_new_line=True):
#     def warn(self, msg, append_new_line=True):
#     def fail(self, msg, append_new_line=True):
#     def debug(self, msg, append_new_line=True):
#     def __text(self, msg, color):
#     def __out(self, msg, color=None, append_new_line=False):
# class Shell:
# 
# Path: django_sonic_screwdriver/git/decorators.py
# def git_available(func):
#     """
#     Check, if a git repository exists in the given folder.
#     """
# 
#     def inner(*args):
# 
#         os.chdir(api_settings.GIT_DIR)
# 
#         if call(["git", "rev-parse"]) == 0:
#             return func(*args)
# 
#         shell.fail("There is no git repository!")
#         return exit(1)
# 
#     return inner


# Path: django_sonic_screwdriver/git/git.py
from subprocess import call, check_output
from django_sonic_screwdriver.settings import api_settings
from django_sonic_screwdriver.version import version
from django_sonic_screwdriver.utils import shell
from django_sonic_screwdriver.git.decorators import git_available


        if not call(command):
            return True
        return False

    @staticmethod
    @git_available
    def __git_tag_gpg(git_tag):
        """
        Create new tag with GPG signature.
        The function call will return 0 if the command success.
        """
        command = ["git", "tag", "-s", git_tag, "-m", "'" + git_tag + "'"]
        shell.msg("Create signed tag version " + git_tag + " with GPG")

        if api_settings.DEBUG:
            Git.__debug(command, False)

        if not call(command):
            return True
        return False

    @staticmethod
    @git_available
    def __git_tag_push():
        """
        Push all tags.
        The function call will return 0 if the command success.
        """
        command = ["git", "push", "origin", "--tags"]

        shell.msg("Pushing tags...")