# 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 _
            raise InvalidValue(_('Value must be greater than %(l)d ') % {'l': self.min_value})
        if self.max_value is not None and self.max_value < value:
            raise InvalidValue(_('Value must be less than %(l)d') % {'l': self.max_value})
        return value


class BooleanInput(CharInput):
    true_values = [_('yes'), _('y')]
    false_values = [_('no'), _('n')]

    def to_python(self, value):
        value = value.lower()
        if value in self.true_values:
            return True
        elif value in self.false_values:
            return False
        raise InvalidValue(_('Value must be one of %(l)s') % {'l': ', '.join(self.true_values + self.false_values)})

    def to_str(self, value):
        if value:
            return self.true_values[0]
        return self.false_values[0]

    def widget(self, initial=None):
        if initial is None:
            choices = _('%s/%s') % (self.true_values[0], self.false_values[0])
        elif initial:
            choices = _('%s/%s') % (self.true_values[0].upper(), self.false_values[0])
        else:
            choices = _('%s/%s') % (self.true_values[0], self.false_values[0].upper())

# 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 _

            raise InvalidValue(_('Value must be greater than %(l)d ') % {'l': self.min_value})
        if self.max_value is not None and self.max_value < value:
            raise InvalidValue(_('Value must be less than %(l)d') % {'l': self.max_value})
        return value


class BooleanInput(CharInput):
    true_values = [_('yes'), _('y')]
    false_values = [_('no'), _('n')]

    def to_python(self, value):
        value = value.lower()
        if value in self.true_values:
            return True
        elif value in self.false_values:
            return False
        raise InvalidValue(_('Value must be one of %(l)s') % {'l': ', '.join(self.true_values + self.false_values)})

    def to_str(self, value):
        if value:
            return self.true_values[0]
        return self.false_values[0]

    def widget(self, initial=None):
        if initial is None:
            choices = _('%s/%s') % (self.true_values[0], self.false_values[0])
        elif initial:
            choices = _('%s/%s') % (self.true_values[0].upper(), self.false_values[0])
        else:
            choices = _('%s/%s') % (self.true_values[0], self.false_values[0].upper())

        return _('%(label)s [%(choices)s]: ') % {'label': self.label, 'choices': choices}