Пример #1
0
def flatten(expr):
    """
    Test utility method to turn a list of strings character attribute
    declarations and similar lists into a single string with all character
    attribute information removed.
    """
    return u''.join(list(text.flatten(expr, currentAttrs=text.AttributeSet())))
Пример #2
0
 def send(self, stuff):
     """
     Write a flattenable structure to my transport/protocol thingy.
     """
     #FIXME: Encoding should be done *inside* flatten, not here.
     flatterStuff = T.flatten(stuff, useColors=self.useColors,
                              currentAttrs=self.termAttrs)
     txt = u''.join(list(flatterStuff))
     bytes = txt.encode('utf-8')
     self.proto.write(bytes)
Пример #3
0
def flattenWithoutColors(vt102):
    return T.flatten(vt102, useColors=False)
Пример #4
0
def F(*a, **kw):
    if "currentAttrs" not in kw:
        kw["currentAttrs"] = T.AttributeSet()
    return ''.join(list(T.flatten(a, **kw)))
Пример #5
0
def flattenWithoutColors(vt102):
    return T.flatten(vt102, useColors=False)
Пример #6
0
def F(*a, **kw):
    if "currentAttrs" not in kw:
        kw["currentAttrs"] = T.AttributeSet()
    return ''.join(list(T.flatten(a, **kw)))
Пример #7
0
 def format(potentialTarget):
     concept = iimaginary.IConcept(potentialTarget)
     vt102 = concept.vt102(self.player)
     flattened = list(flatten(vt102, useColors=False))
     return "".join(flattened)
Пример #8
0
 def format(potentialTarget):
     concept = iimaginary.IConcept(potentialTarget)
     vt102 = concept.vt102(self.player)
     flattened = list(flatten(vt102, useColors=False))
     return "".join(flattened)