Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dc3c617

Browse files
committed
Some long overdue maintainance. Made all IDE sources 7-bit-clean, to avoid any further encoding conversion troubles.
1 parent 9020bce commit dc3c617

14 files changed

Lines changed: 86 additions & 84 deletions

Mac/Tools/IDE/ModuleBrowser.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ def __init__(self):
1414

1515
#self.window.bevelbox = W.BevelBox((0, 0, 0, 56))
1616
self.window.openbutton = W.Button((10, 8, 80, 16), "Open", self.openbuttonhit)
17-
self.window.browsebutton = W.Button((100, 8, 80, 16), "Browseƒ", self.browsebuttonhit)
17+
self.window.browsebutton = W.Button((100, 8, 80, 16), "Browse\xc9", self.browsebuttonhit)
1818
self.window.reloadbutton = W.Button((10, 32, 80, 16), "Reload", self.reloadbuttonhit)
19-
self.window.openotherbutton = W.Button((100, 32, 80, 16), "Open otherƒ", self.openother)
19+
self.window.openotherbutton = W.Button((100, 32, 80, 16), "Open other\xc9", self.openother)
2020

2121
self.window.openbutton.enable(0)
2222
self.window.reloadbutton.enable(0)
@@ -81,7 +81,7 @@ def openbuttonhit(self):
8181
file, path, description = imp.find_module(modname)
8282
except ImportError:
8383
W.SetCursor("arrow")
84-
W.Message("CanÕt find file for module –%s”."
84+
W.Message("Can't find file for module '%s'."
8585
% modname)
8686
else:
8787
self.openscript(path, modname)
@@ -93,7 +93,7 @@ def openscript(self, path, modname):
9393
elif path[-4:] in ['.pyc', '.pyo']:
9494
W.getapplication().openscript(path[:-1], modname=modname)
9595
else:
96-
W.Message("CanÕt edit –%s”; it might be a shared library or a .pyc file."
96+
W.Message("Can't edit '%s'; it might be a shared library or a .pyc file."
9797
% modname)
9898

9999
def openother(self):
@@ -106,9 +106,9 @@ def openother(self):
106106
file, path, description = imp.find_module(modname)
107107
except ImportError:
108108
if modname in sys.builtin_module_names:
109-
alerttext = "–%s” is a builtin module, which you canÕt edit." % modname
109+
alerttext = "'%s' is a builtin module, which you can't edit." % modname
110110
else:
111-
alerttext = "No module named –%s”." % modname
111+
alerttext = "No module named '%s'." % modname
112112
raise W.AlertError, alerttext
113113
self.openscript(path, modname)
114114

Mac/Tools/IDE/PyBrowser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def double_repr(key, value, truncvalue = 0,
3838
value = _repr(value)
3939
'' + value # test to see if it is a string, in case a __repr__ method is buggy
4040
except:
41-
value = '‚‚‚ exception in repr()'
41+
value = '\xa5\xa5\xa5 exception in repr()'
4242
if truncvalue:
4343
return key + '\t' + value[:255]
4444
return key + '\t' + value
@@ -360,7 +360,7 @@ def update(self):
360360
def unpack_object(object, indent = 0):
361361
tp = type(object)
362362
if tp in SIMPLE_TYPES and tp is not types.NoneType:
363-
raise TypeError, 'canÕt browse simple type: %s' % tp.__name__
363+
raise TypeError, "can't browse simple type: %s" % tp.__name__
364364
elif tp == types.DictionaryType:
365365
return unpack_dict(object, indent)
366366
elif tp in (types.TupleType, types.ListType):

Mac/Tools/IDE/PyConsole.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def set_namespace(self, dict):
4848

4949
def open(self):
5050
W.EditText.open(self)
51-
self.write('Python ' + sys.version + '\n' + sys.copyright + '\n')
51+
self.write('Python ' + sys.version + '\nType "copyright", "credits" or "license" for more information.\n')
5252
self.write(sys.ps1)
5353
self.flush()
5454

@@ -156,8 +156,8 @@ def __init__(self, bounds, show = 1, fontsettings = ("Monaco", 0, 9, (0, 0, 0)),
156156
def makenamespacemenu(self, *args):
157157
W.SetCursor('watch')
158158
namespacelist = self.getnamespacelist()
159-
self.namespacemenu.set([("Clear window", self.clearbuffer), ("Font settingsƒ", self.dofontsettings),
160-
["Namespace"] + namespacelist, ("Browse namespaceƒ", self.browsenamespace)])
159+
self.namespacemenu.set([("Clear window", self.clearbuffer), ("Font settings\xc9", self.dofontsettings),
160+
["Namespace"] + namespacelist, ("Browse namespace\xc9", self.browsenamespace)])
161161
currentname = self.consoletext._namespace["__name__"]
162162
for i in range(len(namespacelist)):
163163
if namespacelist[i][0] == currentname:
@@ -264,7 +264,7 @@ def setupwidgets(self):
264264
tabbable = 0)
265265
self.w.outputtext = OutputTextWidget((-1, -1, -14, 1), inset = (6, 5),
266266
fontsettings = self.fontsettings, tabsettings = self.tabsettings, readonly = 1)
267-
menuitems = [("Clear window", self.clearbuffer), ("Font settingsƒ", self.dofontsettings)]
267+
menuitems = [("Clear window", self.clearbuffer), ("Font settings\xc9", self.dofontsettings)]
268268
self.w.popupmenu = W.PopupMenu((-15, -1, 16, 16), menuitems)
269269

270270
self.w._bary = W.Scrollbar((-15, 14, 16, -14), self.w.outputtext.vscroll, max = 32767)

Mac/Tools/IDE/PyDebugger.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def start(self, bottomframe = None, running = 0):
7272
self.botframe = bottomframe
7373
if running:
7474
self.set_continue()
75-
self.reason = 'Runningƒ'
75+
self.reason = 'Running\xc9'
7676
self.setstate('running')
7777
else:
7878
self.set_step()
@@ -187,7 +187,7 @@ def setupwidgets(self, title):
187187
def makeoptionsmenu(self):
188188
options = [('Clear breakpoints', self.w.panes.bottom.src.source.clearbreakpoints),
189189
('Clear all breakpoints', self.clear_all_breaks),
190-
('Edit breakpointsƒ', self.edit_breaks), '-',
190+
('Edit breakpoints\xc9', self.edit_breaks), '-',
191191
(self.tracemagic and
192192
'Disable __magic__ tracing' or 'Enable __magic__ tracing', self.togglemagic)]
193193
self.w.panes.bottom.src.optionsmenu.set(options)
@@ -318,7 +318,7 @@ def do_stepout(self):
318318

319319
def running(self):
320320
W.SetCursor('watch')
321-
self.reason = 'Runningƒ'
321+
self.reason = 'Running\xc9'
322322
self.setstate('running')
323323
#self.w.panes.bottom.src.source.set('')
324324
#self.w.panes.browserpanes.stacklist.stack.set([])
@@ -350,7 +350,7 @@ def showframe(self, stackindex):
350350
try:
351351
f, filename, (suff, mode, dummy) = imp.find_module(modname)
352352
except ImportError:
353-
self.w.panes.bottom.src.source.set('canÕt find file')
353+
self.w.panes.bottom.src.source.set("can't find file")
354354
else:
355355
if f:
356356
f.close()
@@ -360,9 +360,9 @@ def showframe(self, stackindex):
360360
f.close()
361361
self.w.panes.bottom.src.source.set(data, filename)
362362
else:
363-
self.w.panes.bottom.src.source.set('canÕt find file')
363+
self.w.panes.bottom.src.source.set("can't find file")
364364
else:
365-
self.w.panes.bottom.src.source.set('canÕt find file')
365+
self.w.panes.bottom.src.source.set("can't find file")
366366
else:
367367
self.w.panes.bottom.src.source.set(data, filename)
368368
self.file = filename
@@ -682,7 +682,7 @@ def __init__(self, debugger):
682682
self.w.panes.files = W.List(None, callback = self.filehit) #, flags = Lists.lOnlyOne)
683683
self.w.panes.gr = W.Group(None)
684684
self.w.panes.gr.breaks = W.List((0, 0, -130, 0), callback = self.linehit) #, flags = Lists.lOnlyOne)
685-
self.w.panes.gr.openbutton = W.Button((-80, 4, 0, 16), 'Viewƒ', self.openbuttonhit)
685+
self.w.panes.gr.openbutton = W.Button((-80, 4, 0, 16), 'View\xc9', self.openbuttonhit)
686686
self.w.panes.gr.deletebutton = W.Button((-80, 28, 0, 16), 'Delete', self.deletebuttonhit)
687687

688688
self.w.bind('<close>', self.close)
@@ -880,7 +880,7 @@ def _getbottomframe():
880880

881881
def getdebugger():
882882
if not __debug__:
883-
raise W.AlertError, "CanÕt debug in Optimize bytecode mode.\r(see Default startup options in EditPythonPreferences)"
883+
raise W.AlertError, "Can't debug in \"Optimize bytecode\" mode.\r(see \"Default startup options\" in EditPythonPreferences)"
884884
global _debugger
885885
if _debugger is None:
886886
_debugger = Debugger()

Mac/Tools/IDE/PyDocSearch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def listhit(self, isdbl = 1):
101101
class Status:
102102

103103
def __init__(self):
104-
self.w = W.Dialog((440, 64), "Searchingƒ")
104+
self.w = W.Dialog((440, 64), "Searching\xc9")
105105
self.w.searching = W.TextBox((4, 4, -4, 16), "DevDev:PyPyDoc 1.5.1:ext:parseTupleAndKeywords.html")
106106
self.w.hits = W.TextBox((4, 24, -4, 16), "Hits: 0")
107107
self.w.canceltip = W.TextBox((4, 44, -4, 16), "Type cmd-period (.) to cancel.")

Mac/Tools/IDE/PyEdit.py

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(self, path = "", title = ""):
6767
else:
6868
sourceOS = 'UNIX'
6969
searchString = '\n'
70-
change = EasyDialogs.AskYesNoCancel('–%s” contains %s-style line feeds. '
70+
change = EasyDialogs.AskYesNoCancel('"%s" contains %s-style line feeds. '
7171
'Change them to MacOS carriage returns?' % (self.title, sourceOS), 1)
7272
# bug: Cancel is treated as No
7373
if change > 0:
@@ -224,14 +224,14 @@ def setupwidgets(self, text):
224224
self.linefield.bind("<click>", self.clicklinefield)
225225

226226
def makeoptionsmenu(self):
227-
menuitems = [('Font settingsƒ', self.domenu_fontsettings),
228-
("Save optionsƒ", self.domenu_options),
227+
menuitems = [('Font settings\xc9', self.domenu_fontsettings),
228+
("Save options\xc9", self.domenu_options),
229229
'-',
230230
('\0' + chr(self.run_as_main) + 'Run as __main__', self.domenu_toggle_run_as_main),
231231
#('\0' + chr(self.run_with_interpreter) + 'Run with Interpreter', self.domenu_toggle_run_with_interpreter),
232232
#'-',
233233
('Modularize', self.domenu_modularize),
234-
('Browse namespaceƒ', self.domenu_browsenamespace),
234+
('Browse namespace\xc9', self.domenu_browsenamespace),
235235
'-']
236236
if self.profiling:
237237
menuitems = menuitems + [('Disable profiler', self.domenu_toggleprofiler)]
@@ -240,7 +240,7 @@ def makeoptionsmenu(self):
240240
if self.editgroup.editor._debugger:
241241
menuitems = menuitems + [('Disable debugger', self.domenu_toggledebugger),
242242
('Clear breakpoints', self.domenu_clearbreakpoints),
243-
('Edit breakpointsƒ', self.domenu_editbreakpoints)]
243+
('Edit breakpoints\xc9', self.domenu_editbreakpoints)]
244244
else:
245245
menuitems = menuitems + [('Enable debugger', self.domenu_toggledebugger)]
246246
self.editgroup.optionsmenu.set(menuitems)
@@ -285,7 +285,7 @@ def domenu_browsenamespace(self, *args):
285285
def domenu_modularize(self, *args):
286286
modname = _filename_as_modname(self.title)
287287
if not modname:
288-
raise W.AlertError, 'CanÕt modularize –%s”' % self.title
288+
raise W.AlertError, "Can't modularize \"%s\"" % self.title
289289
run_as_main = self.run_as_main
290290
self.run_as_main = 0
291291
self.run()
@@ -360,7 +360,7 @@ def close(self):
360360
import EasyDialogs
361361
import Qd
362362
Qd.InitCursor() # XXX should be done by dialog
363-
save = EasyDialogs.AskYesNoCancel('Save window –%s” before closing?' % self.title, 1)
363+
save = EasyDialogs.AskYesNoCancel('Save window "%s" before closing?' % self.title, 1)
364364
if save > 0:
365365
if self.domenu_save():
366366
return 1
@@ -416,11 +416,7 @@ def domenu_save_as(self, *args):
416416
W.getapplication().makescriptsmenu()
417417

418418
def domenu_save_as_applet(self, *args):
419-
try:
420-
import buildtools
421-
except ImportError:
422-
# only have buildtools in Python >= 1.5.2
423-
raise W.AlertError, "–Save as Applet” is only supported in\rPython 1.5.2 and up."
419+
import buildtools
424420

425421
buildtools.DEBUG = 0 # ouch.
426422

@@ -504,7 +500,7 @@ def _run(self):
504500
if self.editgroup.editor.changed:
505501
import EasyDialogs
506502
import Qd; Qd.InitCursor()
507-
save = EasyDialogs.AskYesNoCancel('Save –%s” before running?' % self.title, 1)
503+
save = EasyDialogs.AskYesNoCancel('Save "%s" before running?' % self.title, 1)
508504
if save > 0:
509505
if self.domenu_save():
510506
return
@@ -560,23 +556,23 @@ def _runselection(self):
560556
classname = string.split(string.strip(line[6:]))[0]
561557
classend = identifieRE_match(classname)
562558
if classend < 1:
563-
raise W.AlertError, 'CanÕt find a class.'
559+
raise W.AlertError, "Can't find a class."
564560
classname = classname[:classend]
565561
break
566562
elif line and line[0] not in '\t#':
567-
raise W.AlertError, 'CanÕt find a class.'
563+
raise W.AlertError, "Can't find a class."
568564
else:
569-
raise W.AlertError, 'CanÕt find a class.'
565+
raise W.AlertError, "Can't find a class."
570566
if globals.has_key(classname):
571567
locals = globals[classname].__dict__
572568
else:
573-
raise W.AlertError, 'CanÕt find class –%s”.' % classname
569+
raise W.AlertError, "Can't find class \"%s\"." % classname
574570
# dedent to top level
575571
for i in range(len(lines)):
576572
lines[i] = lines[i][1:]
577573
pytext = string.join(lines, '\r')
578574
elif indent > 0:
579-
raise W.AlertError, 'CanÕt run indented code.'
575+
raise W.AlertError, "Can't run indented code."
580576

581577
# add "newlines" to fool compile/exec:
582578
# now a traceback will give the right line number
@@ -839,7 +835,7 @@ def show(self):
839835
self.buttons = [ ("Find", "cmdf", self.find),
840836
("Replace", "cmdr", self.replace),
841837
("Replace all", None, self.replaceall),
842-
("DonÕt find", "cmdd", self.dont),
838+
("Don't find", "cmdd", self.dont),
843839
("Cancel", "cmd.", self.cancel)
844840
]
845841
for i in range(len(self.buttons)):
@@ -848,7 +844,7 @@ def show(self):
848844
self.w[title] = W.Button(bounds, title, callback)
849845
if shortcut:
850846
self.w.bind(shortcut, self.w[title].push)
851-
self.w.setdefaultbutton(self.w["DonÕt find"])
847+
self.w.setdefaultbutton(self.w["Don't find"])
852848
self.w.find.edit.bind("<key>", self.key)
853849
self.w.bind("<activate>", self.activate)
854850
self.w.bind("<close>", self.close)
@@ -881,11 +877,11 @@ def checkbuttons(self):
881877
else:
882878
for title, cmd, call in self.buttons[:-2]:
883879
self.w[title].enable(0)
884-
self.w.setdefaultbutton(self.w["DonÕt find"])
880+
self.w.setdefaultbutton(self.w["Don't find"])
885881
else:
886882
for title, cmd, call in self.buttons[:-2]:
887883
self.w[title].enable(0)
888-
self.w.setdefaultbutton(self.w["DonÕt find"])
884+
self.w.setdefaultbutton(self.w["Don't find"])
889885

890886
def find(self):
891887
self.getparmsfromwindow()
@@ -1204,7 +1200,7 @@ def __init__(self):
12041200
self.template = "%s, %d point"
12051201
self.fontsettings, self.tabsettings, self.windowsize = geteditorprefs()
12061202
self.w = W.Dialog((328, 120), "Editor default settings")
1207-
self.w.setfontbutton = W.Button((8, 8, 80, 16), "Set fontƒ", self.dofont)
1203+
self.w.setfontbutton = W.Button((8, 8, 80, 16), "Set font\xc9", self.dofont)
12081204
self.w.fonttext = W.TextBox((98, 10, -8, 14), self.template % (self.fontsettings[0], self.fontsettings[2]))
12091205

12101206
self.w.picksizebutton = W.Button((8, 50, 80, 16), "Front window", self.picksize)

Mac/Tools/IDE/PythonIDE.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# copyright 1996-1999 Just van Rossum, Letterror. [email protected]
1+
# copyright 1996-2001 Just van Rossum, Letterror. [email protected]
22

33
# keep this (__main__) as clean as possible, since we are using
44
# it like the "normal" interpreter.
55

6-
__version__ = '1.0'
6+
__version__ = '1.0.1'
77

88

99
def init():

Mac/Tools/IDE/PythonIDE.rsrc

-2.65 KB
Binary file not shown.

Mac/Tools/IDE/PythonIDEMain.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ def __init__(self):
5050
def makeusermenus(self):
5151
m = Wapplication.Menu(self.menubar, "File")
5252
newitem = FrameWork.MenuItem(m, "New", "N", 'new')
53-
openitem = FrameWork.MenuItem(m, "Openƒ", "O", 'open')
53+
openitem = FrameWork.MenuItem(m, "Open\xc9", "O", 'open')
5454
FrameWork.Separator(m)
5555
closeitem = FrameWork.MenuItem(m, "Close", "W", 'close')
5656
saveitem = FrameWork.MenuItem(m, "Save", "S", 'save')
57-
saveasitem = FrameWork.MenuItem(m, "Save asƒ", None, 'save_as')
57+
saveasitem = FrameWork.MenuItem(m, "Save as\xc9", None, 'save_as')
5858
FrameWork.Separator(m)
59-
saveasappletitem = FrameWork.MenuItem(m, "Save as Appletƒ", None, 'save_as_applet')
59+
saveasappletitem = FrameWork.MenuItem(m, "Save as Applet\xc9", None, 'save_as_applet')
6060
FrameWork.Separator(m)
6161
quititem = FrameWork.MenuItem(m, "Quit", "Q", 'quit')
6262

@@ -71,7 +71,7 @@ def makeusermenus(self):
7171
selallitem = FrameWork.MenuItem(m, "Select all", "A", "selectall")
7272
sellineitem = FrameWork.MenuItem(m, "Select line", "L", "selectline")
7373
FrameWork.Separator(m)
74-
finditem = FrameWork.MenuItem(m, "Findƒ", "F", "find")
74+
finditem = FrameWork.MenuItem(m, "Find\xc9", "F", "find")
7575
findagainitem = FrameWork.MenuItem(m, "Find again", 'G', "findnext")
7676
enterselitem = FrameWork.MenuItem(m, "Enter search string", "E", "entersearchstring")
7777
replaceitem = FrameWork.MenuItem(m, "Replace", None, "replace")
@@ -84,12 +84,12 @@ def makeusermenus(self):
8484
runitem = FrameWork.MenuItem(m, "Run window", "R", 'run')
8585
runselitem = FrameWork.MenuItem(m, "Run selection", None, 'runselection')
8686
FrameWork.Separator(m)
87-
moditem = FrameWork.MenuItem(m, "Module browserƒ", "M", self.domenu_modulebrowser)
87+
moditem = FrameWork.MenuItem(m, "Module browser\xc9", "M", self.domenu_modulebrowser)
8888
FrameWork.Separator(m)
8989
mm = FrameWork.SubMenu(m, "Preferences")
90-
FrameWork.MenuItem(mm, "Set Scripts folderƒ", None, self.do_setscriptsfolder)
91-
FrameWork.MenuItem(mm, "Editor default settingsƒ", None, self.do_editorprefs)
92-
FrameWork.MenuItem(mm, "Set default window fontƒ", None, self.do_setwindowfont)
90+
FrameWork.MenuItem(mm, "Set Scripts folder\xc9", None, self.do_setscriptsfolder)
91+
FrameWork.MenuItem(mm, "Editor default settings\xc9", None, self.do_editorprefs)
92+
FrameWork.MenuItem(mm, "Set default window font\xc9", None, self.do_setwindowfont)
9393

9494
self.openwindowsmenu = Wapplication.Menu(self.menubar, 'Windows')
9595
self.makeopenwindowsmenu()
@@ -110,7 +110,7 @@ def makeusermenus(self):
110110
path = os.path.join(os.getcwd(), "Scripts")
111111
if not os.path.exists(path):
112112
os.mkdir(path)
113-
f = open(os.path.join(path, "Place your scripts hereƒ"), "w")
113+
f = open(os.path.join(path, "Place your scripts here\xc9"), "w")
114114
f.close()
115115
fss = macfs.FSSpec(path)
116116
self.scriptsfolder = fss.NewAlias()
@@ -156,10 +156,10 @@ def opendoc(self, path):
156156
if ftype == 'TEXT':
157157
self.openscript(path)
158158
else:
159-
W.Message("CanÕt open file of type '%s'." % ftype)
159+
W.Message("Can't open file of type '%s'." % ftype)
160160

161161
def getabouttext(self):
162-
return "About Python IDEƒ"
162+
return "About Python IDE\xc9"
163163

164164
def do_about(self, id, item, window, event):
165165
Splash.about()

0 commit comments

Comments
 (0)