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
6180a2f4
Commit
6180a2f4
authored
Jul 15, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #18449: Make Tools/demo/ss1.py work again on Python 3. Patch by
Févry Thibault.
parents
d57b2686
2670b9ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
14 deletions
+18
-14
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
Tools/demo/ss1.py
Tools/demo/ss1.py
+14
-14
No files found.
Misc/ACKS
View file @
6180a2f4
...
...
@@ -1248,6 +1248,7 @@ Mikhail Terekhov
Victor Terrón
Richard M. Tew
Tobias Thelen
Févry Thibault
Lowe Thiderman
Nicolas M. Thiéry
James Thomas
...
...
Misc/NEWS
View file @
6180a2f4
...
...
@@ -656,6 +656,9 @@ Build
Tools/Demos
-----------
- Issue #18449: Make Tools/demo/ss1.py work again on Python 3. Patch by
Févry Thibault.
- Issue #12990: The "Python Launcher" on OSX could not launch python scripts
that have paths that include wide characters.
...
...
Tools/demo/ss1.py
View file @
6180a2f4
...
...
@@ -79,10 +79,10 @@ class Sheet:
del
self
.
cells
[
xy
]
def
clearrows
(
self
,
y1
,
y2
):
self
.
clearcells
(
0
,
y1
,
sys
.
max
int
,
y2
)
self
.
clearcells
(
0
,
y1
,
sys
.
max
size
,
y2
)
def
clearcolumns
(
self
,
x1
,
x2
):
self
.
clearcells
(
x1
,
0
,
x2
,
sys
.
max
int
)
self
.
clearcells
(
x1
,
0
,
x2
,
sys
.
max
size
)
def
selectcells
(
self
,
x1
,
y1
,
x2
,
y2
):
if
x1
>
x2
:
...
...
@@ -113,23 +113,23 @@ class Sheet:
def
insertrows
(
self
,
y
,
n
):
assert
n
>
0
self
.
movecells
(
0
,
y
,
sys
.
max
int
,
sys
.
maxint
,
0
,
n
)
self
.
movecells
(
0
,
y
,
sys
.
max
size
,
sys
.
maxsize
,
0
,
n
)
def
deleterows
(
self
,
y1
,
y2
):
if
y1
>
y2
:
y1
,
y2
=
y2
,
y1
self
.
clearrows
(
y1
,
y2
)
self
.
movecells
(
0
,
y2
+
1
,
sys
.
max
int
,
sys
.
maxint
,
0
,
y1
-
y2
-
1
)
self
.
movecells
(
0
,
y2
+
1
,
sys
.
max
size
,
sys
.
maxsize
,
0
,
y1
-
y2
-
1
)
def
insertcolumns
(
self
,
x
,
n
):
assert
n
>
0
self
.
movecells
(
x
,
0
,
sys
.
max
int
,
sys
.
maxint
,
n
,
0
)
self
.
movecells
(
x
,
0
,
sys
.
max
size
,
sys
.
maxsize
,
n
,
0
)
def
deletecolumns
(
self
,
x1
,
x2
):
if
x1
>
x2
:
x1
,
x2
=
x2
,
x1
self
.
clearcells
(
x1
,
x2
)
self
.
movecells
(
x2
+
1
,
0
,
sys
.
max
int
,
sys
.
maxint
,
x1
-
x2
-
1
,
0
)
self
.
movecells
(
x2
+
1
,
0
,
sys
.
max
size
,
sys
.
maxsize
,
x1
-
x2
-
1
,
0
)
def
getsize
(
self
):
maxx
=
maxy
=
0
...
...
@@ -626,29 +626,29 @@ class SheetGUI:
def
selectall
(
self
,
event
):
self
.
setcurrent
(
1
,
1
)
self
.
setcorner
(
sys
.
max
int
,
sys
.
maxint
)
self
.
setcorner
(
sys
.
max
size
,
sys
.
maxsize
)
def
selectcolumn
(
self
,
event
):
x
,
y
=
self
.
whichxy
(
event
)
self
.
setcurrent
(
x
,
1
)
self
.
setcorner
(
x
,
sys
.
max
int
)
self
.
setcorner
(
x
,
sys
.
max
size
)
def
extendcolumn
(
self
,
event
):
x
,
y
=
self
.
whichxy
(
event
)
if
x
>
0
:
self
.
setcurrent
(
self
.
currentxy
[
0
],
1
)
self
.
setcorner
(
x
,
sys
.
max
int
)
self
.
setcorner
(
x
,
sys
.
max
size
)
def
selectrow
(
self
,
event
):
x
,
y
=
self
.
whichxy
(
event
)
self
.
setcurrent
(
1
,
y
)
self
.
setcorner
(
sys
.
max
int
,
y
)
self
.
setcorner
(
sys
.
max
size
,
y
)
def
extendrow
(
self
,
event
):
x
,
y
=
self
.
whichxy
(
event
)
if
y
>
0
:
self
.
setcurrent
(
1
,
self
.
currentxy
[
1
])
self
.
setcorner
(
sys
.
max
int
,
y
)
self
.
setcorner
(
sys
.
max
size
,
y
)
def
press
(
self
,
event
):
x
,
y
=
self
.
whichxy
(
event
)
...
...
@@ -709,14 +709,14 @@ class SheetGUI:
self
.
setbeacon
(
x1
,
y1
,
x2
,
y2
)
def
setbeacon
(
self
,
x1
,
y1
,
x2
,
y2
):
if
x1
==
y1
==
1
and
x2
==
y2
==
sys
.
max
int
:
if
x1
==
y1
==
1
and
x2
==
y2
==
sys
.
max
size
:
name
=
":"
elif
(
x1
,
x2
)
==
(
1
,
sys
.
max
int
):
elif
(
x1
,
x2
)
==
(
1
,
sys
.
max
size
):
if
y1
==
y2
:
name
=
"%d"
%
y1
else
:
name
=
"%d:%d"
%
(
y1
,
y2
)
elif
(
y1
,
y2
)
==
(
1
,
sys
.
max
int
):
elif
(
y1
,
y2
)
==
(
1
,
sys
.
max
size
):
if
x1
==
x2
:
name
=
"%s"
%
colnum2name
(
x1
)
else
:
...
...
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