コード例 #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 setProtocol(self, proto):
     if self.proto is not None:
         self.send("Your body has been usurped!\n")
         self.disconnect()
     self.proto = proto
     self.termAttrs = T.AttributeSet()
コード例 #3
0
def NN(**kw):
    nkw = dict.fromkeys(T.AttributeSet.__names__, T.unset)
    nkw.update(kw)
    AS = T.AttributeSet(**nkw)
    x = T.neutral.clone().update(AS)
    return x
コード例 #4
0
def F(*a, **kw):
    if "currentAttrs" not in kw:
        kw["currentAttrs"] = T.AttributeSet()
    return ''.join(list(T.flatten(a, **kw)))