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())))
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()
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
def F(*a, **kw): if "currentAttrs" not in kw: kw["currentAttrs"] = T.AttributeSet() return ''.join(list(T.flatten(a, **kw)))