Lines 18-23
Link Here
|
18 |
from twisted.internet import protocol |
18 |
from twisted.internet import protocol |
19 |
from twisted.words.xish import domish, utility |
19 |
from twisted.words.xish import domish, utility |
20 |
|
20 |
|
|
|
21 |
try: |
22 |
from twisted.xish import domish as olddomish |
23 |
except ImportError: |
24 |
olddomish = None |
25 |
|
21 |
STREAM_CONNECTED_EVENT = intern("//event/stream/connected") |
26 |
STREAM_CONNECTED_EVENT = intern("//event/stream/connected") |
22 |
STREAM_START_EVENT = intern("//event/stream/start") |
27 |
STREAM_START_EVENT = intern("//event/stream/start") |
23 |
STREAM_END_EVENT = intern("//event/stream/end") |
28 |
STREAM_END_EVENT = intern("//event/stream/end") |
Lines 136-141
Link Here
|
136 |
""" |
141 |
""" |
137 |
if isinstance(obj, domish.Element): |
142 |
if isinstance(obj, domish.Element): |
138 |
obj = obj.toXml() |
143 |
obj = obj.toXml() |
|
|
144 |
|
145 |
if olddomish is not None and isinstance(obj, olddomish.Element): |
146 |
obj = obj.toXml() |
139 |
|
147 |
|
140 |
if isinstance(obj, unicode): |
148 |
if isinstance(obj, unicode): |
141 |
obj = obj.encode('utf-8') |
149 |
obj = obj.encode('utf-8') |