Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a5ca7dd7
Commit
a5ca7dd7
authored
May 23, 2001
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
One more macroman<->latin1 conversion victim.
parent
128c77d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
Mac/Tools/IDE/PyEdit.py
Mac/Tools/IDE/PyEdit.py
+19
-19
No files found.
Mac/Tools/IDE/PyEdit.py
View file @
a5ca7dd7
...
@@ -67,7 +67,7 @@ class Editor(W.Window):
...
@@ -67,7 +67,7 @@ class Editor(W.Window):
else
:
else
:
sourceOS
=
'UNIX'
sourceOS
=
'UNIX'
searchString
=
'
\
n
'
searchString
=
'
\
n
'
change
=
EasyDialogs
.
AskYesNoCancel
(
'%s contains %s-style line feeds. '
change
=
EasyDialogs
.
AskYesNoCancel
(
'%s contains %s-style line feeds. '
'Change them to MacOS carriage returns?'
%
(
self
.
title
,
sourceOS
),
1
)
'Change them to MacOS carriage returns?'
%
(
self
.
title
,
sourceOS
),
1
)
# bug: Cancel is treated as No
# bug: Cancel is treated as No
if
change
>
0
:
if
change
>
0
:
...
@@ -224,14 +224,14 @@ class Editor(W.Window):
...
@@ -224,14 +224,14 @@ class Editor(W.Window):
self
.
linefield
.
bind
(
"<click>"
,
self
.
clicklinefield
)
self
.
linefield
.
bind
(
"<click>"
,
self
.
clicklinefield
)
def
makeoptionsmenu
(
self
):
def
makeoptionsmenu
(
self
):
menuitems
=
[(
'Font settings'
,
self
.
domenu_fontsettings
),
menuitems
=
[(
'Font settings'
,
self
.
domenu_fontsettings
),
(
"Save options"
,
self
.
domenu_options
),
(
"Save options"
,
self
.
domenu_options
),
'-'
,
'-'
,
(
'
\
0
'
+
chr
(
self
.
run_as_main
)
+
'Run as __main__'
,
self
.
domenu_toggle_run_as_main
),
(
'
\
0
'
+
chr
(
self
.
run_as_main
)
+
'Run as __main__'
,
self
.
domenu_toggle_run_as_main
),
#('\0' + chr(self.run_with_interpreter) + 'Run with Interpreter', self.domenu_toggle_run_with_interpreter),
#('\0' + chr(self.run_with_interpreter) + 'Run with Interpreter', self.domenu_toggle_run_with_interpreter),
#'-',
#'-',
(
'Modularize'
,
self
.
domenu_modularize
),
(
'Modularize'
,
self
.
domenu_modularize
),
(
'Browse namespace'
,
self
.
domenu_browsenamespace
),
(
'Browse namespace'
,
self
.
domenu_browsenamespace
),
'-'
]
'-'
]
if
self
.
profiling
:
if
self
.
profiling
:
menuitems
=
menuitems
+
[(
'Disable profiler'
,
self
.
domenu_toggleprofiler
)]
menuitems
=
menuitems
+
[(
'Disable profiler'
,
self
.
domenu_toggleprofiler
)]
...
@@ -240,7 +240,7 @@ class Editor(W.Window):
...
@@ -240,7 +240,7 @@ class Editor(W.Window):
if
self
.
editgroup
.
editor
.
_debugger
:
if
self
.
editgroup
.
editor
.
_debugger
:
menuitems
=
menuitems
+
[(
'Disable debugger'
,
self
.
domenu_toggledebugger
),
menuitems
=
menuitems
+
[(
'Disable debugger'
,
self
.
domenu_toggledebugger
),
(
'Clear breakpoints'
,
self
.
domenu_clearbreakpoints
),
(
'Clear breakpoints'
,
self
.
domenu_clearbreakpoints
),
(
'Edit breakpoints'
,
self
.
domenu_editbreakpoints
)]
(
'Edit breakpoints'
,
self
.
domenu_editbreakpoints
)]
else
:
else
:
menuitems
=
menuitems
+
[(
'Enable debugger'
,
self
.
domenu_toggledebugger
)]
menuitems
=
menuitems
+
[(
'Enable debugger'
,
self
.
domenu_toggledebugger
)]
self
.
editgroup
.
optionsmenu
.
set
(
menuitems
)
self
.
editgroup
.
optionsmenu
.
set
(
menuitems
)
...
@@ -285,7 +285,7 @@ class Editor(W.Window):
...
@@ -285,7 +285,7 @@ class Editor(W.Window):
def
domenu_modularize
(
self
,
*
args
):
def
domenu_modularize
(
self
,
*
args
):
modname
=
_filename_as_modname
(
self
.
title
)
modname
=
_filename_as_modname
(
self
.
title
)
if
not
modname
:
if
not
modname
:
raise
W
.
AlertError
,
'Cant modularize %s'
%
self
.
title
raise
W
.
AlertError
,
'Cant modularize %s'
%
self
.
title
run_as_main
=
self
.
run_as_main
run_as_main
=
self
.
run_as_main
self
.
run_as_main
=
0
self
.
run_as_main
=
0
self
.
run
()
self
.
run
()
...
@@ -360,7 +360,7 @@ class Editor(W.Window):
...
@@ -360,7 +360,7 @@ class Editor(W.Window):
import
EasyDialogs
import
EasyDialogs
import
Qd
import
Qd
Qd
.
InitCursor
()
# XXX should be done by dialog
Qd
.
InitCursor
()
# XXX should be done by dialog
save
=
EasyDialogs
.
AskYesNoCancel
(
'Save window %s before closing?'
%
self
.
title
,
1
)
save
=
EasyDialogs
.
AskYesNoCancel
(
'Save window %s before closing?'
%
self
.
title
,
1
)
if
save
>
0
:
if
save
>
0
:
if
self
.
domenu_save
():
if
self
.
domenu_save
():
return
1
return
1
...
@@ -420,7 +420,7 @@ class Editor(W.Window):
...
@@ -420,7 +420,7 @@ class Editor(W.Window):
import
buildtools
import
buildtools
except
ImportError
:
except
ImportError
:
# only have buildtools in Python >= 1.5.2
# only have buildtools in Python >= 1.5.2
raise
W
.
AlertError
,
"Save as Applet is only supported in
\
r
Python 1.5.2 and up."
raise
W
.
AlertError
,
"Save as Applet is only supported in
\
r
Python 1.5.2 and up."
buildtools
.
DEBUG
=
0
# ouch.
buildtools
.
DEBUG
=
0
# ouch.
...
@@ -504,7 +504,7 @@ class Editor(W.Window):
...
@@ -504,7 +504,7 @@ class Editor(W.Window):
if
self
.
editgroup
.
editor
.
changed
:
if
self
.
editgroup
.
editor
.
changed
:
import
EasyDialogs
import
EasyDialogs
import
Qd
;
Qd
.
InitCursor
()
import
Qd
;
Qd
.
InitCursor
()
save
=
EasyDialogs
.
AskYesNoCancel
(
'Save %s before running?'
%
self
.
title
,
1
)
save
=
EasyDialogs
.
AskYesNoCancel
(
'Save %s before running?'
%
self
.
title
,
1
)
if
save
>
0
:
if
save
>
0
:
if
self
.
domenu_save
():
if
self
.
domenu_save
():
return
return
...
@@ -560,23 +560,23 @@ class Editor(W.Window):
...
@@ -560,23 +560,23 @@ class Editor(W.Window):
classname
=
string
.
split
(
string
.
strip
(
line
[
6
:]))[
0
]
classname
=
string
.
split
(
string
.
strip
(
line
[
6
:]))[
0
]
classend
=
identifieRE_match
(
classname
)
classend
=
identifieRE_match
(
classname
)
if
classend
<
1
:
if
classend
<
1
:
raise
W
.
AlertError
,
'Cant find a class.'
raise
W
.
AlertError
,
'Cant find a class.'
classname
=
classname
[:
classend
]
classname
=
classname
[:
classend
]
break
break
elif
line
and
line
[
0
]
not
in
'
\
t
#'
:
elif
line
and
line
[
0
]
not
in
'
\
t
#'
:
raise
W
.
AlertError
,
'Cant find a class.'
raise
W
.
AlertError
,
'Cant find a class.'
else
:
else
:
raise
W
.
AlertError
,
'Cant find a class.'
raise
W
.
AlertError
,
'Cant find a class.'
if
globals
.
has_key
(
classname
):
if
globals
.
has_key
(
classname
):
locals
=
globals
[
classname
].
__dict__
locals
=
globals
[
classname
].
__dict__
else
:
else
:
raise
W
.
AlertError
,
'Cant find class %s.'
%
classname
raise
W
.
AlertError
,
'Cant find class %s.'
%
classname
# dedent to top level
# dedent to top level
for
i
in
range
(
len
(
lines
)):
for
i
in
range
(
len
(
lines
)):
lines
[
i
]
=
lines
[
i
][
1
:]
lines
[
i
]
=
lines
[
i
][
1
:]
pytext
=
string
.
join
(
lines
,
'
\
r
'
)
pytext
=
string
.
join
(
lines
,
'
\
r
'
)
elif
indent
>
0
:
elif
indent
>
0
:
raise
W
.
AlertError
,
'Cant run indented code.'
raise
W
.
AlertError
,
'Cant run indented code.'
# add "newlines" to fool compile/exec:
# add "newlines" to fool compile/exec:
# now a traceback will give the right line number
# now a traceback will give the right line number
...
@@ -839,7 +839,7 @@ class SearchEngine:
...
@@ -839,7 +839,7 @@ class SearchEngine:
self
.
buttons
=
[
(
"Find"
,
"cmdf"
,
self
.
find
),
self
.
buttons
=
[
(
"Find"
,
"cmdf"
,
self
.
find
),
(
"Replace"
,
"cmdr"
,
self
.
replace
),
(
"Replace"
,
"cmdr"
,
self
.
replace
),
(
"Replace all"
,
None
,
self
.
replaceall
),
(
"Replace all"
,
None
,
self
.
replaceall
),
(
"Dont find"
,
"cmdd"
,
self
.
dont
),
(
"Dont find"
,
"cmdd"
,
self
.
dont
),
(
"Cancel"
,
"cmd."
,
self
.
cancel
)
(
"Cancel"
,
"cmd."
,
self
.
cancel
)
]
]
for
i
in
range
(
len
(
self
.
buttons
)):
for
i
in
range
(
len
(
self
.
buttons
)):
...
@@ -848,7 +848,7 @@ class SearchEngine:
...
@@ -848,7 +848,7 @@ class SearchEngine:
self
.
w
[
title
]
=
W
.
Button
(
bounds
,
title
,
callback
)
self
.
w
[
title
]
=
W
.
Button
(
bounds
,
title
,
callback
)
if
shortcut
:
if
shortcut
:
self
.
w
.
bind
(
shortcut
,
self
.
w
[
title
].
push
)
self
.
w
.
bind
(
shortcut
,
self
.
w
[
title
].
push
)
self
.
w
.
setdefaultbutton
(
self
.
w
[
"Dont find"
])
self
.
w
.
setdefaultbutton
(
self
.
w
[
"Dont find"
])
self
.
w
.
find
.
edit
.
bind
(
"<key>"
,
self
.
key
)
self
.
w
.
find
.
edit
.
bind
(
"<key>"
,
self
.
key
)
self
.
w
.
bind
(
"<activate>"
,
self
.
activate
)
self
.
w
.
bind
(
"<activate>"
,
self
.
activate
)
self
.
w
.
bind
(
"<close>"
,
self
.
close
)
self
.
w
.
bind
(
"<close>"
,
self
.
close
)
...
@@ -881,11 +881,11 @@ class SearchEngine:
...
@@ -881,11 +881,11 @@ class SearchEngine:
else
:
else
:
for
title
,
cmd
,
call
in
self
.
buttons
[:
-
2
]:
for
title
,
cmd
,
call
in
self
.
buttons
[:
-
2
]:
self
.
w
[
title
].
enable
(
0
)
self
.
w
[
title
].
enable
(
0
)
self
.
w
.
setdefaultbutton
(
self
.
w
[
"Dont find"
])
self
.
w
.
setdefaultbutton
(
self
.
w
[
"Dont find"
])
else
:
else
:
for
title
,
cmd
,
call
in
self
.
buttons
[:
-
2
]:
for
title
,
cmd
,
call
in
self
.
buttons
[:
-
2
]:
self
.
w
[
title
].
enable
(
0
)
self
.
w
[
title
].
enable
(
0
)
self
.
w
.
setdefaultbutton
(
self
.
w
[
"Dont find"
])
self
.
w
.
setdefaultbutton
(
self
.
w
[
"Dont find"
])
def
find
(
self
):
def
find
(
self
):
self
.
getparmsfromwindow
()
self
.
getparmsfromwindow
()
...
@@ -1204,7 +1204,7 @@ class _EditorDefaultSettings:
...
@@ -1204,7 +1204,7 @@ class _EditorDefaultSettings:
self
.
template
=
"%s, %d point"
self
.
template
=
"%s, %d point"
self
.
fontsettings
,
self
.
tabsettings
,
self
.
windowsize
=
geteditorprefs
()
self
.
fontsettings
,
self
.
tabsettings
,
self
.
windowsize
=
geteditorprefs
()
self
.
w
=
W
.
Dialog
((
328
,
120
),
"Editor default settings"
)
self
.
w
=
W
.
Dialog
((
328
,
120
),
"Editor default settings"
)
self
.
w
.
setfontbutton
=
W
.
Button
((
8
,
8
,
80
,
16
),
"Set font"
,
self
.
dofont
)
self
.
w
.
setfontbutton
=
W
.
Button
((
8
,
8
,
80
,
16
),
"Set font"
,
self
.
dofont
)
self
.
w
.
fonttext
=
W
.
TextBox
((
98
,
10
,
-
8
,
14
),
self
.
template
%
(
self
.
fontsettings
[
0
],
self
.
fontsettings
[
2
]))
self
.
w
.
fonttext
=
W
.
TextBox
((
98
,
10
,
-
8
,
14
),
self
.
template
%
(
self
.
fontsettings
[
0
],
self
.
fontsettings
[
2
]))
self
.
w
.
picksizebutton
=
W
.
Button
((
8
,
50
,
80
,
16
),
"Front window"
,
self
.
picksize
)
self
.
w
.
picksizebutton
=
W
.
Button
((
8
,
50
,
80
,
16
),
"Front window"
,
self
.
picksize
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment