basedpyright 1.12.6 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pyright-langserver.js +1 -1
- package/dist/pyright-langserver.js.map +1 -1
- package/dist/pyright.js +1 -1
- package/dist/pyright.js.map +1 -1
- package/dist/typeshed-fallback/stdlib/_ast.pyi +279 -42
- package/dist/typeshed-fallback/stdlib/_bisect.pyi +149 -12
- package/dist/typeshed-fallback/stdlib/_codecs.pyi +125 -14
- package/dist/typeshed-fallback/stdlib/_csv.pyi +130 -7
- package/dist/typeshed-fallback/stdlib/_ctypes.pyi +72 -17
- package/dist/typeshed-fallback/stdlib/_curses.pyi +626 -78
- package/dist/typeshed-fallback/stdlib/_decimal.pyi +775 -153
- package/dist/typeshed-fallback/stdlib/_heapq.pyi +61 -5
- package/dist/typeshed-fallback/stdlib/_imp.pyi +70 -15
- package/dist/typeshed-fallback/stdlib/_json.pyi +55 -12
- package/dist/typeshed-fallback/stdlib/_locale.pyi +63 -12
- package/dist/typeshed-fallback/stdlib/_lsprof.pyi +61 -4
- package/dist/typeshed-fallback/stdlib/_operator.pyi +238 -62
- package/dist/typeshed-fallback/stdlib/_posixsubprocess.pyi +25 -1
- package/dist/typeshed-fallback/stdlib/_random.pyi +23 -5
- package/dist/typeshed-fallback/stdlib/_socket.pyi +618 -63
- package/dist/typeshed-fallback/stdlib/_stat.pyi +140 -13
- package/dist/typeshed-fallback/stdlib/_thread.pyi +215 -22
- package/dist/typeshed-fallback/stdlib/_tkinter.pyi +44 -11
- package/dist/typeshed-fallback/stdlib/_tracemalloc.pyi +71 -10
- package/dist/typeshed-fallback/stdlib/_warnings.pyi +53 -6
- package/dist/typeshed-fallback/stdlib/_weakref.pyi +43 -10
- package/dist/typeshed-fallback/stdlib/_winapi.pyi +255 -255
- package/dist/typeshed-fallback/stdlib/array.pyi +233 -44
- package/dist/typeshed-fallback/stdlib/atexit.pyi +50 -5
- package/dist/typeshed-fallback/stdlib/audioop.pyi +78 -26
- package/dist/typeshed-fallback/stdlib/binascii.pyi +105 -18
- package/dist/typeshed-fallback/stdlib/builtins.pyi +5254 -829
- package/dist/typeshed-fallback/stdlib/cmath.pyi +99 -23
- package/dist/typeshed-fallback/stdlib/errno.pyi +15 -0
- package/dist/typeshed-fallback/stdlib/faulthandler.pyi +33 -8
- package/dist/typeshed-fallback/stdlib/fcntl.pyi +199 -8
- package/dist/typeshed-fallback/stdlib/gc.pyi +130 -18
- package/dist/typeshed-fallback/stdlib/grp.pyi +58 -7
- package/dist/typeshed-fallback/stdlib/itertools.pyi +281 -42
- package/dist/typeshed-fallback/stdlib/marshal.pyi +82 -4
- package/dist/typeshed-fallback/stdlib/math.pyi +357 -61
- package/dist/typeshed-fallback/stdlib/mmap.pyi +47 -8
- package/dist/typeshed-fallback/stdlib/msvcrt.pyi +32 -32
- package/dist/typeshed-fallback/stdlib/nt.pyi +118 -111
- package/dist/typeshed-fallback/stdlib/parser.pyi +55 -24
- package/dist/typeshed-fallback/stdlib/posix.pyi +7 -0
- package/dist/typeshed-fallback/stdlib/pwd.pyi +60 -10
- package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +61 -12
- package/dist/typeshed-fallback/stdlib/readline.pyi +184 -27
- package/dist/typeshed-fallback/stdlib/resource.pyi +56 -16
- package/dist/typeshed-fallback/stdlib/select.pyi +97 -5
- package/dist/typeshed-fallback/stdlib/spwd.pyi +60 -11
- package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +386 -48
- package/dist/typeshed-fallback/stdlib/syslog.pyi +27 -7
- package/dist/typeshed-fallback/stdlib/termios.pyi +88 -8
- package/dist/typeshed-fallback/stdlib/time.pyi +314 -37
- package/dist/typeshed-fallback/stdlib/unicodedata.pyi +264 -34
- package/dist/typeshed-fallback/stdlib/winreg.pyi +172 -132
- package/dist/typeshed-fallback/stdlib/zlib.pyi +108 -7
- package/package.json +1 -1
|
@@ -275,85 +275,580 @@ REPORT_MOUSE_POSITION: int
|
|
|
275
275
|
_C_API: Any
|
|
276
276
|
version: bytes
|
|
277
277
|
|
|
278
|
-
def baudrate() -> int:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
def
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
def
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
def
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
278
|
+
def baudrate() -> int:
|
|
279
|
+
"""Return the output speed of the terminal in bits per second."""
|
|
280
|
+
...
|
|
281
|
+
def beep() -> None:
|
|
282
|
+
"""Emit a short attention sound."""
|
|
283
|
+
...
|
|
284
|
+
def can_change_color() -> bool:
|
|
285
|
+
"""Return True if the programmer can change the colors displayed by the terminal."""
|
|
286
|
+
...
|
|
287
|
+
def cbreak(flag: bool = True, /) -> None:
|
|
288
|
+
"""
|
|
289
|
+
Enter cbreak mode.
|
|
290
|
+
|
|
291
|
+
flag
|
|
292
|
+
If false, the effect is the same as calling nocbreak().
|
|
293
|
+
|
|
294
|
+
In cbreak mode (sometimes called "rare" mode) normal tty line buffering is
|
|
295
|
+
turned off and characters are available to be read one by one. However,
|
|
296
|
+
unlike raw mode, special characters (interrupt, quit, suspend, and flow
|
|
297
|
+
control) retain their effects on the tty driver and calling program.
|
|
298
|
+
Calling first raw() then cbreak() leaves the terminal in cbreak mode.
|
|
299
|
+
"""
|
|
300
|
+
...
|
|
301
|
+
def color_content(color_number: int, /) -> tuple[int, int, int]:
|
|
302
|
+
"""
|
|
303
|
+
Return the red, green, and blue (RGB) components of the specified color.
|
|
304
|
+
|
|
305
|
+
color_number
|
|
306
|
+
The number of the color (0 - (COLORS-1)).
|
|
307
|
+
|
|
308
|
+
A 3-tuple is returned, containing the R, G, B values for the given color,
|
|
309
|
+
which will be between 0 (no component) and 1000 (maximum amount of component).
|
|
310
|
+
"""
|
|
311
|
+
...
|
|
312
|
+
def color_pair(pair_number: int, /) -> int:
|
|
313
|
+
"""
|
|
314
|
+
Return the attribute value for displaying text in the specified color.
|
|
315
|
+
|
|
316
|
+
pair_number
|
|
317
|
+
The number of the color pair.
|
|
318
|
+
|
|
319
|
+
This attribute value can be combined with A_STANDOUT, A_REVERSE, and the
|
|
320
|
+
other A_* attributes. pair_number() is the counterpart to this function.
|
|
321
|
+
"""
|
|
322
|
+
...
|
|
323
|
+
def curs_set(visibility: int, /) -> int:
|
|
324
|
+
"""
|
|
325
|
+
Set the cursor state.
|
|
326
|
+
|
|
327
|
+
visibility
|
|
328
|
+
0 for invisible, 1 for normal visible, or 2 for very visible.
|
|
329
|
+
|
|
330
|
+
If the terminal supports the visibility requested, the previous cursor
|
|
331
|
+
state is returned; otherwise, an exception is raised. On many terminals,
|
|
332
|
+
the "visible" mode is an underline cursor and the "very visible" mode is
|
|
333
|
+
a block cursor.
|
|
334
|
+
"""
|
|
335
|
+
...
|
|
336
|
+
def def_prog_mode() -> None:
|
|
337
|
+
"""
|
|
338
|
+
Save the current terminal mode as the "program" mode.
|
|
339
|
+
|
|
340
|
+
The "program" mode is the mode when the running program is using curses.
|
|
341
|
+
|
|
342
|
+
Subsequent calls to reset_prog_mode() will restore this mode.
|
|
343
|
+
"""
|
|
344
|
+
...
|
|
345
|
+
def def_shell_mode() -> None:
|
|
346
|
+
"""
|
|
347
|
+
Save the current terminal mode as the "shell" mode.
|
|
348
|
+
|
|
349
|
+
The "shell" mode is the mode when the running program is not using curses.
|
|
350
|
+
|
|
351
|
+
Subsequent calls to reset_shell_mode() will restore this mode.
|
|
352
|
+
"""
|
|
353
|
+
...
|
|
354
|
+
def delay_output(ms: int, /) -> None:
|
|
355
|
+
"""
|
|
356
|
+
Insert a pause in output.
|
|
357
|
+
|
|
358
|
+
ms
|
|
359
|
+
Duration in milliseconds.
|
|
360
|
+
"""
|
|
361
|
+
...
|
|
362
|
+
def doupdate() -> None:
|
|
363
|
+
"""Update the physical screen to match the virtual screen."""
|
|
364
|
+
...
|
|
365
|
+
def echo(flag: bool = True, /) -> None:
|
|
366
|
+
"""
|
|
367
|
+
Enter echo mode.
|
|
368
|
+
|
|
369
|
+
flag
|
|
370
|
+
If false, the effect is the same as calling noecho().
|
|
371
|
+
|
|
372
|
+
In echo mode, each character input is echoed to the screen as it is entered.
|
|
373
|
+
"""
|
|
374
|
+
...
|
|
375
|
+
def endwin() -> None:
|
|
376
|
+
"""De-initialize the library, and return terminal to normal status."""
|
|
377
|
+
...
|
|
378
|
+
def erasechar() -> bytes:
|
|
379
|
+
"""Return the user's current erase character."""
|
|
380
|
+
...
|
|
292
381
|
def filter() -> None: ...
|
|
293
|
-
def flash() -> None:
|
|
294
|
-
|
|
382
|
+
def flash() -> None:
|
|
383
|
+
"""
|
|
384
|
+
Flash the screen.
|
|
385
|
+
|
|
386
|
+
That is, change it to reverse-video and then change it back in a short interval.
|
|
387
|
+
"""
|
|
388
|
+
...
|
|
389
|
+
def flushinp() -> None:
|
|
390
|
+
"""
|
|
391
|
+
Flush all input buffers.
|
|
392
|
+
|
|
393
|
+
This throws away any typeahead that has been typed by the user and has not
|
|
394
|
+
yet been processed by the program.
|
|
395
|
+
"""
|
|
396
|
+
...
|
|
295
397
|
|
|
296
398
|
if sys.version_info >= (3, 9):
|
|
297
|
-
def get_escdelay() -> int:
|
|
298
|
-
|
|
399
|
+
def get_escdelay() -> int:
|
|
400
|
+
"""
|
|
401
|
+
Gets the curses ESCDELAY setting.
|
|
402
|
+
|
|
403
|
+
Gets the number of milliseconds to wait after reading an escape character,
|
|
404
|
+
to distinguish between an individual escape character entered on the
|
|
405
|
+
keyboard from escape sequences sent by cursor and function keys.
|
|
406
|
+
"""
|
|
407
|
+
...
|
|
408
|
+
def get_tabsize() -> int:
|
|
409
|
+
"""
|
|
410
|
+
Gets the curses TABSIZE setting.
|
|
411
|
+
|
|
412
|
+
Gets the number of columns used by the curses library when converting a tab
|
|
413
|
+
character to spaces as it adds the tab to a window.
|
|
414
|
+
"""
|
|
415
|
+
...
|
|
416
|
+
|
|
417
|
+
def getmouse() -> tuple[int, int, int, int, int]:
|
|
418
|
+
"""
|
|
419
|
+
Retrieve the queued mouse event.
|
|
420
|
+
|
|
421
|
+
After getch() returns KEY_MOUSE to signal a mouse event, this function
|
|
422
|
+
returns a 5-tuple (id, x, y, z, bstate).
|
|
423
|
+
"""
|
|
424
|
+
...
|
|
425
|
+
def getsyx() -> tuple[int, int]:
|
|
426
|
+
"""
|
|
427
|
+
Return the current coordinates of the virtual screen cursor.
|
|
428
|
+
|
|
429
|
+
Return a (y, x) tuple. If leaveok is currently true, return (-1, -1).
|
|
430
|
+
"""
|
|
431
|
+
...
|
|
432
|
+
def getwin(file: SupportsRead[bytes], /) -> _CursesWindow:
|
|
433
|
+
"""
|
|
434
|
+
Read window related data stored in the file by an earlier putwin() call.
|
|
299
435
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
def
|
|
436
|
+
The routine then creates and initializes a new window using that data,
|
|
437
|
+
returning the new window object.
|
|
438
|
+
"""
|
|
439
|
+
...
|
|
440
|
+
def halfdelay(tenths: int, /) -> None:
|
|
441
|
+
"""
|
|
442
|
+
Enter half-delay mode.
|
|
443
|
+
|
|
444
|
+
tenths
|
|
445
|
+
Maximal blocking delay in tenths of seconds (1 - 255).
|
|
446
|
+
|
|
447
|
+
Use nocbreak() to leave half-delay mode.
|
|
448
|
+
"""
|
|
449
|
+
...
|
|
450
|
+
def has_colors() -> bool:
|
|
451
|
+
"""Return True if the terminal can display colors; otherwise, return False."""
|
|
452
|
+
...
|
|
305
453
|
|
|
306
454
|
if sys.version_info >= (3, 10):
|
|
307
|
-
def has_extended_color_support() -> bool:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
455
|
+
def has_extended_color_support() -> bool:
|
|
456
|
+
"""
|
|
457
|
+
Return True if the module supports extended colors; otherwise, return False.
|
|
458
|
+
|
|
459
|
+
Extended color support allows more than 256 color-pairs for terminals
|
|
460
|
+
that support more than 16 colors (e.g. xterm-256color).
|
|
461
|
+
"""
|
|
462
|
+
...
|
|
463
|
+
|
|
464
|
+
def has_ic() -> bool:
|
|
465
|
+
"""Return True if the terminal has insert- and delete-character capabilities."""
|
|
466
|
+
...
|
|
467
|
+
def has_il() -> bool:
|
|
468
|
+
"""Return True if the terminal has insert- and delete-line capabilities."""
|
|
469
|
+
...
|
|
470
|
+
def has_key(key: int, /) -> bool:
|
|
471
|
+
"""
|
|
472
|
+
Return True if the current terminal type recognizes a key with that value.
|
|
473
|
+
|
|
474
|
+
key
|
|
475
|
+
Key number.
|
|
476
|
+
"""
|
|
477
|
+
...
|
|
478
|
+
def init_color(color_number: int, r: int, g: int, b: int, /) -> None:
|
|
479
|
+
"""
|
|
480
|
+
Change the definition of a color.
|
|
481
|
+
|
|
482
|
+
color_number
|
|
483
|
+
The number of the color to be changed (0 - (COLORS-1)).
|
|
484
|
+
r
|
|
485
|
+
Red component (0 - 1000).
|
|
486
|
+
g
|
|
487
|
+
Green component (0 - 1000).
|
|
488
|
+
b
|
|
489
|
+
Blue component (0 - 1000).
|
|
490
|
+
|
|
491
|
+
When init_color() is used, all occurrences of that color on the screen
|
|
492
|
+
immediately change to the new definition. This function is a no-op on
|
|
493
|
+
most terminals; it is active only if can_change_color() returns true.
|
|
494
|
+
"""
|
|
495
|
+
...
|
|
496
|
+
def init_pair(pair_number: int, fg: int, bg: int, /) -> None:
|
|
497
|
+
"""
|
|
498
|
+
Change the definition of a color-pair.
|
|
499
|
+
|
|
500
|
+
pair_number
|
|
501
|
+
The number of the color-pair to be changed (1 - (COLOR_PAIRS-1)).
|
|
502
|
+
fg
|
|
503
|
+
Foreground color number (-1 - (COLORS-1)).
|
|
504
|
+
bg
|
|
505
|
+
Background color number (-1 - (COLORS-1)).
|
|
506
|
+
|
|
507
|
+
If the color-pair was previously initialized, the screen is refreshed and
|
|
508
|
+
all occurrences of that color-pair are changed to the new definition.
|
|
509
|
+
"""
|
|
510
|
+
...
|
|
511
|
+
def initscr() -> _CursesWindow:
|
|
512
|
+
"""
|
|
513
|
+
Initialize the library.
|
|
514
|
+
|
|
515
|
+
Return a WindowObject which represents the whole screen.
|
|
516
|
+
"""
|
|
517
|
+
...
|
|
315
518
|
def intrflush(flag: bool, /) -> None: ...
|
|
316
|
-
def is_term_resized(nlines: int, ncols: int, /) -> bool:
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
def
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
def
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
def
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
def
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
519
|
+
def is_term_resized(nlines: int, ncols: int, /) -> bool:
|
|
520
|
+
"""
|
|
521
|
+
Return True if resize_term() would modify the window structure, False otherwise.
|
|
522
|
+
|
|
523
|
+
nlines
|
|
524
|
+
Height.
|
|
525
|
+
ncols
|
|
526
|
+
Width.
|
|
527
|
+
"""
|
|
528
|
+
...
|
|
529
|
+
def isendwin() -> bool:
|
|
530
|
+
"""Return True if endwin() has been called."""
|
|
531
|
+
...
|
|
532
|
+
def keyname(key: int, /) -> bytes:
|
|
533
|
+
"""
|
|
534
|
+
Return the name of specified key.
|
|
535
|
+
|
|
536
|
+
key
|
|
537
|
+
Key number.
|
|
538
|
+
"""
|
|
539
|
+
...
|
|
540
|
+
def killchar() -> bytes:
|
|
541
|
+
"""Return the user's current line kill character."""
|
|
542
|
+
...
|
|
543
|
+
def longname() -> bytes:
|
|
544
|
+
"""
|
|
545
|
+
Return the terminfo long name field describing the current terminal.
|
|
546
|
+
|
|
547
|
+
The maximum length of a verbose description is 128 characters. It is defined
|
|
548
|
+
only after the call to initscr().
|
|
549
|
+
"""
|
|
550
|
+
...
|
|
551
|
+
def meta(yes: bool, /) -> None:
|
|
552
|
+
"""
|
|
553
|
+
Enable/disable meta keys.
|
|
554
|
+
|
|
555
|
+
If yes is True, allow 8-bit characters to be input. If yes is False,
|
|
556
|
+
allow only 7-bit characters.
|
|
557
|
+
"""
|
|
558
|
+
...
|
|
559
|
+
def mouseinterval(interval: int, /) -> None:
|
|
560
|
+
"""
|
|
561
|
+
Set and retrieve the maximum time between press and release in a click.
|
|
562
|
+
|
|
563
|
+
interval
|
|
564
|
+
Time in milliseconds.
|
|
565
|
+
|
|
566
|
+
Set the maximum time that can elapse between press and release events in
|
|
567
|
+
order for them to be recognized as a click, and return the previous interval
|
|
568
|
+
value.
|
|
569
|
+
"""
|
|
570
|
+
...
|
|
571
|
+
def mousemask(newmask: int, /) -> tuple[int, int]:
|
|
572
|
+
"""
|
|
573
|
+
Set the mouse events to be reported, and return a tuple (availmask, oldmask).
|
|
574
|
+
|
|
575
|
+
Return a tuple (availmask, oldmask). availmask indicates which of the
|
|
576
|
+
specified mouse events can be reported; on complete failure it returns 0.
|
|
577
|
+
oldmask is the previous value of the given window's mouse event mask.
|
|
578
|
+
If this function is never called, no mouse events are ever reported.
|
|
579
|
+
"""
|
|
580
|
+
...
|
|
581
|
+
def napms(ms: int, /) -> int:
|
|
582
|
+
"""
|
|
583
|
+
Sleep for specified time.
|
|
584
|
+
|
|
585
|
+
ms
|
|
586
|
+
Duration in milliseconds.
|
|
587
|
+
"""
|
|
588
|
+
...
|
|
589
|
+
def newpad(nlines: int, ncols: int, /) -> _CursesWindow:
|
|
590
|
+
"""
|
|
591
|
+
Create and return a pointer to a new pad data structure.
|
|
592
|
+
|
|
593
|
+
nlines
|
|
594
|
+
Height.
|
|
595
|
+
ncols
|
|
596
|
+
Width.
|
|
597
|
+
"""
|
|
598
|
+
...
|
|
599
|
+
def newwin(nlines: int, ncols: int, begin_y: int = ..., begin_x: int = ..., /) -> _CursesWindow:
|
|
600
|
+
"""
|
|
601
|
+
newwin(nlines, ncols, [begin_y=0, begin_x=0])
|
|
602
|
+
Return a new window.
|
|
603
|
+
|
|
604
|
+
nlines
|
|
605
|
+
Height.
|
|
606
|
+
ncols
|
|
607
|
+
Width.
|
|
608
|
+
begin_y
|
|
609
|
+
Top side y-coordinate.
|
|
610
|
+
begin_x
|
|
611
|
+
Left side x-coordinate.
|
|
612
|
+
|
|
613
|
+
By default, the window will extend from the specified position to the lower
|
|
614
|
+
right corner of the screen.
|
|
615
|
+
"""
|
|
616
|
+
...
|
|
617
|
+
def nl(flag: bool = True, /) -> None:
|
|
618
|
+
"""
|
|
619
|
+
Enter newline mode.
|
|
620
|
+
|
|
621
|
+
flag
|
|
622
|
+
If false, the effect is the same as calling nonl().
|
|
623
|
+
|
|
624
|
+
This mode translates the return key into newline on input, and translates
|
|
625
|
+
newline into return and line-feed on output. Newline mode is initially on.
|
|
626
|
+
"""
|
|
627
|
+
...
|
|
628
|
+
def nocbreak() -> None:
|
|
629
|
+
"""
|
|
630
|
+
Leave cbreak mode.
|
|
631
|
+
|
|
632
|
+
Return to normal "cooked" mode with line buffering.
|
|
633
|
+
"""
|
|
634
|
+
...
|
|
635
|
+
def noecho() -> None:
|
|
636
|
+
"""
|
|
637
|
+
Leave echo mode.
|
|
638
|
+
|
|
639
|
+
Echoing of input characters is turned off.
|
|
640
|
+
"""
|
|
641
|
+
...
|
|
642
|
+
def nonl() -> None:
|
|
643
|
+
"""
|
|
644
|
+
Leave newline mode.
|
|
645
|
+
|
|
646
|
+
Disable translation of return into newline on input, and disable low-level
|
|
647
|
+
translation of newline into newline/return on output.
|
|
648
|
+
"""
|
|
649
|
+
...
|
|
650
|
+
def noqiflush() -> None:
|
|
651
|
+
"""
|
|
652
|
+
Disable queue flushing.
|
|
653
|
+
|
|
654
|
+
When queue flushing is disabled, normal flush of input and output queues
|
|
655
|
+
associated with the INTR, QUIT and SUSP characters will not be done.
|
|
656
|
+
"""
|
|
657
|
+
...
|
|
658
|
+
def noraw() -> None:
|
|
659
|
+
"""
|
|
660
|
+
Leave raw mode.
|
|
661
|
+
|
|
662
|
+
Return to normal "cooked" mode with line buffering.
|
|
663
|
+
"""
|
|
664
|
+
...
|
|
665
|
+
def pair_content(pair_number: int, /) -> tuple[int, int]:
|
|
666
|
+
"""
|
|
667
|
+
Return a tuple (fg, bg) containing the colors for the requested color pair.
|
|
668
|
+
|
|
669
|
+
pair_number
|
|
670
|
+
The number of the color pair (1 - (COLOR_PAIRS-1)).
|
|
671
|
+
"""
|
|
672
|
+
...
|
|
673
|
+
def pair_number(attr: int, /) -> int:
|
|
674
|
+
"""
|
|
675
|
+
Return the number of the color-pair set by the specified attribute value.
|
|
676
|
+
|
|
677
|
+
color_pair() is the counterpart to this function.
|
|
678
|
+
"""
|
|
679
|
+
...
|
|
680
|
+
def putp(string: ReadOnlyBuffer, /) -> None:
|
|
681
|
+
"""
|
|
682
|
+
Emit the value of a specified terminfo capability for the current terminal.
|
|
683
|
+
|
|
684
|
+
Note that the output of putp() always goes to standard output.
|
|
685
|
+
"""
|
|
686
|
+
...
|
|
687
|
+
def qiflush(flag: bool = True, /) -> None:
|
|
688
|
+
"""
|
|
689
|
+
Enable queue flushing.
|
|
690
|
+
|
|
691
|
+
flag
|
|
692
|
+
If false, the effect is the same as calling noqiflush().
|
|
693
|
+
|
|
694
|
+
If queue flushing is enabled, all output in the display driver queue
|
|
695
|
+
will be flushed when the INTR, QUIT and SUSP characters are read.
|
|
696
|
+
"""
|
|
697
|
+
...
|
|
698
|
+
def raw(flag: bool = True, /) -> None:
|
|
699
|
+
"""
|
|
700
|
+
Enter raw mode.
|
|
701
|
+
|
|
702
|
+
flag
|
|
703
|
+
If false, the effect is the same as calling noraw().
|
|
704
|
+
|
|
705
|
+
In raw mode, normal line buffering and processing of interrupt, quit,
|
|
706
|
+
suspend, and flow control keys are turned off; characters are presented to
|
|
707
|
+
curses input functions one by one.
|
|
708
|
+
"""
|
|
709
|
+
...
|
|
710
|
+
def reset_prog_mode() -> None:
|
|
711
|
+
"""Restore the terminal to "program" mode, as previously saved by def_prog_mode()."""
|
|
712
|
+
...
|
|
713
|
+
def reset_shell_mode() -> None:
|
|
714
|
+
"""Restore the terminal to "shell" mode, as previously saved by def_shell_mode()."""
|
|
715
|
+
...
|
|
716
|
+
def resetty() -> None:
|
|
717
|
+
"""Restore terminal mode."""
|
|
718
|
+
...
|
|
719
|
+
def resize_term(nlines: int, ncols: int, /) -> None:
|
|
720
|
+
"""
|
|
721
|
+
Backend function used by resizeterm(), performing most of the work.
|
|
722
|
+
|
|
723
|
+
nlines
|
|
724
|
+
Height.
|
|
725
|
+
ncols
|
|
726
|
+
Width.
|
|
727
|
+
|
|
728
|
+
When resizing the windows, resize_term() blank-fills the areas that are
|
|
729
|
+
extended. The calling application should fill in these areas with appropriate
|
|
730
|
+
data. The resize_term() function attempts to resize all windows. However,
|
|
731
|
+
due to the calling convention of pads, it is not possible to resize these
|
|
732
|
+
without additional interaction with the application.
|
|
733
|
+
"""
|
|
734
|
+
...
|
|
735
|
+
def resizeterm(nlines: int, ncols: int, /) -> None:
|
|
736
|
+
"""
|
|
737
|
+
Resize the standard and current windows to the specified dimensions.
|
|
738
|
+
|
|
739
|
+
nlines
|
|
740
|
+
Height.
|
|
741
|
+
ncols
|
|
742
|
+
Width.
|
|
743
|
+
|
|
744
|
+
Adjusts other bookkeeping data used by the curses library that record the
|
|
745
|
+
window dimensions (in particular the SIGWINCH handler).
|
|
746
|
+
"""
|
|
747
|
+
...
|
|
748
|
+
def savetty() -> None:
|
|
749
|
+
"""Save terminal mode."""
|
|
750
|
+
...
|
|
344
751
|
|
|
345
752
|
if sys.version_info >= (3, 9):
|
|
346
|
-
def set_escdelay(ms: int, /) -> None:
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
753
|
+
def set_escdelay(ms: int, /) -> None:
|
|
754
|
+
"""
|
|
755
|
+
Sets the curses ESCDELAY setting.
|
|
756
|
+
|
|
757
|
+
ms
|
|
758
|
+
length of the delay in milliseconds.
|
|
759
|
+
|
|
760
|
+
Sets the number of milliseconds to wait after reading an escape character,
|
|
761
|
+
to distinguish between an individual escape character entered on the
|
|
762
|
+
keyboard from escape sequences sent by cursor and function keys.
|
|
763
|
+
"""
|
|
764
|
+
...
|
|
765
|
+
def set_tabsize(size: int, /) -> None:
|
|
766
|
+
"""
|
|
767
|
+
Sets the curses TABSIZE setting.
|
|
768
|
+
|
|
769
|
+
size
|
|
770
|
+
rendered cell width of a tab character.
|
|
771
|
+
|
|
772
|
+
Sets the number of columns used by the curses library when converting a tab
|
|
773
|
+
character to spaces as it adds the tab to a window.
|
|
774
|
+
"""
|
|
775
|
+
...
|
|
776
|
+
|
|
777
|
+
def setsyx(y: int, x: int, /) -> None:
|
|
778
|
+
"""
|
|
779
|
+
Set the virtual screen cursor.
|
|
780
|
+
|
|
781
|
+
y
|
|
782
|
+
Y-coordinate.
|
|
783
|
+
x
|
|
784
|
+
X-coordinate.
|
|
785
|
+
|
|
786
|
+
If y and x are both -1, then leaveok is set.
|
|
787
|
+
"""
|
|
788
|
+
...
|
|
789
|
+
def setupterm(term: str | None = None, fd: int = -1) -> None:
|
|
790
|
+
"""
|
|
791
|
+
Initialize the terminal.
|
|
792
|
+
|
|
793
|
+
term
|
|
794
|
+
Terminal name.
|
|
795
|
+
If omitted, the value of the TERM environment variable will be used.
|
|
796
|
+
fd
|
|
797
|
+
File descriptor to which any initialization sequences will be sent.
|
|
798
|
+
If not supplied, the file descriptor for sys.stdout will be used.
|
|
799
|
+
"""
|
|
800
|
+
...
|
|
801
|
+
def start_color() -> None:
|
|
802
|
+
"""
|
|
803
|
+
Initializes eight basic colors and global variables COLORS and COLOR_PAIRS.
|
|
804
|
+
|
|
805
|
+
Must be called if the programmer wants to use colors, and before any other
|
|
806
|
+
color manipulation routine is called. It is good practice to call this
|
|
807
|
+
routine right after initscr().
|
|
808
|
+
|
|
809
|
+
It also restores the colors on the terminal to the values they had when the
|
|
810
|
+
terminal was just turned on.
|
|
811
|
+
"""
|
|
812
|
+
...
|
|
813
|
+
def termattrs() -> int:
|
|
814
|
+
"""Return a logical OR of all video attributes supported by the terminal."""
|
|
815
|
+
...
|
|
816
|
+
def termname() -> bytes:
|
|
817
|
+
"""Return the value of the environment variable TERM, truncated to 14 characters."""
|
|
818
|
+
...
|
|
819
|
+
def tigetflag(capname: str, /) -> int:
|
|
820
|
+
"""
|
|
821
|
+
Return the value of the Boolean capability.
|
|
822
|
+
|
|
823
|
+
capname
|
|
824
|
+
The terminfo capability name.
|
|
825
|
+
|
|
826
|
+
The value -1 is returned if capname is not a Boolean capability, or 0 if
|
|
827
|
+
it is canceled or absent from the terminal description.
|
|
828
|
+
"""
|
|
829
|
+
...
|
|
830
|
+
def tigetnum(capname: str, /) -> int:
|
|
831
|
+
"""
|
|
832
|
+
Return the value of the numeric capability.
|
|
833
|
+
|
|
834
|
+
capname
|
|
835
|
+
The terminfo capability name.
|
|
836
|
+
|
|
837
|
+
The value -2 is returned if capname is not a numeric capability, or -1 if
|
|
838
|
+
it is canceled or absent from the terminal description.
|
|
839
|
+
"""
|
|
840
|
+
...
|
|
841
|
+
def tigetstr(capname: str, /) -> bytes | None:
|
|
842
|
+
"""
|
|
843
|
+
Return the value of the string capability.
|
|
844
|
+
|
|
845
|
+
capname
|
|
846
|
+
The terminfo capability name.
|
|
847
|
+
|
|
848
|
+
None is returned if capname is not a string capability, or is canceled or
|
|
849
|
+
absent from the terminal description.
|
|
850
|
+
"""
|
|
851
|
+
...
|
|
357
852
|
def tparm(
|
|
358
853
|
str: ReadOnlyBuffer,
|
|
359
854
|
i1: int = 0,
|
|
@@ -366,19 +861,72 @@ def tparm(
|
|
|
366
861
|
i8: int = 0,
|
|
367
862
|
i9: int = 0,
|
|
368
863
|
/,
|
|
369
|
-
) -> bytes:
|
|
370
|
-
|
|
371
|
-
|
|
864
|
+
) -> bytes:
|
|
865
|
+
"""
|
|
866
|
+
Instantiate the specified byte string with the supplied parameters.
|
|
867
|
+
|
|
868
|
+
str
|
|
869
|
+
Parameterized byte string obtained from the terminfo database.
|
|
870
|
+
"""
|
|
871
|
+
...
|
|
872
|
+
def typeahead(fd: int, /) -> None:
|
|
873
|
+
"""
|
|
874
|
+
Specify that the file descriptor fd be used for typeahead checking.
|
|
875
|
+
|
|
876
|
+
fd
|
|
877
|
+
File descriptor.
|
|
878
|
+
|
|
879
|
+
If fd is -1, then no typeahead checking is done.
|
|
880
|
+
"""
|
|
881
|
+
...
|
|
882
|
+
def unctrl(ch: _ChType, /) -> bytes:
|
|
883
|
+
"""
|
|
884
|
+
Return a string which is a printable representation of the character ch.
|
|
885
|
+
|
|
886
|
+
Control characters are displayed as a caret followed by the character,
|
|
887
|
+
for example as ^C. Printing characters are left as they are.
|
|
888
|
+
"""
|
|
889
|
+
...
|
|
372
890
|
|
|
373
891
|
if sys.version_info < (3, 12) or sys.platform != "darwin":
|
|
374
892
|
# The support for macos was dropped in 3.12
|
|
375
|
-
def unget_wch(ch: int | str, /) -> None:
|
|
893
|
+
def unget_wch(ch: int | str, /) -> None:
|
|
894
|
+
"""Push ch so the next get_wch() will return it."""
|
|
895
|
+
...
|
|
896
|
+
|
|
897
|
+
def ungetch(ch: _ChType, /) -> None:
|
|
898
|
+
"""Push ch so the next getch() will return it."""
|
|
899
|
+
...
|
|
900
|
+
def ungetmouse(id: int, x: int, y: int, z: int, bstate: int, /) -> None:
|
|
901
|
+
"""
|
|
902
|
+
Push a KEY_MOUSE event onto the input queue.
|
|
376
903
|
|
|
377
|
-
|
|
378
|
-
|
|
904
|
+
The following getmouse() will return the given state data.
|
|
905
|
+
"""
|
|
906
|
+
...
|
|
379
907
|
def update_lines_cols() -> None: ...
|
|
380
|
-
def use_default_colors() -> None:
|
|
381
|
-
|
|
908
|
+
def use_default_colors() -> None:
|
|
909
|
+
"""
|
|
910
|
+
Allow use of default values for colors on terminals supporting this feature.
|
|
911
|
+
|
|
912
|
+
Use this to support transparency in your application. The default color
|
|
913
|
+
is assigned to the color number -1.
|
|
914
|
+
"""
|
|
915
|
+
...
|
|
916
|
+
def use_env(flag: bool, /) -> None:
|
|
917
|
+
"""
|
|
918
|
+
Use environment variables LINES and COLUMNS.
|
|
919
|
+
|
|
920
|
+
If used, this function should be called before initscr() or newterm() are
|
|
921
|
+
called.
|
|
922
|
+
|
|
923
|
+
When flag is False, the values of lines and columns specified in the terminfo
|
|
924
|
+
database will be used, even if environment variables LINES and COLUMNS (used
|
|
925
|
+
by default) are set, or if curses is running in a window (in which case
|
|
926
|
+
default behavior would be to use the window size if LINES and COLUMNS are
|
|
927
|
+
not set).
|
|
928
|
+
"""
|
|
929
|
+
...
|
|
382
930
|
|
|
383
931
|
class error(Exception): ...
|
|
384
932
|
|