예제 #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
파일: player.py 프로젝트: glyph/imaginary
 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)