# Path: starterpyth/log.py
# def display(text, color=None, bold=False, newline=True):
#     if not isinstance(text, text_type):
#         text = text.decode('utf-8')
#     if bold and color:
#         text = u("\033[1;{0}m{1}\033[0m").format(color, text)
#     text = u("\033[{0}m{1}\033[0m").format(color, text)
#     if newline:
#         text += u('\n')
#     end = u('')
#     if __encode_stdout:
#         text = text.encode('utf-8')
#         end = b('')
#     print_(text, end=end)
# 
# RED = '31'
# 
# Path: starterpyth/translation.py
# def __find(domain, locale_module, localedir='locale', languages=None):
# def translation(domain, locale_module, localedir='locale', languages=None, class_=None, fallback=False):
# __TRANS = translation(parent_package, parent_package, fallback=True)


import os
import re
    import doctest
from six import PY2
from starterpyth.log import display, RED
from starterpyth.translation import ugettext as _
        if not value and self.required:
            raise InvalidValue(_('Please enter a valid path'))
        elif not value:
            return None
        if self.cwd:
            value = os.path.join(self.cwd, value)
        if not os.path.exists(value):
            raise InvalidValue(_('%(l)s is not a valid path') % {'l': value})
        return value


class ChoiceInput(CharInput):
    int_re = re.compile(r'\d+')

    def __init__(self, choices, label='', initial=None, required=True, show=None):
        super(ChoiceInput, self).__init__(label=label, initial=initial, show=show)
        if hasattr(choices, '__call__'):
            choices = choices()
        self.choices = choices
        self.required = required

    def to_python(self, value):
        if not value and self.required:
            raise InvalidValue(_('Please enter a valid choice'))
        elif not value:
            return None
        if not self.int_re.match(value) or not (1 <= int(value) <= len(self.choices)):
            raise InvalidValue(_('Please enter a number between 1 and %(max)d') % {'max': len(self.choices)})
        return self.choices[int(value) - 1][0]


# Path: starterpyth/log.py
# def display(text, color=None, bold=False, newline=True):
#     if not isinstance(text, text_type):
#         text = text.decode('utf-8')
#     if bold and color:
#         text = u("\033[1;{0}m{1}\033[0m").format(color, text)
#     text = u("\033[{0}m{1}\033[0m").format(color, text)
#     if newline:
#         text += u('\n')
#     end = u('')
#     if __encode_stdout:
#         text = text.encode('utf-8')
#         end = b('')
#     print_(text, end=end)
# 
# RED = '31'
# 
# Path: starterpyth/translation.py
# def __find(domain, locale_module, localedir='locale', languages=None):
# def translation(domain, locale_module, localedir='locale', languages=None, class_=None, fallback=False):
# __TRANS = translation(parent_package, parent_package, fallback=True)


# Path: starterpyth/cliforms.py
import os
import re
    import doctest
from six import PY2
from starterpyth.log import display, RED
from starterpyth.translation import ugettext as _

        if not value and self.required:
            raise InvalidValue(_('Please enter a valid path'))
        elif not value:
            return None
        if self.cwd:
            value = os.path.join(self.cwd, value)
        if not os.path.exists(value):
            raise InvalidValue(_('%(l)s is not a valid path') % {'l': value})
        return value


class ChoiceInput(CharInput):
    int_re = re.compile(r'\d+')

    def __init__(self, choices, label='', initial=None, required=True, show=None):
        super(ChoiceInput, self).__init__(label=label, initial=initial, show=show)
        if hasattr(choices, '__call__'):
            choices = choices()
        self.choices = choices
        self.required = required

    def to_python(self, value):
        if not value and self.required:
            raise InvalidValue(_('Please enter a valid choice'))
        elif not value:
            return None
        if not self.int_re.match(value) or not (1 <= int(value) <= len(self.choices)):
            raise InvalidValue(_('Please enter a number between 1 and %(max)d') % {'max': len(self.choices)})
        return self.choices[int(value) - 1][0]


    def display(self, value):