-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathcurses.po
871 lines (766 loc) · 39.8 KB
/
curses.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2020, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# tomo, 2018
# Mikami Akiko, 2021
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-09 18:48+0900\n"
"PO-Revision-Date: 2018-06-29 17:46+0000\n"
"Last-Translator: Mikami Akiko, 2021\n"
"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/"
"ja/)\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../howto/curses.rst:5
msgid "Curses Programming with Python"
msgstr "Python で Curses プログラミング"
#: ../../howto/curses.rst:0
msgid "Author"
msgstr "著者"
#: ../../howto/curses.rst:7
msgid "A.M. Kuchling, Eric S. Raymond"
msgstr "A.M. Kuchling, Eric S. Raymond"
#: ../../howto/curses.rst:0
msgid "Release"
msgstr "リリース"
#: ../../howto/curses.rst:8
msgid "2.04"
msgstr "2.04"
#: ../../howto/curses.rstNone
msgid "Abstract"
msgstr "概要"
#: ../../howto/curses.rst:13
msgid ""
"This document describes how to use the :mod:`curses` extension module to "
"control text-mode displays."
msgstr ""
"このドキュメントでは :mod:`curses` 拡張モジュールでテキストモードディスプレイ"
"を制御する方法について記述します。"
#: ../../howto/curses.rst:18
msgid "What is curses?"
msgstr "curses ってなに?"
#: ../../howto/curses.rst:20
msgid ""
"The curses library supplies a terminal-independent screen-painting and "
"keyboard-handling facility for text-based terminals; such terminals include "
"VT100s, the Linux console, and the simulated terminal provided by various "
"programs. Display terminals support various control codes to perform common "
"operations such as moving the cursor, scrolling the screen, and erasing "
"areas. Different terminals use widely differing codes, and often have their "
"own minor quirks."
msgstr ""
"curses ライブラリは、VT100s や Linux コンソール、さまざまなプログラムが提供す"
"るエミュレーション端末といったテキストベースの端末(ターミナル)のために、端"
"末に依存しないスクリーン描画や、キーボードの処理を提供します。端末はカーソル"
"の移動や、画面のスクロール、領域の消去といった共通の操作を行うための様々な制"
"御コードをサポートします。端末の種類によって大きく異なる制御コードを使うこと"
"があり、しばしば独特の癖があります。"
#: ../../howto/curses.rst:28
msgid ""
"In a world of graphical displays, one might ask \"why bother\"? It's true "
"that character-cell display terminals are an obsolete technology, but there "
"are niches in which being able to do fancy things with them are still "
"valuable. One niche is on small-footprint or embedded Unixes that don't run "
"an X server. Another is tools such as OS installers and kernel "
"configurators that may have to run before any graphical support is available."
msgstr ""
"グラフィカルなディスプレイが当たり前の今となっては、「なんでわざわざ?」と疑"
"問に思うかもしれません。確かに文字表示端末は時代遅れな技術ではありますが、"
"ニッチな領域が存在していて、意匠を凝らすことができるため、いまだに価値のある"
"ものとなっています。そのような領域の一つは、例えば X サーバーを持たない組み込"
"みのUnixです。ほかにも、OSのインストーラや、カーネル設定などのツールで、これ"
"らはグラフィカルサポートが利用可能になる前に動作する必要があります。"
#: ../../howto/curses.rst:36
msgid ""
"The curses library provides fairly basic functionality, providing the "
"programmer with an abstraction of a display containing multiple non-"
"overlapping windows of text. The contents of a window can be changed in "
"various ways---adding text, erasing it, changing its appearance---and the "
"curses library will figure out what control codes need to be sent to the "
"terminal to produce the right output. curses doesn't provide many user-"
"interface concepts such as buttons, checkboxes, or dialogs; if you need such "
"features, consider a user interface library such as `Urwid <https://pypi.org/"
"project/urwid/>`_."
msgstr ""
"The cursesライブラリは、プログラマーに重複しない複数のテキストウィンドウを含"
"むディスプレイを抽象化した機能を提供します。ウィンドウの内容は複数の方法で変"
"更が可能で、(文字の追加、削除、表示の変更等)cursesライブラリによって正しい"
"出力を得るためのコントロールコードが判断されます。cursesが提供するユーザーイ"
"ンターフェースのコンセプトは限られています。ボタン、チェックボックス、ダイア"
"ログ等は含まれておりません。そのような機能が必要な場合は、`Urwid <https://"
"pypi.org/project/urwid/>`_.のようなユーザーインターフェースライブラリーの使用"
"を検討してください。"
#: ../../howto/curses.rst:46
msgid ""
"The curses library was originally written for BSD Unix; the later System V "
"versions of Unix from AT&T added many enhancements and new functions. BSD "
"curses is no longer maintained, having been replaced by ncurses, which is an "
"open-source implementation of the AT&T interface. If you're using an open-"
"source Unix such as Linux or FreeBSD, your system almost certainly uses "
"ncurses. Since most current commercial Unix versions are based on System V "
"code, all the functions described here will probably be available. The "
"older versions of curses carried by some proprietary Unixes may not support "
"everything, though."
msgstr ""
"curses ライブラリは元々 BSD UNIX 向けに書かれました; 後の AT&T から出た Unix "
"System V バージョンで多くの機能と新機能が追加されました。BSD curses はいまや"
"メンテナンスされておらず、これは AT&T インターフェースのオープンソース実装で"
"ある ncurses にとって置き換えられました。Linux や FreeBSD のようなオープン"
"ソース Unix を利用している場合は、おそらくシステムは ncurses を利用していま"
"す。現在のほとんどの商用 Unix は System V のコードを基にしているため、ここで"
"述べる全ての関数が利用できるはずです。しかし、古いバージョンの curses を持つ"
"いくつかのプロプライエタリ Unix は全てには対応していないでしょう。"
#: ../../howto/curses.rst:56
msgid ""
"The Windows version of Python doesn't include the :mod:`curses` module. A "
"ported version called `UniCurses <https://pypi.org/project/UniCurses>`_ is "
"available. You could also try `the Console module <http://effbot.org/zone/"
"console-index.htm>`_ written by Fredrik Lundh, which doesn't use the same "
"API as curses but provides cursor-addressable text output and full support "
"for mouse and keyboard input."
msgstr ""
"Windows 版 Python には :mod:`curses` が含まれていません。 `UniCurses "
"<https://pypi.org/project/UniCurses>`_ という名の移植版が利用可能です。"
"Fredrik Lundh の手による `the Console module <http://effbot.org/zone/console-"
"index.htm>`_ も試してみると良いでしょう。これには curses と同じ API を用いて"
"いませんが、カーソル位置指定でのテキスト出力と、マウス、キーボード入力のフル"
"サポートを提供しています。"
#: ../../howto/curses.rst:66
msgid "The Python curses module"
msgstr "Python の curses module"
#: ../../howto/curses.rst:68
msgid ""
"The Python module is a fairly simple wrapper over the C functions provided "
"by curses; if you're already familiar with curses programming in C, it's "
"really easy to transfer that knowledge to Python. The biggest difference is "
"that the Python interface makes things simpler by merging different C "
"functions such as :c:func:`addstr`, :c:func:`mvaddstr`, and :c:func:"
"`mvwaddstr` into a single :meth:`~curses.window.addstr` method. You'll see "
"this covered in more detail later."
msgstr ""
#: ../../howto/curses.rst:76
msgid ""
"This HOWTO is an introduction to writing text-mode programs with curses and "
"Python. It doesn't attempt to be a complete guide to the curses API; for "
"that, see the Python library guide's section on ncurses, and the C manual "
"pages for ncurses. It will, however, give you the basic ideas."
msgstr ""
"この HOWTO は curses と Python を使ってテキストプログラムを書くための入門記事"
"です。 curses API に対する完全な解説をすることは意図していません; その目的の"
"ためには Python ライブラリガイドの ncurses 節と C 言語マニュアルのncurses の"
"ページを参照してください。とはいえ、この文章は基本的な考えを提供してくれるで"
"しょう。"
#: ../../howto/curses.rst:83
msgid "Starting and ending a curses application"
msgstr "curses アプリケーションの起動と終了"
#: ../../howto/curses.rst:85
msgid ""
"Before doing anything, curses must be initialized. This is done by calling "
"the :func:`~curses.initscr` function, which will determine the terminal "
"type, send any required setup codes to the terminal, and create various "
"internal data structures. If successful, :func:`initscr` returns a window "
"object representing the entire screen; this is usually called ``stdscr`` "
"after the name of the corresponding C variable. ::"
msgstr ""
#: ../../howto/curses.rst:96
msgid ""
"Usually curses applications turn off automatic echoing of keys to the "
"screen, in order to be able to read keys and only display them under certain "
"circumstances. This requires calling the :func:`~curses.noecho` function. ::"
msgstr ""
#: ../../howto/curses.rst:103
msgid ""
"Applications will also commonly need to react to keys instantly, without "
"requiring the Enter key to be pressed; this is called cbreak mode, as "
"opposed to the usual buffered input mode. ::"
msgstr ""
"通常アプリケーションはまた、Enter キーを押すことなく、キーに対してすぐに反応"
"する必要があります; これは cbreak モードと呼ばれ、通常の入力がバッファされる"
"モードと逆に動作します。 ::"
#: ../../howto/curses.rst:109
msgid ""
"Terminals usually return special keys, such as the cursor keys or navigation "
"keys such as Page Up and Home, as a multibyte escape sequence. While you "
"could write your application to expect such sequences and process them "
"accordingly, curses can do it for you, returning a special value such as :"
"const:`curses.KEY_LEFT`. To get curses to do the job, you'll have to enable "
"keypad mode. ::"
msgstr ""
"端末は通常、カーソルキーや Page Up や Home といった操作キーなどの特別なキーを"
"マルチバイトエスケープシーケンスとして返します。それらのシーケンスを想定して"
"対応する処理を行うアプリケーションを書けるように、 curses はそれを :const:"
"`curses.KEY_LEFT` のような特別な値を返して行ってくれます。 curses にその仕事"
"をさせるには、キーパッドモードを有効にする必要があります。 ::"
#: ../../howto/curses.rst:118
msgid ""
"Terminating a curses application is much easier than starting one. You'll "
"need to call::"
msgstr ""
"curses アプリケーションを終了させるのは起動よりも簡単です。 以下を呼び出す必"
"要があります::"
#: ../../howto/curses.rst:125
msgid ""
"to reverse the curses-friendly terminal settings. Then call the :func:"
"`~curses.endwin` function to restore the terminal to its original operating "
"mode. ::"
msgstr ""
"cursesに親和性の高い設定をもとに戻します。そして、:func:`~curses.endwin` 関数"
"を呼び出し、端末を通常の操作モードに復旧します。 ::"
#: ../../howto/curses.rst:131
msgid ""
"A common problem when debugging a curses application is to get your terminal "
"messed up when the application dies without restoring the terminal to its "
"previous state. In Python this commonly happens when your code is buggy and "
"raises an uncaught exception. Keys are no longer echoed to the screen when "
"you type them, for example, which makes using the shell difficult."
msgstr ""
"curses アプリケーションをデバッグするときの一般的な問題は、アプリケーションが"
"端末を以前の状態に復旧することなく異常終了したときに端末がめちゃめちゃになる"
"ことです。Python ではこの問題はコードにバグがあって、捕捉できない例外が発生し"
"たときによく起きます。タイプしたキーはもはやエコーされません、例えば、シェル"
"を使うのが難しくなります。"
#: ../../howto/curses.rst:137
msgid ""
"In Python you can avoid these complications and make debugging much easier "
"by importing the :func:`curses.wrapper` function and using it like this::"
msgstr ""
"Pythonでは、これらの複雑さを避けデバッグをより容易にするために、 :func:"
"`curses.wrapper` 関数をインポートして、このように使います::"
#: ../../howto/curses.rst:156
msgid ""
"The :func:`~curses.wrapper` function takes a callable object and does the "
"initializations described above, also initializing colors if color support "
"is present. :func:`wrapper` then runs your provided callable. Once the "
"callable returns, :func:`wrapper` will restore the original state of the "
"terminal. The callable is called inside a :keyword:`try`...\\ :keyword:"
"`except` that catches exceptions, restores the state of the terminal, and "
"then re-raises the exception. Therefore your terminal won't be left in a "
"funny state on exception and you'll be able to read the exception's message "
"and traceback."
msgstr ""
#: ../../howto/curses.rst:168
msgid "Windows and Pads"
msgstr "ウィンドウとパッド"
#: ../../howto/curses.rst:170
msgid ""
"Windows are the basic abstraction in curses. A window object represents a "
"rectangular area of the screen, and supports methods to display text, erase "
"it, allow the user to input strings, and so forth."
msgstr ""
#: ../../howto/curses.rst:174
msgid ""
"The ``stdscr`` object returned by the :func:`~curses.initscr` function is a "
"window object that covers the entire screen. Many programs may need only "
"this single window, but you might wish to divide the screen into smaller "
"windows, in order to redraw or clear them separately. The :func:`~curses."
"newwin` function creates a new window of a given size, returning the new "
"window object. ::"
msgstr ""
#: ../../howto/curses.rst:185
msgid ""
"Note that the coordinate system used in curses is unusual. Coordinates are "
"always passed in the order *y,x*, and the top-left corner of a window is "
"coordinate (0,0). This breaks the normal convention for handling "
"coordinates where the *x* coordinate comes first. This is an unfortunate "
"difference from most other computer applications, but it's been part of "
"curses since it was first written, and it's too late to change things now."
msgstr ""
#: ../../howto/curses.rst:193
msgid ""
"Your application can determine the size of the screen by using the :data:"
"`curses.LINES` and :data:`curses.COLS` variables to obtain the *y* and *x* "
"sizes. Legal coordinates will then extend from ``(0,0)`` to ``(curses.LINES "
"- 1, curses.COLS - 1)``."
msgstr ""
#: ../../howto/curses.rst:198
msgid ""
"When you call a method to display or erase text, the effect doesn't "
"immediately show up on the display. Instead you must call the :meth:"
"`~curses.window.refresh` method of window objects to update the screen."
msgstr ""
#: ../../howto/curses.rst:203
msgid ""
"This is because curses was originally written with slow 300-baud terminal "
"connections in mind; with these terminals, minimizing the time required to "
"redraw the screen was very important. Instead curses accumulates changes to "
"the screen and displays them in the most efficient manner when you call :"
"meth:`refresh`. For example, if your program displays some text in a window "
"and then clears the window, there's no need to send the original text "
"because they're never visible."
msgstr ""
#: ../../howto/curses.rst:212
msgid ""
"In practice, explicitly telling curses to redraw a window doesn't really "
"complicate programming with curses much. Most programs go into a flurry of "
"activity, and then pause waiting for a keypress or some other action on the "
"part of the user. All you have to do is to be sure that the screen has been "
"redrawn before pausing to wait for user input, by first calling ``stdscr."
"refresh()`` or the :meth:`refresh` method of some other relevant window."
msgstr ""
#: ../../howto/curses.rst:220
msgid ""
"A pad is a special case of a window; it can be larger than the actual "
"display screen, and only a portion of the pad displayed at a time. Creating "
"a pad requires the pad's height and width, while refreshing a pad requires "
"giving the coordinates of the on-screen area where a subsection of the pad "
"will be displayed. ::"
msgstr ""
#: ../../howto/curses.rst:241
msgid ""
"The :meth:`refresh` call displays a section of the pad in the rectangle "
"extending from coordinate (5,5) to coordinate (20,75) on the screen; the "
"upper left corner of the displayed section is coordinate (0,0) on the pad. "
"Beyond that difference, pads are exactly like ordinary windows and support "
"the same methods."
msgstr ""
#: ../../howto/curses.rst:247
msgid ""
"If you have multiple windows and pads on screen there is a more efficient "
"way to update the screen and prevent annoying screen flicker as each part of "
"the screen gets updated. :meth:`refresh` actually does two things:"
msgstr ""
"もし、スクリーンに複数のウィンドウやパッドを持っている場合、スクリーンをより"
"効率よく更新し、スクリーンの各部が更新されるたびに起こるいらいらするちらつき"
"を抑える方法があります。 :meth:`refresh` は実際には二つの事を行っています。"
#: ../../howto/curses.rst:252
msgid ""
"Calls the :meth:`~curses.window.noutrefresh` method of each window to update "
"an underlying data structure representing the desired state of the screen."
msgstr ""
"それぞれのウィンドウの :meth:`~curses.window.noutrefresh` メソッドを呼び出し"
"て、配下にある、スクリーンの望ましい状態を表すデータ構造を更新します。 "
#: ../../howto/curses.rst:255
msgid ""
"Calls the function :func:`~curses.doupdate` function to change the physical "
"screen to match the desired state recorded in the data structure."
msgstr ""
":func:`~curses.doupdate` 関数を呼び出して、データ構造に記録された望ましい状態"
"に合致するように、物理スクリーンを更新します。"
#: ../../howto/curses.rst:258
msgid ""
"Instead you can call :meth:`noutrefresh` on a number of windows to update "
"the data structure, and then call :func:`doupdate` to update the screen."
msgstr ""
"かわりに、:meth:`noutrefresh` を呼び出して、いくつかのウィンドウのデータ構造"
"を更新し、その後に :func:`doupdate` を呼び出して、スクリーンを更新できます。"
#: ../../howto/curses.rst:264
msgid "Displaying Text"
msgstr "テキストの表示"
#: ../../howto/curses.rst:266
msgid ""
"From a C programmer's point of view, curses may sometimes look like a twisty "
"maze of functions, all subtly different. For example, :c:func:`addstr` "
"displays a string at the current cursor location in the ``stdscr`` window, "
"while :c:func:`mvaddstr` moves to a given y,x coordinate first before "
"displaying the string. :c:func:`waddstr` is just like :c:func:`addstr`, but "
"allows specifying a window to use instead of using ``stdscr`` by default. :c:"
"func:`mvwaddstr` allows specifying both a window and a coordinate."
msgstr ""
"C 言語のプログラマの視点からすると、curses はしばしば、混乱を招きやすい、微妙"
"に似た関数を持っています。例えば :c:func:`addstr` は ``stdscr`` ウィンドウの"
"現在のカーソル位置の文字列を表示し、一方で :c:func:`mvaddstr` は与えられた y,"
"x 座標にまず移動して、文字列を表示します。 :c:func:`waddstr` はほとんど :c:"
"func:`addstr` に似ていますが、デフォルトの ``stdscr`` を使う代わりに使うウィ"
"ンドウを指定できます。 :c:func:`mvwaddstr` はウィンドウと座標の両方を指定でき"
"ます。"
#: ../../howto/curses.rst:275
msgid ""
"Fortunately the Python interface hides all these details. ``stdscr`` is a "
"window object like any other, and methods such as :meth:`~curses.window."
"addstr` accept multiple argument forms. Usually there are four different "
"forms."
msgstr ""
"幸運にも、Python インターフェースはこれらの詳細を全て隠蔽してくれます。 "
"``stdscr`` は他のものと同様のウィンドウオブジェクトであり、 :meth:`~curses."
"window.addstr` のようなメソッドは複数の引数形式を許容してくれます。通常それら"
"は4つの形式です。"
#: ../../howto/curses.rst:281
msgid "Form"
msgstr "形式"
#: ../../howto/curses.rst:281 ../../howto/curses.rst:350
msgid "Description"
msgstr "説明"
#: ../../howto/curses.rst:283
msgid "*str* or *ch*"
msgstr "*str* または *ch*"
#: ../../howto/curses.rst:283
msgid "Display the string *str* or character *ch* at the current position"
msgstr "文字列 *str* または文字 *ch* を現在位置に表示します"
#: ../../howto/curses.rst:286
msgid "*str* or *ch*, *attr*"
msgstr "*str* または *ch*, *attr*"
#: ../../howto/curses.rst:286
msgid ""
"Display the string *str* or character *ch*, using attribute *attr* at the "
"current position"
msgstr ""
"文字列 *str* または文字 *ch* を属性 *attr* を利用して現在位置に表示します"
#: ../../howto/curses.rst:290
msgid "*y*, *x*, *str* or *ch*"
msgstr "*y*, *x*, *str* または *ch*"
#: ../../howto/curses.rst:290
msgid "Move to position *y,x* within the window, and display *str* or *ch*"
msgstr "ウィンドウ内の位置 *y,x* に移動し *str* または *ch* を表示します"
#: ../../howto/curses.rst:293
msgid "*y*, *x*, *str* or *ch*, *attr*"
msgstr "*y*, *x*, *str* または *ch*, *attr*"
#: ../../howto/curses.rst:293
msgid ""
"Move to position *y,x* within the window, and display *str* or *ch*, using "
"attribute *attr*"
msgstr ""
"ウィンドウ内の位置 *y,x* に移動し属性 *attr* を利用して *str* または *ch* を"
"表示します"
#: ../../howto/curses.rst:297
msgid ""
"Attributes allow displaying text in highlighted forms such as boldface, "
"underline, reverse code, or in color. They'll be explained in more detail "
"in the next subsection."
msgstr ""
"属性によって表示するテキストをハイライトすることができます、ボールド体、アン"
"ダーライン、反転、カラーなど。より詳しくは次の小節で説明します。"
#: ../../howto/curses.rst:302
msgid ""
"The :meth:`~curses.window.addstr` method takes a Python string or bytestring "
"as the value to be displayed. The contents of bytestrings are sent to the "
"terminal as-is. Strings are encoded to bytes using the value of the "
"window's :attr:`encoding` attribute; this defaults to the default system "
"encoding as returned by :func:`locale.getpreferredencoding`."
msgstr ""
#: ../../howto/curses.rst:309
msgid ""
"The :meth:`~curses.window.addch` methods take a character, which can be "
"either a string of length 1, a bytestring of length 1, or an integer."
msgstr ""
#: ../../howto/curses.rst:312
msgid ""
"Constants are provided for extension characters; these constants are "
"integers greater than 255. For example, :const:`ACS_PLMINUS` is a +/- "
"symbol, and :const:`ACS_ULCORNER` is the upper left corner of a box (handy "
"for drawing borders). You can also use the appropriate Unicode character."
msgstr ""
#: ../../howto/curses.rst:318
msgid ""
"Windows remember where the cursor was left after the last operation, so if "
"you leave out the *y,x* coordinates, the string or character will be "
"displayed wherever the last operation left off. You can also move the "
"cursor with the ``move(y,x)`` method. Because some terminals always display "
"a flashing cursor, you may want to ensure that the cursor is positioned in "
"some location where it won't be distracting; it can be confusing to have the "
"cursor blinking at some apparently random location."
msgstr ""
"ウィンドウは最後の操作の後のカーソル位置を覚えているため、 *y,x* 座標をうっか"
"り忘れてしまっても、文字列や文字は最後の操作位置に表示されます。 ``move(y,"
"x)`` メソッドでカーソルを移動させることもできます。常に点滅するカーソルを表示"
"する端末もあるため、カーソルが特定の位置にいることを保証して注意が反れないよ"
"うにしたいと思うかもしれません; ランダムに見える位置でカーソルが点滅すると面"
"を食らってしまいます。"
#: ../../howto/curses.rst:326
msgid ""
"If your application doesn't need a blinking cursor at all, you can call "
"``curs_set(False)`` to make it invisible. For compatibility with older "
"curses versions, there's a ``leaveok(bool)`` function that's a synonym for :"
"func:`~curses.curs_set`. When *bool* is true, the curses library will "
"attempt to suppress the flashing cursor, and you won't need to worry about "
"leaving it in odd locations."
msgstr ""
#: ../../howto/curses.rst:335
msgid "Attributes and Color"
msgstr "属性とカラー"
#: ../../howto/curses.rst:337
msgid ""
"Characters can be displayed in different ways. Status lines in a text-based "
"application are commonly shown in reverse video, or a text viewer may need "
"to highlight certain words. curses supports this by allowing you to specify "
"an attribute for each cell on the screen."
msgstr ""
#: ../../howto/curses.rst:342
msgid ""
"An attribute is an integer, each bit representing a different attribute. "
"You can try to display text with multiple attribute bits set, but curses "
"doesn't guarantee that all the possible combinations are available, or that "
"they're all visually distinct. That depends on the ability of the terminal "
"being used, so it's safest to stick to the most commonly available "
"attributes, listed here."
msgstr ""
"属性は整数値で、それぞれのビットが異なる属性を表わします。複数の属性ビットを"
"セットしてテキストの表示を試みることができますが、curses は全ての組み合わせが"
"利用可能であるかや視覚的に区別できるかどうかは保証してくれません、それらは利"
"用している端末の能力に依存しているため、最も安全なのは、最も一般的に利用可能"
"な属性を設定する方法です、ここに列挙します。"
#: ../../howto/curses.rst:350
msgid "Attribute"
msgstr "属性"
#: ../../howto/curses.rst:352
msgid ":const:`A_BLINK`"
msgstr ":const:`A_BLINK`"
#: ../../howto/curses.rst:352
msgid "Blinking text"
msgstr "テキストを点滅"
#: ../../howto/curses.rst:354
msgid ":const:`A_BOLD`"
msgstr ":const:`A_BOLD`"
#: ../../howto/curses.rst:354
msgid "Extra bright or bold text"
msgstr "高輝度またはボールドテキスト"
#: ../../howto/curses.rst:356
msgid ":const:`A_DIM`"
msgstr ":const:`A_DIM`"
#: ../../howto/curses.rst:356
msgid "Half bright text"
msgstr "低輝度テキスト"
#: ../../howto/curses.rst:358
msgid ":const:`A_REVERSE`"
msgstr ":const:`A_REVERSE`"
#: ../../howto/curses.rst:358
msgid "Reverse-video text"
msgstr "反転テキスト"
#: ../../howto/curses.rst:360
msgid ":const:`A_STANDOUT`"
msgstr ":const:`A_STANDOUT`"
#: ../../howto/curses.rst:360
msgid "The best highlighting mode available"
msgstr "利用できる最良のハイライトモード"
#: ../../howto/curses.rst:362
msgid ":const:`A_UNDERLINE`"
msgstr ":const:`A_UNDERLINE`"
#: ../../howto/curses.rst:362
msgid "Underlined text"
msgstr "下線付きテキスト"
#: ../../howto/curses.rst:365
msgid ""
"So, to display a reverse-video status line on the top line of the screen, "
"you could code::"
msgstr ""
"つまり、反転するステータスラインを画面の最上部に表示するには、コードをこうし"
"ます::"
#: ../../howto/curses.rst:372
msgid ""
"The curses library also supports color on those terminals that provide it. "
"The most common such terminal is probably the Linux console, followed by "
"color xterms."
msgstr ""
"curses ライブラリはカラー機能を提供している端末でのカラーもサポートしていま"
"す。そんな端末の中で最も一般的なものは Linux コンソールで、color xterm もそれ"
"に続きます。"
#: ../../howto/curses.rst:376
msgid ""
"To use color, you must call the :func:`~curses.start_color` function soon "
"after calling :func:`~curses.initscr`, to initialize the default color set "
"(the :func:`curses.wrapper` function does this automatically). Once that's "
"done, the :func:`~curses.has_colors` function returns TRUE if the terminal "
"in use can actually display color. (Note: curses uses the American spelling "
"'color', instead of the Canadian/British spelling 'colour'. If you're used "
"to the British spelling, you'll have to resign yourself to misspelling it "
"for the sake of these functions.)"
msgstr ""
#: ../../howto/curses.rst:386
msgid ""
"The curses library maintains a finite number of color pairs, containing a "
"foreground (or text) color and a background color. You can get the "
"attribute value corresponding to a color pair with the :func:`~curses."
"color_pair` function; this can be bitwise-OR'ed with other attributes such "
"as :const:`A_REVERSE`, but again, such combinations are not guaranteed to "
"work on all terminals."
msgstr ""
#: ../../howto/curses.rst:393
msgid "An example, which displays a line of text using color pair 1::"
msgstr "例として、テキスト行をカラーペア 1 を使って表示します::"
#: ../../howto/curses.rst:398
msgid ""
"As I said before, a color pair consists of a foreground and background "
"color. The ``init_pair(n, f, b)`` function changes the definition of color "
"pair *n*, to foreground color f and background color b. Color pair 0 is "
"hard-wired to white on black, and cannot be changed."
msgstr ""
#: ../../howto/curses.rst:403
msgid ""
"Colors are numbered, and :func:`start_color` initializes 8 basic colors when "
"it activates color mode. They are: 0:black, 1:red, 2:green, 3:yellow, 4:"
"blue, 5:magenta, 6:cyan, and 7:white. The :mod:`curses` module defines "
"named constants for each of these colors: :const:`curses.COLOR_BLACK`, :"
"const:`curses.COLOR_RED`, and so forth."
msgstr ""
#: ../../howto/curses.rst:409
msgid ""
"Let's put all this together. To change color 1 to red text on a white "
"background, you would call::"
msgstr ""
"やってみましょう。カラー 1 を白背景に赤に変更してみましょう、こうして呼び出し"
"ます::"
#: ../../howto/curses.rst:414
msgid ""
"When you change a color pair, any text already displayed using that color "
"pair will change to the new colors. You can also display new text in this "
"color with::"
msgstr ""
"カラーペアを変更するときには、既に表示された任意のテキストが利用するカラーペ"
"アを新しい色に変更します。新しいテキストをこの色で使うこともできます::"
#: ../../howto/curses.rst:420
msgid ""
"Very fancy terminals can change the definitions of the actual colors to a "
"given RGB value. This lets you change color 1, which is usually red, to "
"purple or blue or any other color you like. Unfortunately, the Linux "
"console doesn't support this, so I'm unable to try it out, and can't provide "
"any examples. You can check if your terminal can do this by calling :func:"
"`~curses.can_change_color`, which returns ``True`` if the capability is "
"there. If you're lucky enough to have such a talented terminal, consult "
"your system's man pages for more information."
msgstr ""
#: ../../howto/curses.rst:431
msgid "User Input"
msgstr "ユーザ入力"
#: ../../howto/curses.rst:433
msgid ""
"The C curses library offers only very simple input mechanisms. Python's :mod:"
"`curses` module adds a basic text-input widget. (Other libraries such as "
"`Urwid <https://pypi.org/project/urwid/>`_ have more extensive collections "
"of widgets.)"
msgstr ""
#: ../../howto/curses.rst:438
msgid "There are two methods for getting input from a window:"
msgstr "ウィンドウから入力を得るための2つのメソッドがあります。"
#: ../../howto/curses.rst:440
msgid ""
":meth:`~curses.window.getch` refreshes the screen and then waits for the "
"user to hit a key, displaying the key if :func:`~curses.echo` has been "
"called earlier. You can optionally specify a coordinate to which the cursor "
"should be moved before pausing."
msgstr ""
#: ../../howto/curses.rst:445
msgid ""
":meth:`~curses.window.getkey` does the same thing but converts the integer "
"to a string. Individual characters are returned as 1-character strings, and "
"special keys such as function keys return longer strings containing a key "
"name such as ``KEY_UP`` or ``^G``."
msgstr ""
#: ../../howto/curses.rst:450
msgid ""
"It's possible to not wait for the user using the :meth:`~curses.window."
"nodelay` window method. After ``nodelay(True)``, :meth:`getch` and :meth:"
"`getkey` for the window become non-blocking. To signal that no input is "
"ready, :meth:`getch` returns ``curses.ERR`` (a value of -1) and :meth:"
"`getkey` raises an exception. There's also a :func:`~curses.halfdelay` "
"function, which can be used to (in effect) set a timer on each :meth:"
"`getch`; if no input becomes available within a specified delay (measured in "
"tenths of a second), curses raises an exception."
msgstr ""
#: ../../howto/curses.rst:460
msgid ""
"The :meth:`getch` method returns an integer; if it's between 0 and 255, it "
"represents the ASCII code of the key pressed. Values greater than 255 are "
"special keys such as Page Up, Home, or the cursor keys. You can compare the "
"value returned to constants such as :const:`curses.KEY_PPAGE`, :const:"
"`curses.KEY_HOME`, or :const:`curses.KEY_LEFT`. The main loop of your "
"program may look something like this::"
msgstr ""
#: ../../howto/curses.rst:476
msgid ""
"The :mod:`curses.ascii` module supplies ASCII class membership functions "
"that take either integer or 1-character string arguments; these may be "
"useful in writing more readable tests for such loops. It also supplies "
"conversion functions that take either integer or 1-character-string "
"arguments and return the same type. For example, :func:`curses.ascii.ctrl` "
"returns the control character corresponding to its argument."
msgstr ""
#: ../../howto/curses.rst:483
msgid ""
"There's also a method to retrieve an entire string, :meth:`~curses.window."
"getstr`. It isn't used very often, because its functionality is quite "
"limited; the only editing keys available are the backspace key and the Enter "
"key, which terminates the string. It can optionally be limited to a fixed "
"number of characters. ::"
msgstr ""
#: ../../howto/curses.rst:494
msgid ""
"The :mod:`curses.textpad` module supplies a text box that supports an Emacs-"
"like set of keybindings. Various methods of the :class:`~curses.textpad."
"Textbox` class support editing with input validation and gathering the edit "
"results either with or without trailing spaces. Here's an example::"
msgstr ""
#: ../../howto/curses.rst:518
msgid ""
"See the library documentation on :mod:`curses.textpad` for more details."
msgstr ""
"さらなる詳細についてはライブラリのドキュメント :mod:`curses.textpad` を参照"
"してください。"
#: ../../howto/curses.rst:522
msgid "For More Information"
msgstr "より多くの情報"
#: ../../howto/curses.rst:524
msgid ""
"This HOWTO doesn't cover some advanced topics, such as reading the contents "
"of the screen or capturing mouse events from an xterm instance, but the "
"Python library page for the :mod:`curses` module is now reasonably "
"complete. You should browse it next."
msgstr ""
"この HOWTO ではいくつかの進んだ話題、スクリーンスクレイピングや xterm インス"
"タンスからマウスイベントを捉えるなど、については扱っていません。しかし、"
"Python の :mod:`curses` モジュールのライブラリページはいまやかなり充実してい"
"ます。次はこれを見るべきです。"
#: ../../howto/curses.rst:529
msgid ""
"If you're in doubt about the detailed behavior of the curses functions, "
"consult the manual pages for your curses implementation, whether it's "
"ncurses or a proprietary Unix vendor's. The manual pages will document any "
"quirks, and provide complete lists of all the functions, attributes, and :"
"const:`ACS_\\*` characters available to you."
msgstr ""
"curses 関数の詳細な振る舞いで不審に思ったら、それが ncurses であろうがプロプ"
"ライエタリな Unix ベンダーのものであろうが、curses 実装のマニュアルページを調"
"べてください。マニュアルページには、どんな気紛れ血の迷いでもドキュメントさ"
"れ、関数、属性、 :const:`ACS_\\*` 文字の完全なリストが提供されていることで"
"しょう。"
#: ../../howto/curses.rst:536
msgid ""
"Because the curses API is so large, some functions aren't supported in the "
"Python interface. Often this isn't because they're difficult to implement, "
"but because no one has needed them yet. Also, Python doesn't yet support "
"the menu library associated with ncurses. Patches adding support for these "
"would be welcome; see `the Python Developer's Guide <https://devguide.python."
"org/>`_ to learn more about submitting patches to Python."
msgstr ""
#: ../../howto/curses.rst:544
msgid ""
"`Writing Programs with NCURSES <http://invisible-island.net/ncurses/ncurses-"
"intro.html>`_: a lengthy tutorial for C programmers."
msgstr ""
"`Writing Programs with NCURSES <http://invisible-island.net/ncurses/ncurses-"
"intro.html>`_: C プログラマ向けの非常に長いチュートリアルです。"
#: ../../howto/curses.rst:546
msgid "`The ncurses man page <http://linux.die.net/man/3/ncurses>`_"
msgstr "`ncurses マニュアルページ <http://linux.die.net/man/3/ncurses>`_"
#: ../../howto/curses.rst:547
msgid ""
"`The ncurses FAQ <http://invisible-island.net/ncurses/ncurses.faq.html>`_"
msgstr ""
"`The ncurses FAQ <http://invisible-island.net/ncurses/ncurses.faq.html>`_"
#: ../../howto/curses.rst:548
msgid ""
"`\"Use curses... don't swear\" <https://www.youtube.com/watch?"
"v=eN1eZtjLEnU>`_: video of a PyCon 2013 talk on controlling terminals using "
"curses or Urwid."
msgstr ""
"`\"Use curses... don't swear\" <https://www.youtube.com/watch?"
"v=eN1eZtjLEnU>`_: curses または Urwid を使って端末を制御する PyCon 2013 講演"
"ビデオです。"
#: ../../howto/curses.rst:550
msgid ""
"`\"Console Applications with Urwid\" <http://www.pyvideo.org/video/1568/"
"console-applications-with-urwid>`_: video of a PyCon CA 2012 talk "
"demonstrating some applications written using Urwid."
msgstr ""
"`\"Console Applications with Urwid\" <http://www.pyvideo.org/video/1568/"
"console-applications-with-urwid>`_: Urwid で書かれたいくつかのアプリケーショ"
"ンをデモンストレーションしている PyCon CA 2012 講演ビデオです。"