Update of /cvsroot/thoughtstream/thoughtstream/thoughtstream
In directory sc8-pr-cvs1:/tmp/cvs-serv21247/thoughtstream
Modified Files:
mind.py
Log Message:
Updated to support Python 2 xml apis.
Fixed _make_menu to pass the ASCII code instead of character
Now thoughtstream starts up under Python 2.2 and the latest wxPython
Index: mind.py
===================================================================
RCS file: /cvsroot/thoughtstream/thoughtstream/thoughtstream/mind.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** mind.py 6 Oct 2000 03:32:37 -0000 1.14
--- mind.py 17 Jan 2003 03:59:17 -0000 1.15
***************
*** 7,11 ****
import struct
import os
! from xml.sax import saxlib, saxexts, saxutils
from urlparse import urlparse
from urllib import urlopen
--- 7,12 ----
import struct
import os
! import xml.sax
! from xml.sax import xmlreader, handler, saxutils
from urlparse import urlparse
from urllib import urlopen
***************
*** 14,18 ****
minds=[]
! class _mindhandler(saxlib.DocumentHandler):
"""Helper class for parsing mind files."""
def __init__(self, mind):
--- 15,19 ----
minds=[]
! class _mindhandler(handler.ContentHandler):
"""Helper class for parsing mind files."""
def __init__(self, mind):
***************
*** 132,136 ****
self.collecting=None
! class _ideahandler(saxlib.DocumentHandler):
"""Helper class for parsing idea files."""
def __init__(self, mind):
--- 133,137 ----
self.collecting=None
! class _ideahandler(handler.ContentHandler):
"""Helper class for parsing idea files."""
def __init__(self, mind):
***************
*** 247,251 ****
self.attr['default_idea']=self.default_id
self.attr['sync_id']=self.sync_id
! l=['<mind %s>'%thoughtstream.attr_string(self.attr)]
l.append('<head>')
for i in self.sync_list:
--- 248,253 ----
self.attr['default_idea']=self.default_id
self.attr['sync_id']=self.sync_id
! l=['<?xml version="1.0"?>']
! l.append('<mind %s>'%thoughtstream.attr_string(self.attr))
l.append('<head>')
for i in self.sync_list:
***************
*** 308,315 ****
os.makedirs(dir)
self.dir=dir
! self.idea_parser=saxexts.make_parser()
dh=_ideahandler(self)
! self.idea_parser.setDocumentHandler(dh)
! self.idea_parser.setErrorHandler(saxutils.ErrorRaiser())
def open_xml(self, file):
--- 310,317 ----
os.makedirs(dir)
self.dir=dir
! self.idea_parser=xml.sax.make_parser()
dh=_ideahandler(self)
! self.idea_parser.setContentHandler(dh)
! self.idea_parser.setErrorHandler(handler.ErrorHandler())
def open_xml(self, file):
***************
*** 318,325 ****
Takes as input either a filename/url or an open file object.
"""
! parser=saxexts.make_parser()
dh=_mindhandler(self)
! parser.setDocumentHandler(dh)
! parser.setErrorHandler(saxutils.ErrorRaiser())
if type(file)==type(''):
if (os.name=='nt') and (url[1]==':'):
--- 320,327 ----
Takes as input either a filename/url or an open file object.
"""
! parser=xml.sax.make_parser()
dh=_mindhandler(self)
! parser.setContentHandler(dh)
! parser.setErrorHandler(handler.ErrorHandler())
if type(file)==type(''):
if (os.name=='nt') and (url[1]==':'):
|