Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/chat/richtext.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2006-05-19 22:05:00 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2006-05-19 22:05:00 (GMT)
commit11a1925c2d2d00fc42f4d8dd3b45c36aee09ae56 (patch)
tree2f8013dfadfac4a88d4f21f6e70b8a428243e14c /sugar/chat/richtext.py
parent2a2903d1fb05e4c237b619deb9eebfb8fca7bc75 (diff)
Write a toolbox and partially integrate it with the chat.
Diffstat (limited to 'sugar/chat/richtext.py')
-rw-r--r--sugar/chat/richtext.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/sugar/chat/richtext.py b/sugar/chat/richtext.py
index 543e431..ecb15c2 100644
--- a/sugar/chat/richtext.py
+++ b/sugar/chat/richtext.py
@@ -209,16 +209,8 @@ class RichTextHandler(xml.sax.handler.ContentHandler):
self.buf = buf
self.serializer = serializer
self.tags = []
- self._in_richtext = False
- self._done = False
def startElement(self, name, attrs):
- # Look for, and only start parsing after 'richtext'
- if not self._in_richtext and name == "richtext":
- self._in_richtext = True
- if not self._in_richtext:
- return
-
if name != "richtext":
tag = self.serializer.deserialize_element(name, attrs)
self.tags.append(tag)
@@ -238,12 +230,8 @@ class RichTextHandler(xml.sax.handler.ContentHandler):
"link", "link-address")
def endElement(self, name):
- if not self._done and self._in_richtext:
- if name != "richtext":
- self.tags.pop()
- if name == "richtext":
- self._done = True
- self._in_richtext = False
+ if name != "richtext":
+ self.tags.pop()
class RichTextSerializer:
def __init__(self):