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
289d9d42
Commit
289d9d42
authored
Jun 26, 2000
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add wrapper for initscr() to copy the ACS_ and LINES,COLS bindings
parent
99a5621f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
Lib/curses/__init__.py
Lib/curses/__init__.py
+16
-0
No files found.
Lib/curses/__init__.py
View file @
289d9d42
...
...
@@ -15,4 +15,20 @@ __revision__ = "$Id$"
from
_curses
import
*
from
curses.wrapper
import
wrapper
# Some constants, most notably the ACS_* ones, are only added to the C
# _curses module's dictionary after initscr() is called. (Some
# versions of SGI's curses don't define values for those constants
# until initscr() has been called.) This wrapper function calls the
# underlying C initscr(), and then copies the constants from the
# _curses module to the curses package's dictionary. Don't do 'from
# curses import *' if you'll be needing the ACS_* constants.
def
initscr
():
import
_curses
,
curses
stdscr
=
_curses
.
initscr
()
for
key
,
value
in
_curses
.
__dict__
.
items
():
if
key
[
0
:
4
]
==
'ACS_'
or
key
in
(
'LINES'
,
'COLS'
):
setattr
(
curses
,
key
,
value
)
return
stdscr
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