msg75464 - (view) |
Author: Roland Brickl (nemesis) |
Date: 2008-11-03 15:02 |
curses.update_lines.cols() are normally usable within c programs. With
this change, it can now be used too. It only calls the preexisting
function that where only used internally. The cast in the return
statement are possibly false? But it works.
Because this aren't a big change, it would apply to some more
python-versions.
|
msg75468 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2008-11-03 16:18 |
Your function PyCurses_update_lines_cols() has no documentation. Can
you add it?
Can you also give an use case of update_lines_cols()? The function is
already called by curses.resizeterm() and curses.resize_term().
|
msg75470 - (view) |
Author: Roland Brickl (nemesis) |
Date: 2008-11-03 16:36 |
Hi Victor,
i use this to get updated versions of curses.COLS and curses.LINES in
the fact of an curses.KEY_RESIZE event.
So i can use curses within python even without to have panels.
It seems that curses.panel are the prefered way to deal with terminal
resizes.
The curses.resize[_]term() are only to change the terminal manualy.
What i also found in PyTone is more or less this functionality from
update_lines_cols():
def getmaxyx(self):
# taken from http://dag.wieers.com/home-made/dstat/
try:
h, w = int(os.environ["LINES"]), int(os.environ["COLUMNS"])
except KeyError:
try:
h, w = curses.tigetnum('lines'), curses.tigetnum('cols')
except:
try:
s = struct.pack('HHHH', 0, 0, 0, 0)
x = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ,
s)
h, w = struct.unpack('HHHH', x)[:2]
except:
h, w = 25, 80
And please excuse me for the missing documentation. English aren't my
native language so i would document it like:
Updates curses.LINES and curses.COLS :)
It's my first day here on the issue tracker.
|
msg75472 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2008-11-03 16:53 |
> i use this to get updated versions of curses.COLS and curses.LINES in
> the fact of an curses.KEY_RESIZE event.
I didn't know this event. Is a key in a special keyboard? Or an event raised
by some curses internals?
> Updates curses.LINES and curses.COLS
Your documentation is incomplete. You may reused this comment:
/* Internal helper used for updating curses.LINES, curses.COLS,
* _curses.LINES and _curses.COLS */
Oh I just realized that _curses functions have no documentation, great :-/
> It's my first day here on the issue tracker.
Welcome on the tracker ;-)
|
msg75473 - (view) |
Author: Roland Brickl (nemesis) |
Date: 2008-11-03 17:01 |
>> i use this to get updated versions of curses.COLS and curses.LINES in
>> the fact of an curses.KEY_RESIZE event.
>I didn't know this event. Is a key in a special keyboard? Or an event
>raised
>by some curses internals?
Internal curses event.
>Oh I just realized that _curses functions have no documentation,
>great :-/
Thats why python_curses should be more compatible to the existing
c_curses documentations.
>> It's my first day here on the issue tracker.
Welcome on the tracker ;-)
Thanks.
Any questions? :)
|
msg82782 - (view) |
Author: A.M. Kuchling (akuchling) *  |
Date: 2009-02-26 22:31 |
No documentation? Doc/library/curses.rst exists; there's also
Doc/howto/curses.rst. What functions in _curses need to be documented?
|
msg82783 - (view) |
Author: A.M. Kuchling (akuchling) *  |
Date: 2009-02-26 22:35 |
BTW, the code portion of the patch looks OK to me.
|
msg110695 - (view) |
Author: Mark Lawrence (BreamoreBoy) * |
Date: 2010-07-18 21:59 |
msg82783 states code portion of patch looks ok, what do we need to take this forward?
|
msg240793 - (view) |
Author: Arnon Yaari (wiggin15) * |
Date: 2015-04-13 22:42 |
Creating an automatic test for this issue proves difficult, as using curses to resize the terminal already updates the values, and using ioctls to try to bypass curses, doesn't work.
I'm adding a manual test program (mostly taken from http://www.gossamer-threads.com/lists/python/python/226137), and a newer patch with documentation.
|
msg241048 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2015-04-14 22:30 |
Thanks for the patch update.
The doc addition needs a .. versionadded directive, and there should be an entry in the 3.5 whatsnew document.
|
msg241108 - (view) |
Author: Arnon Yaari (wiggin15) * |
Date: 2015-04-15 14:43 |
Fixed David's comments
|
msg241115 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2015-04-15 15:26 |
Thanks for updating.
In the doc change you say it updates environment variables, but in the whatsnew change you say it changes constants of the curses module. I believe the whats new version is correct? Also, doc lines should be wrapped to 80 columns.
Please omit the NEWS item from the patch...with our current system putting NEWS items in patches just makes the patches get stale really quickly. The committer will add the NEWS item.
|
msg241132 - (view) |
Author: Arnon Yaari (wiggin15) * |
Date: 2015-04-15 16:56 |
I'm adding patch without the update to Misc/NEWS.
I'm not sure why, but the curses doc refers to LINES and COLS as "environment variables". In the doc change I referred to them as just "variables" and used the notation that works for linking to them, using :envvar:
|
msg241142 - (view) |
Author: Arnon Yaari (wiggin15) * |
Date: 2015-04-15 18:58 |
Adding a test that only calls the function.
|
msg241164 - (view) |
Author: Steve Dower (steve.dower) *  |
Date: 2015-04-15 21:16 |
Arnon - we'll need you to fill out https://www.python.org/psf/contrib/contrib-form/ before we can merge this patch in. (The dev guide isn't clear on whether trivial patches are okay, but the advice I was given is that we should have a CLA for everything.)
|
msg241170 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2015-04-15 22:07 |
New changeset 132b5376bf34 by Steve Dower in branch 'default':
Issue #4254: Adds _curses.update_lines_cols() Patch by Arnon Yaari
https://hg.python.org/cpython/rev/132b5376bf34
|
msg241171 - (view) |
Author: Steve Dower (steve.dower) *  |
Date: 2015-04-15 22:07 |
Arnon has signed the CLA at PyCon, it just hasn't been processed yet.
|
msg243441 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2015-05-18 00:51 |
Looks to like there is nothing left to do here, so I'm closing it.
|
|
Date |
User |
Action |
Args |
2022-04-11 14:56:40 | admin | set | github: 48504 |
2015-05-18 00:51:18 | r.david.murray | set | status: open -> closed resolution: fixed messages:
+ msg243441
stage: commit review -> resolved |
2015-04-15 22:07:40 | steve.dower | set | messages:
+ msg241171 stage: patch review -> commit review |
2015-04-15 22:07:01 | python-dev | set | nosy:
+ python-dev messages:
+ msg241170
|
2015-04-15 21:16:57 | steve.dower | set | nosy:
+ steve.dower messages:
+ msg241164
|
2015-04-15 18:58:04 | wiggin15 | set | files:
+ issue4254-2.diff
messages:
+ msg241142 |
2015-04-15 16:56:45 | wiggin15 | set | files:
+ issue4254-1.diff
messages:
+ msg241132 |
2015-04-15 15:26:30 | r.david.murray | set | messages:
+ msg241115 |
2015-04-15 14:43:31 | wiggin15 | set | files:
+ issue4254.diff
messages:
+ msg241108 versions:
+ Python 3.5, - Python 3.2 |
2015-04-15 14:43:12 | wiggin15 | set | files:
- patch_4254.diff |
2015-04-14 22:30:55 | r.david.murray | set | nosy:
+ r.david.murray messages:
+ msg241048
|
2015-04-13 23:45:04 | ned.deily | set | nosy:
+ twouters
|
2015-04-13 22:43:41 | wiggin15 | set | files:
+ patch_4254.diff |
2015-04-13 22:42:42 | wiggin15 | set | files:
+ manual_test_4254.py |
2015-04-13 22:42:32 | wiggin15 | set | nosy:
+ wiggin15 messages:
+ msg240793
|
2014-12-31 16:24:38 | akuchling | set | nosy:
- akuchling
|
2014-02-03 19:40:29 | BreamoreBoy | set | nosy:
- BreamoreBoy
|
2010-11-12 20:58:34 | akuchling | set | assignee: akuchling -> |
2010-07-18 21:59:54 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages:
+ msg110695
|
2010-07-09 04:42:01 | terry.reedy | set | stage: patch review versions:
+ Python 3.2, - Python 2.5 |
2010-02-22 22:29:09 | akuchling | set | assignee: akuchling |
2009-06-08 22:50:25 | vstinner | set | nosy:
- vstinner
|
2009-02-26 22:35:16 | akuchling | set | messages:
+ msg82783 |
2009-02-26 22:31:48 | akuchling | set | nosy:
+ akuchling messages:
+ msg82782 |
2008-11-03 17:01:35 | nemesis | set | messages:
+ msg75473 |
2008-11-03 16:53:15 | vstinner | set | messages:
+ msg75472 |
2008-11-03 16:36:05 | nemesis | set | messages:
+ msg75470 |
2008-11-03 16:18:09 | vstinner | set | nosy:
+ vstinner messages:
+ msg75468 |
2008-11-03 15:02:08 | nemesis | create | |