# Path: txircd/modbase.py
# class Mode(object):
#     def hook(self, base):
#         self.ircd = base
#         return self
#     def checkSet(self, user, target, param):
#         return [True, param]
#     def checkUnset(self, user, target, param):
#         return [True, param]
#     def showParam(self, user, target, param):
#         return param
#     def checkPermission(self, user, cmd, data):
#         return data


from txircd.modbase import Mode

class StripColor(Mode):
    def strip_colors(self, msg):
        while chr(3) in msg:
            color_pos = msg.index(chr(3))
            strip_length = 1
            color_f = 0
            color_b = 0
            comma = False
            for i in range(color_pos + 1, len(msg) if len(msg) < color_pos + 6 else color_pos + 6):

# Path: txircd/modbase.py
# class Mode(object):
#     def hook(self, base):
#         self.ircd = base
#         return self
#     def checkSet(self, user, target, param):
#         return [True, param]
#     def checkUnset(self, user, target, param):
#         return [True, param]
#     def showParam(self, user, target, param):
#         return param
#     def checkPermission(self, user, cmd, data):
#         return data


# Path: txircd/modules/stripcolor.py
from txircd.modbase import Mode


class StripColor(Mode):
    def strip_colors(self, msg):
        while chr(3) in msg:
            color_pos = msg.index(chr(3))
            strip_length = 1
            color_f = 0
            color_b = 0
            comma = False
            for i in range(color_pos + 1, len(msg) if len(msg) < color_pos + 6 else color_pos + 6):

                if msg[i] == ",":