[Python-checkins] python/dist/src/Mac/Tools/IDE Wapplication.py,
1.23, 1.24
jackjansen at users.sourceforge.net
jackjansen at users.sourceforge.net
Thu Jun 3 09:31:53 EDT 2004
Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31227
Modified Files:
Wapplication.py
Log Message:
Very large scripts folders could crash the IDE, because it runs out
of Menu IDs (of which there are only 255 in Carbon). Fixed by stopping
examining the scripts folder when we allocate menu ID 200.
Fixes #959291. Need to backport.
Index: Wapplication.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wapplication.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** Wapplication.py 12 Feb 2004 17:35:14 -0000 1.23
--- Wapplication.py 3 Jun 2004 13:31:51 -0000 1.24
***************
*** 276,283 ****
def scriptswalk(self, top, menu, done=None):
if done is None:
done = {}
if done.has_key(top):
! return
done[top] = 1
import os, string
--- 276,287 ----
def scriptswalk(self, top, menu, done=None):
+ if menu.id > 200:
+ import W
+ W.Message("Scripts folder not completely traversed: running out of menus")
+ return False
if done is None:
done = {}
if done.has_key(top):
! return True
done[top] = 1
import os, string
***************
*** 286,290 ****
except os.error:
FrameWork.MenuItem(menu, '(Scripts Folder not found)', None, None)
! return
savedir = os.getcwd()
os.chdir(top)
--- 290,294 ----
except os.error:
FrameWork.MenuItem(menu, '(Scripts Folder not found)', None, None)
! return True
savedir = os.getcwd()
os.chdir(top)
***************
*** 307,311 ****
elif isdir:
submenu = FrameWork.SubMenu(menu, name)
! self.scriptswalk(path, submenu, done)
else:
creator, type = MacOS.GetCreatorAndType(path)
--- 311,316 ----
elif isdir:
submenu = FrameWork.SubMenu(menu, name)
! if not self.scriptswalk(path, submenu, done):
! return False
else:
creator, type = MacOS.GetCreatorAndType(path)
***************
*** 317,320 ****
--- 322,326 ----
done[path] = 1
os.chdir(savedir)
+ return True
def domenu_script(self, id, item, window, event):
More information about the Python-checkins
mailing list