# Path: moult/compat.py
# PY3 = sys.version_info[0] == 3


import sys
from .compat import PY3, str_

    def __len__(self):
        return len(self.text)

    def __unicode__(self):
        if not _enabled or (not self.ignore_setting and not enabled):
            return self.text
        return self.fmt.format(fg=self.color.foreground,
                               bg=self.color.background,
                               f=self.color.flag,
                               t=self.text)

    def __str__(self):
        if PY3:
            return str_(self.__unicode__())
        return self.__unicode__().encode('utf8')

    def __repr__(self):
        r = '<ColorText "{}" ({})>'.format(self.text, repr(self.color))
        if PY3:
            return r
        return r.encode('utf8')

    def __add__(self, other):
        return ColorTextRun(self, other)

    def __radd__(self, other):
        return ColorTextRun(other, self)

    def encode(self, *args, **kwargs):

# Path: moult/compat.py
# PY3 = sys.version_info[0] == 3


# Path: moult/color.py
import sys
from .compat import PY3, str_


    def __len__(self):
        return len(self.text)

    def __unicode__(self):
        if not _enabled or (not self.ignore_setting and not enabled):
            return self.text
        return self.fmt.format(fg=self.color.foreground,
                               bg=self.color.background,
                               f=self.color.flag,
                               t=self.text)

    def __str__(self):
        if PY3:
            return str_(self.__unicode__())
        return self.__unicode__().encode('utf8')

    def __repr__(self):
        r = '<ColorText "{}" ({})>'.format(self.text, repr(self.color))
        if PY3:
            return r
        return r.encode('utf8')

    def __add__(self, other):
        return ColorTextRun(self, other)

    def __radd__(self, other):
        return ColorTextRun(other, self)

    def encode(self, *args, **kwargs):

        return str_(self).encode(*args, **kwargs)