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
8e4fa072
Commit
8e4fa072
authored
Jul 10, 2001
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
De-string-module-ification.
parent
60e1886e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
Tools/pynche/PyncheWidget.py
Tools/pynche/PyncheWidget.py
+4
-5
Tools/pynche/StripViewer.py
Tools/pynche/StripViewer.py
+7
-5
No files found.
Tools/pynche/PyncheWidget.py
View file @
8e4fa072
...
...
@@ -6,7 +6,6 @@ It is used to bring up other windows.
import
sys
import
os
import
string
from
Tkinter
import
*
import
tkMessageBox
import
tkFileDialog
...
...
@@ -221,9 +220,9 @@ class Helpwin:
fp
=
open
(
readmefile
)
contents
=
fp
.
read
()
# wax the last page, it contains Emacs cruft
i
=
string
.
rfind
(
contents
,
'
\
f
'
)
i
=
contents
.
rfind
(
'
\
f
'
)
if
i
>
0
:
contents
=
string
.
rstrip
(
contents
[:
i
]
)
contents
=
contents
[:
i
].
rstrip
(
)
finally
:
if
fp
:
fp
.
close
()
...
...
@@ -258,11 +257,11 @@ class PopupViewer:
self
.
__root
=
root
self
.
__menutext
=
module
.
ADDTOVIEW
# find the underline character
underline
=
string
.
find
(
module
.
ADDTOVIEW
,
'%'
)
underline
=
module
.
ADDTOVIEW
.
find
(
'%'
)
if
underline
==
-
1
:
underline
=
0
else
:
self
.
__menutext
=
string
.
replace
(
module
.
ADDTOVIEW
,
'%'
,
''
,
1
)
self
.
__menutext
=
module
.
ADDTOVIEW
.
replace
(
'%'
,
''
,
1
)
self
.
__underline
=
underline
self
.
__window
=
None
...
...
Tools/pynche/StripViewer.py
View file @
8e4fa072
...
...
@@ -24,7 +24,6 @@ select the color under the cursor while you drag it, but be forewarned that
this can be slow.
"""
import
string
from
Tkinter
import
*
import
ColorDB
...
...
@@ -46,7 +45,10 @@ BTNDOWN = 4
BTNUP
=
5
BTNDRAG
=
6
SPACE
=
' '
def
constant
(
numchips
):
step
=
255.0
/
(
numchips
-
1
)
start
=
0.0
...
...
@@ -141,7 +143,7 @@ class RightArrow(LeftArrow):
width
=
3.0
,
tags
=
self
.
_TAG
)
text
=
self
.
_canvas
.
create_text
(
x
-
self
.
_ARROWWIDTH
+
15
,
#
TBD
: kludge
x
-
self
.
_ARROWWIDTH
+
15
,
#
BAW
: kludge
self
.
_ARROWHEIGHT
-
self
.
_TEXTYOFFSET
,
justify
=
RIGHT
,
text
=
'128'
,
...
...
@@ -151,7 +153,7 @@ class RightArrow(LeftArrow):
def
_x
(
self
):
coords
=
self
.
_canvas
.
bbox
(
self
.
_TAG
)
assert
coords
return
coords
[
2
]
-
6
#
TBD
: kludge
return
coords
[
2
]
-
6
#
BAW
: kludge
...
...
@@ -182,7 +184,7 @@ class StripWidget:
self
.
__sb
=
switchboard
canvaswidth
=
numchips
*
(
chipwidth
+
1
)
canvasheight
=
chipheight
+
43
#
TBD
: Kludge
canvasheight
=
chipheight
+
43
#
BAW
: Kludge
# create the canvas and pack it
canvas
=
self
.
__canvas
=
Canvas
(
master
,
...
...
@@ -301,7 +303,7 @@ class StripWidget:
chip
=
i
i
=
i
+
1
# call the raw tcl script
colors
=
string
.
join
(
chips
)
colors
=
SPACE
.
join
(
chips
)
tk
.
eval
(
'setcolor %s {%s}'
%
(
self
.
__canvas
.
_w
,
colors
))
# move the arrows around
self
.
__trackarrow
(
chip
,
(
red
,
green
,
blue
))
...
...
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