# Path: jirafs/utils.py
# def convert_to_boolean(string):
# def stash_local_changes(repo):
# def get_user_input(message, options=None, boolean=False, password=False):
# def run_command_method_with_kwargs(command, method=None, **kwargs):
# def get_installed_commands():
# def get_installed_plugins(subclass=Plugin):
# def get_config_path(filename):
# def get_config(additional_configs=None, include_global=True):
# def set_global_config_value(section, key, value):
# def get_default_jira_server(config=None):
# def get_jira(domain=None, config=None):
#     def get_section(config, domain):
# def get_git_version():
# def lazy_get_jira():
# def format_date(folder, date):
# def find_files_referenced_in_markup(markup: str) -> Dict[str, Tuple[str, int, int]]:
# def get_comment_author_display(comment: Comment) -> Optional[str]:
# 
# Path: jirafs/exceptions.py
# class GitCommandError(JirafsError):
#     def __init__(self, *args, **kwargs):
#         self._command = kwargs.pop("cmd", None)
#         self._returncode = kwargs.pop("returncode", None)
#         self._output = kwargs.pop("stdout", None)
# 
#         super(GitCommandError, self).__init__(*args, **kwargs)
# 
#     @property
#     def command(self):
#         return self._command
# 
#     @property
#     def returncode(self):
#         return self._returncode
# 
#     @property
#     def output(self):
#         return self._output
# 
# class JiraInteractionFailed(JirafsError):
#     pass
# 
# class JirafsError(Exception):
#     def __str__(self):
#         super_str = super(JirafsError, self).__str__()
#         if not super_str:
#             return str(self.__class__.__name__)
# 
#         return super_str
# 
# class NotTicketFolderException(JirafsError):
#     pass
# 
# class UnknownMacroError(MacroError):
#     pass
# 
# class MacroError(JirafsError):
#     @property
#     def macro_name(self):
#         return self._macro_name
# 
#     @macro_name.setter
#     def macro_name(self, value):
#         self._macro_name = value


import argparse
import codecs
import copy
import logging
import logging.config
import os
import shlex
import subprocess
import sys
import time
import traceback
            import ptvsd
            import pyinstrument
from blessings import Terminal
    from jira.utils import JIRAError
    from jira.exceptions import JIRAError
from distutils.version import LooseVersion
from . import utils
from .exceptions import (
    GitCommandError,
    JiraInteractionFailed,
    JirafsError,
    NotTicketFolderException,
    UnknownMacroError,
    MacroError,
)
    except NotTicketFolderException:
        if not getattr(cmd_class, "TRY_SUBFOLDERS", False):
            print(
                "{t.red}The command '{cmd}' must be ran from "
                "within an issue folder.{t.normal}".format(t=term, cmd=command_name)
            )
            sys.exit(20)
        elif args.no_subfolders:
            sys.exit(20)

        count_runs = 0
        for folder in os.listdir(os.getcwd()):
            full_path = os.path.join(
                os.getcwd(),
                folder,
            )
            if not os.path.isdir(full_path):
                continue

            try:
                full_args = copy.copy(sys.argv)
                if "--no-subfolders" not in full_args:
                    full_args.append("--no-subfolders")
                result = subprocess.call(
                    " ".join([shlex.quote(a) for a in full_args]),
                    cwd=full_path,
                    shell=True,
                )
                if result == 0:
                    count_runs += 1

# Path: jirafs/utils.py
# def convert_to_boolean(string):
# def stash_local_changes(repo):
# def get_user_input(message, options=None, boolean=False, password=False):
# def run_command_method_with_kwargs(command, method=None, **kwargs):
# def get_installed_commands():
# def get_installed_plugins(subclass=Plugin):
# def get_config_path(filename):
# def get_config(additional_configs=None, include_global=True):
# def set_global_config_value(section, key, value):
# def get_default_jira_server(config=None):
# def get_jira(domain=None, config=None):
#     def get_section(config, domain):
# def get_git_version():
# def lazy_get_jira():
# def format_date(folder, date):
# def find_files_referenced_in_markup(markup: str) -> Dict[str, Tuple[str, int, int]]:
# def get_comment_author_display(comment: Comment) -> Optional[str]:
# 
# Path: jirafs/exceptions.py
# class GitCommandError(JirafsError):
#     def __init__(self, *args, **kwargs):
#         self._command = kwargs.pop("cmd", None)
#         self._returncode = kwargs.pop("returncode", None)
#         self._output = kwargs.pop("stdout", None)
# 
#         super(GitCommandError, self).__init__(*args, **kwargs)
# 
#     @property
#     def command(self):
#         return self._command
# 
#     @property
#     def returncode(self):
#         return self._returncode
# 
#     @property
#     def output(self):
#         return self._output
# 
# class JiraInteractionFailed(JirafsError):
#     pass
# 
# class JirafsError(Exception):
#     def __str__(self):
#         super_str = super(JirafsError, self).__str__()
#         if not super_str:
#             return str(self.__class__.__name__)
# 
#         return super_str
# 
# class NotTicketFolderException(JirafsError):
#     pass
# 
# class UnknownMacroError(MacroError):
#     pass
# 
# class MacroError(JirafsError):
#     @property
#     def macro_name(self):
#         return self._macro_name
# 
#     @macro_name.setter
#     def macro_name(self, value):
#         self._macro_name = value


# Path: jirafs/cmdline.py
import argparse
import codecs
import copy
import logging
import logging.config
import os
import shlex
import subprocess
import sys
import time
import traceback
            import ptvsd
            import pyinstrument
from blessings import Terminal
    from jira.utils import JIRAError
    from jira.exceptions import JIRAError
from distutils.version import LooseVersion
from . import utils
from .exceptions import (
    GitCommandError,
    JiraInteractionFailed,
    JirafsError,
    NotTicketFolderException,
    UnknownMacroError,
    MacroError,
)

    except NotTicketFolderException:
        if not getattr(cmd_class, "TRY_SUBFOLDERS", False):
            print(
                "{t.red}The command '{cmd}' must be ran from "
                "within an issue folder.{t.normal}".format(t=term, cmd=command_name)
            )
            sys.exit(20)
        elif args.no_subfolders:
            sys.exit(20)

        count_runs = 0
        for folder in os.listdir(os.getcwd()):
            full_path = os.path.join(
                os.getcwd(),
                folder,
            )
            if not os.path.isdir(full_path):
                continue

            try:
                full_args = copy.copy(sys.argv)
                if "--no-subfolders" not in full_args:
                    full_args.append("--no-subfolders")
                result = subprocess.call(
                    " ".join([shlex.quote(a) for a in full_args]),
                    cwd=full_path,
                    shell=True,
                )
                if result == 0:
                    count_runs += 1

            except NotTicketFolderException: