Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cffi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
cffi
Commits
9793a0cbb33d
Commit
9793a0cbb33d
authored
12 years ago
by
Jeremy Thurgood
Browse files
Options
Downloads
Patches
Plain Diff
Implement enough extra bits to make pypy REPL and Twisted trial happy.
parent
46d7c3ff4031
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
demo/_curses.py
+42
-1
42 additions, 1 deletion
demo/_curses.py
with
42 additions
and
1 deletion
demo/_curses.py
+
42
−
1
View file @
9793a0cb
...
...
@@ -22,6 +22,11 @@
int setupterm(char *term, int fildes, int *errret);
int tigetflag(char *);
int tigetnum(char *);
char *tigetstr(char *);
char *tparm (char *, ...);
int cbreak(void);
int nocbreak(void);
int echo(void);
...
...
@@ -205,4 +210,5 @@
initscr
=
Window
_setupterm_called
=
False
...
...
@@ -208,5 +214,13 @@
def
setupterm
(
term
=
ffi
.
NULL
,
fd
=-
1
):
def
_ensure_setupterm_called
():
if
not
_setupterm_called
:
raise
error
(
"
must call (at least) setupterm() first
"
)
def
setupterm
(
term
=
None
,
fd
=-
1
):
if
term
is
None
:
term
=
ffi
.
NULL
if
fd
<
0
:
import
sys
fd
=
sys
.
stdout
.
fileno
()
...
...
@@ -219,6 +233,33 @@
else
:
s
=
"
setupterm: unknown error %d
"
%
err
[
0
]
raise
error
(
s
)
global
_setupterm_called
_setupterm_called
=
True
def
tigetflag
(
capname
):
_ensure_setupterm_called
()
return
lib
.
tigetflag
(
capname
)
def
tigetnum
(
capname
):
_ensure_setupterm_called
()
return
lib
.
tigetnum
(
capname
)
def
tigetstr
(
capname
):
_ensure_setupterm_called
()
out
=
lib
.
tigetstr
(
capname
)
if
out
==
ffi
.
NULL
:
return
None
return
ffi
.
string
(
out
)
def
tparm
(
name
,
*
args
):
_ensure_setupterm_called
()
cargs
=
[
ffi
.
cast
(
"
long
"
,
arg
)
for
arg
in
args
]
return
ffi
.
string
(
lib
.
tparm
(
name
,
*
cargs
))
def
color_pair
(
n
):
return
n
<<
8
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment