def __enter__(self): if not hasattr(_per_thread, "stack"): _per_thread.stack = [] _per_thread.stack.append(self) self._rec = hypertext.recording() self._roots = self._rec.__enter__() return self
def __enter__(self): if hasattr(self, "_rec"): raise TypeError("%r cannot be recursively embedded" % (self, )) self._rec = hypertext.recording() self._roots = self._rec.__enter__() return self
def __enter__(self): if hasattr(self, "_rec"): raise TypeError("%r cannot be recursively embedded" % (self,)) self._rec = hypertext.recording() self._roots = self._rec.__enter__() return self