Lines Matching refs:curses

27 curses = import_module('curses')  variable
31 import curses.panel
36 return unittest.skipUnless(hasattr(curses, name),
60 curses.setupterm(fd=fd)
74 self.stdscr = curses.initscr()
75 curses.savetty()
78 curses.resetty()
79 curses.endwin()
85 win = curses.newwin(10,10)
86 win = curses.newwin(5,5, 5,5)
87 win2 = curses.newwin(15,15, 5,5)
90 for args in [('a',), ('a', curses.A_BOLD),
91 (4,4, 'a'), (5,5, 'a', curses.A_BOLD)]:
108 stdscr.addnstr('1234', 3, curses.A_BOLD)
110 stdscr.addnstr(5,5, '1234', 3, curses.A_BOLD)
112 stdscr.attron(curses.A_BOLD)
113 stdscr.attroff(curses.A_BOLD)
114 stdscr.attrset(curses.A_BOLD)
116 stdscr.bkgd(' ', curses.A_REVERSE)
118 stdscr.bkgdset(' ', curses.A_REVERSE)
143 stdscr.echochar('a', curses.A_BOLD)
145 stdscr.hline('-', 5, curses.A_BOLD)
147 stdscr.hline(1,1,'-', 5, curses.A_BOLD)
157 stdscr.insnstr('abc', 3, curses.A_BOLD)
159 stdscr.insnstr(5, 5, 'abc', 3, curses.A_BOLD)
162 stdscr.insstr('def', curses.A_BOLD)
164 stdscr.insstr(5, 5, 'def', curses.A_BOLD)
193 stdscr.vline('a', 3, curses.A_STANDOUT)
195 stdscr.chgat(5, 2, 3, curses.A_BLINK)
196 stdscr.chgat(3, curses.A_BOLD)
197 stdscr.chgat(5, 8, curses.A_UNDERLINE)
198 stdscr.chgat(curses.A_BLINK)
202 stdscr.vline(1,1, 'a', 3, curses.A_STANDOUT)
226 for func in [curses.baudrate, curses.beep, curses.can_change_color,
227 curses.cbreak, curses.def_prog_mode, curses.doupdate,
228 curses.flash, curses.flushinp,
229 curses.has_colors, curses.has_ic, curses.has_il,
230 curses.isendwin, curses.killchar, curses.longname,
231 curses.nocbreak, curses.noecho, curses.nonl,
232 curses.noqiflush, curses.noraw,
233 curses.reset_prog_mode, curses.termattrs,
234 curses.termname, curses.erasechar]:
237 if hasattr(curses, 'filter'):
238 curses.filter()
239 if hasattr(curses, 'getsyx'):
240 curses.getsyx()
243 if curses.tigetstr("cnorm"):
244 curses.curs_set(1)
245 curses.delay_output(1)
246 curses.echo() ; curses.echo(1)
251 curses.getwin(f)
253 curses.halfdelay(1)
254 curses.intrflush(1)
255 curses.meta(1)
256 curses.napms(100)
257 curses.newpad(50,50)
258 win = curses.newwin(5,5)
259 win = curses.newwin(5,5, 1,1)
260 curses.nl() ; curses.nl(1)
261 curses.putp(b'abc')
262 curses.qiflush()
263 curses.raw() ; curses.raw(1)
264 curses.set_escdelay(25)
265 self.assertEqual(curses.get_escdelay(), 25)
266 curses.set_tabsize(4)
267 self.assertEqual(curses.get_tabsize(), 4)
268 if hasattr(curses, 'setsyx'):
269 curses.setsyx(5,5)
270 curses.tigetflag('hc')
271 curses.tigetnum('co')
272 curses.tigetstr('cr')
273 curses.tparm(b'cr')
274 if hasattr(curses, 'typeahead'):
275 curses.typeahead(sys.__stdin__.fileno())
276 curses.unctrl('a')
277 curses.ungetch('a')
278 if hasattr(curses, 'use_env'):
279 curses.use_env(1)
283 if not curses.has_colors():
285 curses.start_color()
286 curses.init_pair(2, 1,1)
287 curses.color_content(1)
288 curses.color_pair(2)
289 curses.pair_content(curses.COLOR_PAIRS - 1)
290 curses.pair_number(0)
292 if hasattr(curses, 'use_default_colors'):
293 curses.use_default_colors()
297 curses.keyname(13)
301 curses.has_key(13)
305 (availmask, oldmask) = curses.mousemask(curses.BUTTON1_PRESSED)
308 curses.mouseinterval(10)
310 curses.ungetmouse(0, 0, 0, 0, curses.BUTTON1_PRESSED)
311 m = curses.getmouse()
315 w = curses.newwin(10, 10)
316 p = curses.panel.new_panel(w)
318 with self.assertRaises(curses.panel.error,
324 w = curses.newwin(10, 10)
325 p = curses.panel.new_panel(w)
337 w = curses.newwin(10, 10)
338 panel = curses.panel.new_panel(w)
347 w = curses.newwin(10, 10)
348 panel = curses.panel.new_panel(w)
353 curses.is_term_resized(*self.stdscr.getmaxyx())
357 curses.resize_term(*self.stdscr.getmaxyx())
362 lines, cols = curses.LINES, curses.COLS
365 curses.resizeterm(new_lines, new_cols)
367 self.assertEqual(curses.LINES, new_lines)
368 self.assertEqual(curses.COLS, new_cols)
371 curses.ungetch(1025)
375 @unittest.skipIf(getattr(curses, 'ncurses_version', (99,)) < (5, 8),
386 curses.unget_wch(ch)
394 curses.unget_wch(code)
399 b = curses.tparm(curses.tigetstr("cup"), 5, 3)
445 box = curses.textpad.Textbox(stdscr, insert_mode=True)
460 curses.update_lines_cols()
464 v = curses.ncurses_version
483 for name in curses.ascii.controlnames:
484 self.assertTrue(hasattr(curses.ascii, name), name)
495 check(curses.ascii.isalnum, b.isalnum())
496 check(curses.ascii.isalpha, b.isalpha())
497 check(curses.ascii.isdigit, b.isdigit())
498 check(curses.ascii.islower, b.islower())
499 check(curses.ascii.isspace, b.isspace())
500 check(curses.ascii.isupper, b.isupper())
502 check(curses.ascii.isascii, i < 128)
503 check(curses.ascii.ismeta, i >= 128)
504 check(curses.ascii.isctrl, i < 32)
505 check(curses.ascii.iscntrl, i < 32 or i == 127)
506 check(curses.ascii.isblank, c in ' \t')
507 check(curses.ascii.isgraph, 32 < i <= 126)
508 check(curses.ascii.isprint, 32 <= i <= 126)
509 check(curses.ascii.ispunct, c in string.punctuation)
510 check(curses.ascii.isxdigit, c in string.hexdigits)
513 self.assertFalse(curses.ascii.isalnum(i))
514 self.assertFalse(curses.ascii.isalpha(i))
515 self.assertFalse(curses.ascii.isdigit(i))
516 self.assertFalse(curses.ascii.islower(i))
517 self.assertFalse(curses.ascii.isspace(i))
518 self.assertFalse(curses.ascii.isupper(i))
520 self.assertFalse(curses.ascii.isascii(i))
521 self.assertFalse(curses.ascii.isctrl(i))
522 self.assertFalse(curses.ascii.iscntrl(i))
523 self.assertFalse(curses.ascii.isblank(i))
524 self.assertFalse(curses.ascii.isgraph(i))
525 self.assertFalse(curses.ascii.isprint(i))
526 self.assertFalse(curses.ascii.ispunct(i))
527 self.assertFalse(curses.ascii.isxdigit(i))
529 self.assertFalse(curses.ascii.ismeta(-1))
532 ascii = curses.ascii.ascii
538 ctrl = curses.ascii.ctrl
545 alt = curses.ascii.alt
551 unctrl = curses.ascii.unctrl