def _ansi(method):
 def wrapper(self, *args, **kwargs):
  def convert(inp):
   if isinstance(inp, basestring):
    return parse_ansi(('{n%s{n' % inp))
   elif hasattr(inp, '__iter__'):
    li = []
    for element in inp:
     if isinstance(element, basestring):
      li.append(convert(element))
     elif hasattr(element, '__iter__'):
      li.append(convert(element))
     else:
      li.append(element)
    return li
   return inp
  args = [convert(arg) for arg in args]
  return method(self, *args, **kwargs)
 return wrapper

def _ansi ( method ) : def wrapper ( self , * args , ** kwargs ) : def convert ( inp ) : if isinstance ( inp , basestring ) : return parse_ansi ( ( '{n%s{n' % inp ) ) elif hasattr ( inp , '__iter__' ) : li = [ ] for element in inp : if isinstance ( element , basestring ) : li . append ( convert ( element ) ) elif hasattr ( element , '__iter__' ) : li . append ( convert ( element ) ) else : li . append ( element ) return li return inp args = [ convert ( arg ) for arg in args ] return method ( self , * args , ** kwargs ) return wrapper
decorator for converting ansi in input .