-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_cursesmodule.c callable update_lines_cols() #48504
Comments
curses.update_lines.cols() are normally usable within c programs. With |
Your function PyCurses_update_lines_cols() has no documentation. Can Can you also give an use case of update_lines_cols()? The function is |
Hi Victor, i use this to get updated versions of curses.COLS and curses.LINES in 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 It's my first day here on the issue tracker. |
I didn't know this event. Is a key in a special keyboard? Or an event raised
Your documentation is incomplete. You may reused this comment: /* Internal helper used for updating curses.LINES, curses.COLS,
Oh I just realized that _curses functions have no documentation, great :-/
Welcome on the tracker ;-) |
Welcome on the tracker ;-) Any questions? :) |
No documentation? Doc/library/curses.rst exists; there's also |
BTW, the code portion of the patch looks OK to me. |
msg82783 states code portion of patch looks ok, what do we need to take this forward? |
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. |
Thanks for the patch update. The doc addition needs a .. versionadded directive, and there should be an entry in the 3.5 whatsnew document. |
Fixed David's comments |
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. |
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: |
Adding a test that only calls the function. |
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.) |
New changeset 132b5376bf34 by Steve Dower in branch 'default': |
Arnon has signed the CLA at PyCon, it just hasn't been processed yet. |
Looks to like there is nothing left to do here, so I'm closing it. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: