-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathcurses.po
More file actions
533 lines (411 loc) · 63 KB
/
Copy pathcurses.po
File metadata and controls
533 lines (411 loc) · 63 KB
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
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Alireza Shabani (Revisto) <theRevisto@gmail.com>, 2025
# Danial Behzadi <dani.behzi@ubuntu.com>, 2025
# Rafael Fontenelle <rffontenelle@gmail.com>, 2025
# Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-21 11:59+0000\n"
"PO-Revision-Date: 2026-09-21 13:28+0330\n"
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
"Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.6\n"
msgid "Curses Programming with Python"
msgstr "برنامهنویسی Curses با پایتون"
msgid "Author"
msgstr "نویسنده"
msgid "A.M. Kuchling, Eric S. Raymond"
msgstr "A.M. Kuchling, Eric S. Raymond"
msgid "Release"
msgstr "انتشار"
msgid "2.04"
msgstr "2.04"
msgid "Abstract"
msgstr "چکیده"
msgid "This document describes how to use the :mod:`curses` extension module to control text-mode displays."
msgstr "این سند چگونگی استفاده از ماژول توسعهایی :mod:`curses` را برای کنترل نمایشگرهای حالت متنی توضیح میدهد."
msgid "What is curses?"
msgstr "curses چیست؟"
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 سازوکار ترسیم صفحه و مدیریت صفحهکلید مستقل از پایانه را برای پایانههای مبتنی بر متن فراهم میکند؛ چنین پایانههایی شامل پایانههای VT100، کنسول لینوکس و پایانه شبیهسازیشدهای میشوند که برنامههای مختلف آن را فراهم میکنند. پایانههای نمایشی از کدهای کنترلی گوناگونی برای انجام عملیات رایج مانند جابهجایی مکاننما، پیمایش صفحه و پاکسازی ناحیهها پشتیبانی میکنند. پایانههای مختلف از کدهای بسیار متفاوتی استفاده میکنند و اغلب رفتارهای خاص جزئی خود را دارند."
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 را اجرا نمیکنند. حوزهی دیگر، ابزارهایی مانند نصبکنندههای سیستمعامل و پیکربندیکنندههای هسته هستند که ممکن است لازم باشد پیش از در دسترس بودن هرگونه پشتیبانی گرافیکی اجرا شوند."
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 :pypi:`Urwid`."
msgstr "کتابخانهی curses قابلیتهای نسبتاً پایهای را فراهم میکند و انتزاعی از یک صفحهنمایش حاوی چند پنجرهی متنی بدون همپوشانی را در اختیار برنامهنویس قرار میدهد. محتوای یک پنجره را میتوان به روشهای مختلفی تغییر داد — افزودن متن، پاک کردن آن، تغییر ظاهر آن — و کتابخانهی curses تشخیص میدهد که چه کدهای کنترلی باید به پایانه ارسال شوند تا خروجی صحیح تولید شود. curses مفاهیم زیادی از رابط کاربری مانند دکمهها، جعبههای انتخاب یا کادرهای محاوره را فراهم نمیکند؛ اگر به چنین امکاناتی نیاز دارید، یک کتابخانهی رابط کاربری مانند :pypi:`Urwid` را در نظر بگیرید."
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 نوشته شد؛ نسخههای بعدی Unix از نوع System V که از سوی AT&T ارائه شدند، بهبودها و توابع جدید بسیاری را افزودند. BSD curses دیگر نگهداری نمیشود و با ncurses جایگزین شده است؛ ncurses پیادهسازی متنبازی از رابط AT&T است. اگر از یک Unix متنباز مانند Linux یا FreeBSD استفاده میکنید، سیستم شما تقریباً بهطور قطع از ncurses استفاده میکند. از آنجا که بیشتر نسخههای تجاری کنونی Unix مبتنی بر کد System V هستند، احتمالاً همه توابع توصیفشده در اینجا در دسترس خواهند بود. البته ممکن است نسخههای قدیمیتر curses موجود در برخی Unixهای اختصاصی از همه موارد پشتیبانی نکنند."
msgid "The Windows version of Python doesn't include the :mod:`curses` module. The third-party :pypi:`windows-curses` package provides the same interface on Windows."
msgstr "نسخه پایتون برای ویندوز شامل ماژول :mod:`curses` نمیشود. بسته شخص ثالث :pypi:`windows-curses` همان رابط را در ویندوز فراهم میکند."
msgid "The Python curses module"
msgstr "ماژول curses پایتون"
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 "ماژول پایتون، پوششی نسبتاً ساده بر روی توابع C ارائهشده توسط curses است؛ اگر از قبل با برنامهنویسی curses در C آشنا هستید، انتقال آن دانش به پایتون بسیار آسان است. بزرگترین تفاوت این است که رابط پایتون با ادغام توابع مختلف C مانند :c:func:`!addstr`، :c:func:`!mvaddstr` و :c:func:`!mvwaddstr` در یک متد :meth:`~curses.window.addstr` واحد، کارها را سادهتر میکند. این موضوع را بعداً با جزئیات بیشتری خواهید دید."
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 و پایتون. این راهنما تلاش نمیکند راهنمای کاملی برای API curses باشد؛ برای آن، بخش مربوط به ncurses در راهنمای کتابخانهی پایتون و صفحات راهنمای C برای ncurses را ببینید. با این حال، ایدههای پایه را به شما ارائه میدهد."
msgid "Starting and ending a curses application"
msgstr "شروع و پایان یک برنامه curses"
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 "پیش از انجام هر کاری، باید curses راهاندازی شود. این کار با فراخوانی تابع :func:`~curses.initscr` انجام میشود؛ این تابع نوع پایانه را مشخص میکند، کدهای راهاندازی لازم را به پایانه ارسال میکند و ساختارهای داده درونی مختلفی را ایجاد میکند. در صورت موفقیت، :func:`!initscr` یک شیء پنجره را برمیگرداند که نمایانگر تمام صفحه است؛ این شیء معمولاً ``stdscr`` نامیده میشود، برگرفته از نام متغیر متناظر در C. ::"
msgid ""
"import curses\n"
"stdscr = curses.initscr()"
msgstr ""
"import curses\n"
"stdscr = curses.initscr()"
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 "معمولاً برنامههای curses بازتاب خودکار کلیدها در صفحه را خاموش میکنند، تا بتوانند کلیدها را بخوانند و تنها تحت شرایط خاصی آنها را نمایش دهند. این کار نیازمند فراخوانی تابع :func:`~curses.noecho` است. ::"
msgid "curses.noecho()"
msgstr "curses.noecho()"
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 گفته میشود، در مقابل حالت معمول ورودی بافرشده. ::"
msgid "curses.cbreak()"
msgstr "curses.cbreak()"
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 این کار را انجام دهد، باید حالت keypad را فعال کنید. ::"
msgid "stdscr.keypad(True)"
msgstr "stdscr.keypad(True)"
msgid "Terminating a curses application is much easier than starting one. You'll need to call::"
msgstr "پایان دادن به یک برنامهی curses بسیار آسانتر از آغاز آن است. باید آن را فراخوانی کنید::"
msgid ""
"curses.nocbreak()\n"
"stdscr.keypad(False)\n"
"curses.echo()"
msgstr ""
"curses.nocbreak()\n"
"stdscr.keypad(False)\n"
"curses.echo()"
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` را فراخوانی کنید تا پایانه به حالت عملیاتی اصلی خود بازگردد. ::"
msgid "curses.endwin()"
msgstr "curses.endwin()"
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 این است که وقتی برنامه بدون بازگرداندن پایانه به وضعیت پیشین خود از کار میافتد، پایانه شما بههم بریزد. در پایتون، این اتفاق معمولاً زمانی رخ میدهد که کد شما دارای اشکال باشد و یک استثنای گرفتهنشده را پرتاب کند. برای مثال، کلیدها دیگر هنگام تایپ روی صفحه بازتاب داده نمیشوند، که این موضوع استفاده از پوسته را دشوار میکند."
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 "در پایتون میتوانید با ایمپورت کردن تابع :func:`curses.wrapper` و استفاده از آن به این شکل، از این پیچیدگیها اجتناب کنید و اشکالزدایی را بسیار آسانتر سازید::"
msgid ""
"from curses import wrapper\n"
"\n"
"def main(stdscr):\n"
" # Clear screen\n"
" stdscr.clear()\n"
"\n"
" # This raises ZeroDivisionError when i == 10.\n"
" for i in range(0, 11):\n"
" v = i-10\n"
" stdscr.addstr(i, 0, '10 divided by {} is {}'.format(v, 10/v))\n"
"\n"
" stdscr.refresh()\n"
" stdscr.getkey()\n"
"\n"
"wrapper(main)"
msgstr ""
"from curses import wrapper\n"
"\n"
"def main(stdscr):\n"
" # Clear screen\n"
" stdscr.clear()\n"
"\n"
" # This raises ZeroDivisionError when i == 10.\n"
" for i in range(0, 11):\n"
" v = i-10\n"
" stdscr.addstr(i, 0, '10 divided by {} is {}'.format(v, 10/v))\n"
"\n"
" stdscr.refresh()\n"
" stdscr.getkey()\n"
"\n"
"wrapper(main)"
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 "تابع :func:`~curses.wrapper` یک شیء فراخوانیپذیر میگیرد، مقداردهیهای اولیهی توصیفشده در بالا را انجام میدهد و در صورت وجود پشتیبانی از رنگ، رنگها را نیز مقداردهی اولیه میکند. سپس :func:`!wrapper` فراخوانیپذیر ارائهشدهی شما را اجرا میکند. پس از بازگشت فراخوانیپذیر، :func:`!wrapper` وضعیت اصلی پایانه را بازیابی خواهد کرد. فراخوانیپذیر درون یک :keyword:`try`...\\ :keyword:`except` فراخوانی میشود که استثناها را میگیرد، وضعیت پایانه را بازیابی میکند و سپس استثنا را دوباره پرتاب میکند. بنابراین در صورت بروز استثنا، پایانهی شما در وضعیت نامناسبی باقی نخواهد ماند و میتوانید پیام و ردگیری پشتهی استثنا را بخوانید."
msgid "Windows and Pads"
msgstr "پنجرهها و پدها"
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 "پنجرهها انتزاع پایه در curses هستند. یک شیء پنجره نشاندهندهی یک ناحیهی مستطیلی از صفحه است و از متدهایی برای نمایش متن، پاک کردن آن، اجازه دادن به کاربر برای وارد کردن رشتهها و غیره پشتیبانی میکند."
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 "شیء ``stdscr`` که توسط تابع :func:`~curses.initscr` برگردانده میشود، یک شیء پنجره است که کل صفحه را میپوشاند. بسیاری از برنامهها ممکن است تنها به همین یک پنجره نیاز داشته باشند، اما شما ممکن است بخواهید صفحه را به پنجرههای کوچکتر تقسیم کنید تا آنها را بهطور جداگانه بازترسیم یا پاک کنید. تابع :func:`~curses.newwin` یک پنجره جدید با اندازهای مشخص ایجاد میکند و شیء پنجره جدید را برمیگرداند. ::"
msgid ""
"begin_x = 20; begin_y = 7\n"
"height = 5; width = 40\n"
"win = curses.newwin(height, width, begin_y, begin_x)"
msgstr ""
"begin_x = 20; begin_y = 7\n"
"height = 5; width = 40\n"
"win = curses.newwin(height, width, begin_y, begin_x)"
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 "توجه داشته باشید که دستگاه مختصات استفادهشده در curses غیرمعمول است. مختصات همیشه به ترتیب *y,x* ارسال میشود و گوشهی بالا سمت چپ یک پنجره، مختصات (۰،۰) است. این امر قرارداد رایج برای مدیریت مختصات را میشکند؛ قراردادی که در آن مختصات *x* ابتدا میآید. این یک تفاوت ناخوشایند با بیشتر برنامههای کاربردی رایانهای دیگر است، اما از زمان نخستین نگارش curses بخشی از آن بوده است و اکنون برای تغییر این موارد خیلی دیر است."
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 "برنامهی شما میتواند با استفاده از متغیرهای :data:`curses.LINES` و :data:`curses.COLS` اندازهی صفحه را تعیین کند تا اندازههای *y* و *x* را به دست آورد. در این صورت، مختصات مجاز از ``(0,0)`` تا ``(curses.LINES - 1, curses.COLS - 1)`` خواهد بود."
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 "هنگامی که یک متد را برای نمایش یا پاک کردن متن فراخوانی میکنید، اثر آن بلافاصله روی نمایشگر ظاهر نمیشود. در عوض، باید متد :meth:`~curses.window.refresh` اشیای پنجره را فراخوانی کنید تا صفحه بهروزرسانی شود."
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 "دلیل این امر آن است که curses در ابتدا با در نظر گرفتن اتصالات پایانهای کند با نرخ ۳۰۰ بود نوشته شده بود؛ در این پایانهها، به حداقل رساندن زمان لازم برای بازترسیم صفحه بسیار مهم بود. در عوض، curses تغییرات صفحه را انباشته میکند و هنگامی که شما :meth:`!refresh` را فراخوانی میکنید، آنها را به کارآمدترین شیوه نمایش میدهد. برای مثال، اگر برنامه شما متنی را در یک پنجره نمایش دهد و سپس پنجره را پاک کند، نیازی به ارسال متن اصلی نیست، زیرا هرگز قابل مشاهده نیست."
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 :meth:`!stdscr.refresh` or the :meth:`!refresh` method of some other relevant window."
msgstr "در عمل، اینکه بهصراحت به curses بگوییم یک پنجره را دوباره ترسیم کند، چندان برنامهنویسی با curses را پیچیده نمیکند. بیشتر برنامهها وارد دورهای از فعالیت فشرده میشوند و سپس برای انتظار فشردن یک کلید یا اقدام دیگری از سوی کاربر مکث میکنند. تنها کاری که باید انجام دهید این است که پیش از مکث برای انتظار ورودی کاربر، ابتدا با فراخوانی :meth:`!stdscr.refresh` یا متد :meth:`!refresh` یک پنجره مرتبط دیگر، مطمئن شوید که صفحه دوباره ترسیم شده است."
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 "یک پد حالت خاصی از یک پنجره است؛ میتواند بزرگتر از صفحهی نمایش واقعی باشد و تنها بخشی از پد در هر زمان نمایش داده شود. ایجاد یک پد به ارتفاع و عرض پد نیاز دارد، در حالی که تازهسازی یک پد نیازمند ارائه مختصات ناحیهی روی صفحهای است که زیربخشی از پد در آن نمایش داده خواهد شد. ::"
msgid ""
"pad = curses.newpad(100, 100)\n"
"# These loops fill the pad with letters; addch() is\n"
"# explained in the next section\n"
"for y in range(0, 99):\n"
" for x in range(0, 99):\n"
" pad.addch(y,x, ord('a') + (x*x+y*y) % 26)\n"
"\n"
"# Displays a section of the pad in the middle of the screen.\n"
"# (0,0) : coordinate of upper-left corner of pad area to display.\n"
"# (5,5) : coordinate of upper-left corner of window area to be filled\n"
"# with pad content.\n"
"# (20, 75) : coordinate of lower-right corner of window area to be\n"
"# : filled with pad content.\n"
"pad.refresh( 0,0, 5,5, 20,75)"
msgstr ""
"pad = curses.newpad(100, 100)\n"
"# These loops fill the pad with letters; addch() is\n"
"# explained in the next section\n"
"for y in range(0, 99):\n"
" for x in range(0, 99):\n"
" pad.addch(y,x, ord('a') + (x*x+y*y) % 26)\n"
"\n"
"# Displays a section of the pad in the middle of the screen.\n"
"# (0,0) : coordinate of upper-left corner of pad area to display.\n"
"# (5,5) : coordinate of upper-left corner of window area to be filled\n"
"# with pad content.\n"
"# (20, 75) : coordinate of lower-right corner of window area to be\n"
"# : filled with pad content.\n"
"pad.refresh( 0,0, 5,5, 20,75)"
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 "فراخوانی :meth:`!refresh` بخشی از پد را در مستطیلی که از مختصات (۵،۵) تا مختصات (۲۰،۷۵) روی صفحه امتداد دارد، نمایش میدهد؛ گوشهی بالا سمت چپ بخش نمایشدادهشده، مختصات (۰،۰) روی پد است. جدای از این تفاوت، پدها دقیقاً مانند پنجرههای معمولی هستند و از همان متدها پشتیبانی میکنند."
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` در واقع دو کار انجام میدهد:"
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` هر پنجره را فراخوانی میکند تا یک ساختار داده زیربنایی را که وضعیت مطلوب صفحه را نشان میدهد بهروزرسانی کند."
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` را فراخوانی میکند تا صفحه فیزیکی را با وضعیت دلخواه ثبتشده در ساختار داده هماهنگ کند."
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` را برای بهروزرسانی صفحه فراخوانی کنید."
msgid "Displaying Text"
msgstr "نمایش متن"
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` امکان تعیین هم یک پنجره و هم یک مختصات را میدهد."
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 "خوشبختانه رابط پایتون تمام این جزئیات را پنهان میکند. ``stdscr`` یک شیء پنجره مانند هر شیء دیگری است و متدهایی مانند :meth:`~curses.window.addstr` چندین شکل آرگومان را میپذیرند. معمولاً ۴ شکل مختلف وجود دارد."
msgid "Form"
msgstr "فرم"
msgid "Description"
msgstr "توضیحات"
msgid "*str* or *ch*"
msgstr "*str* یا *ch*"
msgid "Display the string *str* or character *ch* at the current position"
msgstr "نمایش رشتهی *str* یا نویسهی *ch* در موقعیت فعلی"
msgid "*str* or *ch*, *attr*"
msgstr "*str* یا *ch*، *attr*"
msgid "Display the string *str* or character *ch*, using attribute *attr* at the current position"
msgstr "رشتهی *str* یا نویسهی *ch* را با استفاده از ویژگی *attr* در موقعیت فعلی نمایش دهید"
msgid "*y*, *x*, *str* or *ch*"
msgstr "*y*، *x*، *str* یا *ch*"
msgid "Move to position *y,x* within the window, and display *str* or *ch*"
msgstr "به موقعیت *y,x* درون پنجره بروید و *str* یا *ch* را نمایش دهید"
msgid "*y*, *x*, *str* or *ch*, *attr*"
msgstr "*y*، *x*، *str* یا *ch*، *attr*"
msgid "Move to position *y,x* within the window, and display *str* or *ch*, using attribute *attr*"
msgstr "به موقعیت *y,x* درون پنجره بروید و *str* یا *ch* را با استفاده از ویژگی *attr* نمایش دهید"
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 "ویژگیها امکان نمایش متن در قالبهای برجسته مانند پررنگ، زیرخط، کد معکوس یا رنگی را فراهم میکنند. این ویژگیها در زیربخش بعدی با جزئیات بیشتر توضیح داده خواهند شد."
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. On a build without wide-character support strings are encoded using the value of the window's :attr:`~window.encoding` attribute; this defaults to the default system encoding as returned by :func:`locale.getencoding`."
msgstr "متد :meth:`~curses.window.addstr` یک رشته یا بایترشته پایتون را به عنوان مقداری که باید نمایش داده شود میپذیرد. محتوای بایترشتهها به صورت همانند به ترمینال ارسال میشوند. در ساخت بدون پشتیبانی از نویسههای پهن، رشتهها با استفاده از مقدار ویژگی :attr:`~window.encoding` پنجره کدگذاری میشوند؛ این به طور پیشفرض به کدگذاری پیشفرض سیستم پیش میرود که توسط :func:`locale.getencoding` برگردانده میشود."
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 "متدهای :meth:`~curses.window.addch` یک نویسه دریافت میکنند، که میتواند یک رشته به طول ۱، یک رشتهبایت (bytestring) به طول ۱، یا یک عدد صحیح باشد."
msgid "Constants are provided for the characters of the terminal's alternate character set. 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 "ثابتها برای نویسههای مجموعهی جایگزین ترمینال فراهم شدهاند. برای مثال، :const:`ACS_PLMINUS` نماد +/- است، و :const:`ACS_ULCORNER` گوشهی بالا-چپ یک جعبه است (مناسب برای رسم کادرها). شما همچنین میتوانید از نویسهی یونیکد مناسب استفاده کنید."
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)`` جابهجا کنید. از آنجا که برخی پایانهها همیشه یک مکاننمای چشمکزن را نمایش میدهند، ممکن است بخواهید اطمینان حاصل کنید که مکاننما در موقعیتی قرار گرفته است که باعث حواسپرتی نمیشود؛ چشمک زدن مکاننما در موقعیتی که ظاهراً تصادفی است میتواند گیجکننده باشد."
msgid "If your application doesn't need a blinking cursor at all, you can call ``curs_set(False)`` to make it invisible. The window method :meth:`~curses.window.leaveok` does something different: when its argument is true, curses leaves the cursor wherever the last update put it, instead of moving it back to the window's cursor position."
msgstr "اگر برنامهی شما اصلاً به یک نشانگر چشمکزن نیاز ندارد، میتوانید ``curs_set(False)`` را فراخوانی کنید تا نامرئی شود. متد پنجره :meth:`~curses.window.leaveok` کار متفاوتی انجام میدهد: وقتی آرگومان آن درست باشد، curses نشانگر را هر جایی که آخرین بهروزرسانی آن را قرار داده است رها میکند، به جای اینکه آن را به موقعیت نشانگر پنجره بازگرداند."
msgid "Attributes and Color"
msgstr "ویژگیها و رنگ"
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 "نویسهها را میتوان به روشهای مختلفی نمایش داد. ردیفهای وضعیت در یک برنامهی مبتنی بر متن معمولاً بهحالت معکوس (reverse video) نمایش داده میشوند، یا ممکن است یک نمایشگر متن نیاز داشته باشد که کلمات خاصی را برجسته کند. curses از این موضوع پشتیبانی میکند و به شما اجازه میدهد برای هر سلول روی صفحه یک ویژگی تعیین کنید."
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 تضمین نمیکند که همهی ترکیبهای ممکن در دسترس باشند، یا اینکه همهی آنها از نظر بصری متمایز باشند. این امر به توانایی پایانهی مورد استفاده بستگی دارد، بنابراین امنتر است که به رایجترین ویژگیهای در دسترس، که در اینجا فهرست شدهاند، پایبند باشید."
msgid "Attribute"
msgstr "ویژگی"
msgid ":const:`A_BLINK`"
msgstr ":const:`A_BLINK`"
msgid "Blinking text"
msgstr "متن چشمکزن"
msgid ":const:`A_BOLD`"
msgstr ":const:`A_BOLD`"
msgid "Extra bright or bold text"
msgstr "متن بسیار روشن یا پررنگ"
msgid ":const:`A_DIM`"
msgstr ":const:`A_DIM`"
msgid "Half bright text"
msgstr "متن نیمهروشن"
msgid ":const:`A_REVERSE`"
msgstr ":const:`A_REVERSE`"
msgid "Reverse-video text"
msgstr "متن ویدیویی معکوس"
msgid ":const:`A_STANDOUT`"
msgstr ":const:`A_STANDOUT`"
msgid "The best highlighting mode available"
msgstr "بهترین حالت برجستهسازی موجود"
msgid ":const:`A_UNDERLINE`"
msgstr ":const:`A_UNDERLINE`"
msgid "Underlined text"
msgstr "متن زیرخطدار"
msgid "So, to display a reverse-video status line on the top line of the screen, you could code::"
msgstr "بنابراین، برای نمایش یک خط وضعیت با نمایش معکوس در خط بالای صفحه، میتوانید اینگونه کد بنویسید::"
msgid ""
"stdscr.addstr(0, 0, \"Current mode: Typing mode\",\n"
" curses.A_REVERSE)\n"
"stdscr.refresh()"
msgstr ""
"stdscr.addstr(0, 0, \"Current mode: Typing mode\",\n"
" curses.A_REVERSE)\n"
"stdscr.refresh()"
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 همچنین از رنگ در آن پایانههایی که آن را فراهم میکنند، پشتیبانی میکند. رایجترین پایانه از این نوع احتمالاً کنسول لینوکس است و پس از آن پایانههای xterm رنگی قرار دارند."
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 "برای استفاده از رنگ، باید تابع :func:`~curses.start_color` را بلافاصله پس از فراخوانی :func:`~curses.initscr` صدا بزنید تا مجموعهرنگ پیشفرض راهاندازی شود (تابع :func:`curses.wrapper` این کار را بهطور خودکار انجام میدهد). پس از انجام این کار، اگر پایانهی مورد استفاده واقعاً بتواند رنگ را نمایش دهد، تابع :func:`~curses.has_colors` مقدار TRUE را برمیگرداند. (توجه: curses از املای آمریکایی 'color' بهجای املای کانادایی/بریتانیایی 'colour' استفاده میکند. اگر به املای بریتانیایی عادت دارید، باید بپذیرید که بهخاطر این توابع آن را با املای اشتباه بنویسید.)"
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 "کتابخانه curses تعداد محدودی جفترنگ را نگه میدارد که حاوی یک رنگ پیشزمینه (یا رنگ متن) و یک رنگ پسزمینه هستند. میتوانید مقدار ویژگی متناظر با یک جفترنگ را با تابع :func:`~curses.color_pair` دریافت کنید؛ میتوان این مقدار را با ویژگیهای دیگر مانند :const:`A_REVERSE` با OR بیتی ترکیب کرد، اما باز هم، کار کردن چنین ترکیبهایی در تمام پایانهها تضمین نمیشود."
msgid "An example, which displays a line of text using color pair 1::"
msgstr "مثالی که سطری از متن را با استفاده از جفترنگ (color pair) ۱ نمایش میدهد::"
msgid ""
"stdscr.addstr(\"Pretty text\", curses.color_pair(1))\n"
"stdscr.refresh()"
msgstr ""
"stdscr.addstr(\"Pretty text\", curses.color_pair(1))\n"
"stdscr.refresh()"
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 "همانطور که پیشتر گفتم، یک جفترنگ از یک رنگ پیشزمینه و یک رنگ پسزمینه تشکیل شده است. تابع ``init_pair(n, f, b)`` تعریف جفترنگ *n* را به رنگ پیشزمینه f و رنگ پسزمینه b تغییر میدهد. جفترنگ ۰ بهصورت ذاتی سفید روی سیاه است و نمیتوان آن را تغییر داد."
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 "رنگها شمارهگذاری شدهاند و :func:`start_color` هنگام فعالسازی حالت رنگ، ۸ رنگ پایه را مقداردهی اولیه میکند. این رنگها عبارتاند از: ۰:سیاه، ۱:قرمز، ۲:سبز، ۳:زرد، ۴:آبی، ۵:سرخابی، ۶:فیروزهای و ۷:سفید. ماژول :mod:`curses` برای هر یک از این رنگها ثابتهای نامدار تعریف میکند: :const:`curses.COLOR_BLACK`، :const:`curses.COLOR_RED` و غیره."
msgid "Let's put all this together. To change color 1 to red text on a white background, you would call::"
msgstr "بیایید همه اینها را کنار هم بگذاریم. برای تغییر رنگ ۱ به متن قرمز روی زمینه سفید، باید اینگونه فراخوانی کنید::"
msgid "curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)"
msgstr "curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)"
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 "هنگامی که یک جفترنگ را تغییر میدهید، هر متنی که از قبل با استفاده از آن جفترنگ نمایش داده شده باشد، به رنگهای جدید تغییر خواهد کرد. همچنین میتوانید متن جدیدی را با این رنگ بهصورت زیر نمایش دهید::"
msgid "stdscr.addstr(0,0, \"RED ALERT!\", curses.color_pair(1))"
msgstr "stdscr.addstr(0,0, \"RED ALERT!\", curses.color_pair(1))"
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 "پایانههای بسیار پیشرفته میتوانند تعاریف رنگهای واقعی را به یک مقدار RGB دادهشده تغییر دهند. این امکان را به شما میدهد که رنگ ۱ را، که معمولاً قرمز است، به بنفش یا آبی یا هر رنگ دیگری که بخواهید تغییر دهید. متأسفانه، کنسول لینوکس از این قابلیت پشتیبانی نمیکند، بنابراین من نمیتوانم آن را امتحان کنم و نمیتوانم هیچ مثالی ارائه دهم. میتوانید با فراخوانی :func:`~curses.can_change_color`، که در صورت وجود این قابلیت ``True`` را برمیگرداند، بررسی کنید که آیا پایانه شما این کار را انجام میدهد یا خیر. اگر آنقدر خوششانس هستید که چنین پایانه توانمندی دارید، برای اطلاعات بیشتر به صفحات man سیستم خود مراجعه کنید."
msgid "User Input"
msgstr "ورودی کاربر"
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 :pypi:`Urwid` have more extensive collections of widgets.)"
msgstr "کتابخانه curses در C فقط سازوکارهای ورودی بسیار سادهای را ارائه میدهد. ماژول :mod:`curses` پایتون یک ابزارک پایه برای ورودی متن میافزاید. (سایر کتابخانهها مانند :pypi:`Urwid` مجموعههای گستردهتری از ابزارکها دارند.)"
msgid "There are three methods for getting input from a window:"
msgstr "سه متد برای دریافت ورودی از یک پنجره وجود دارد:"
msgid ":meth:`~curses.window.get_wch` 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 ":meth:`~curses.window.get_wch` صفحه را بازسازی میکند و سپس منتظر میماند تا کاربر دکمهای را بزند، دکمه را نمایش میدهد اگر :func:`~curses.echo` قبلاً فراخوانی شده باشد. شما میتوانید بهصورت اختیاری مختصاتی را مشخص کنید که نشانگر باید قبل از توقف به آنجا منتقل شود."
msgid ":meth:`~curses.window.getch` does the same thing but returns the code of the key instead of a character. With ncurses this is a single byte of the key's encoding in the current locale, so a character encoded with several bytes takes several calls, one byte per call."
msgstr ":meth:`~curses.window.getch` کار مشابهی انجام میدهد اما کد دکمه را به جای نویسه برمیگرداند. با ncurses این یک بایت واحد از کدگذاری دکمه در locale جاری است، بنابراین یک نویسه که با چند بایت کدگذاری شده است چندین فراخوانی میگیرد، یک بایت در هر فراخوانی."
msgid ":meth:`~curses.window.getkey` does the same as :meth:`!getch` but returns a string: an ordinary key as a 1-character string, and a special key as its name, such as ``KEY_UP``."
msgstr ":meth:`~curses.window.getkey` همان کار :meth:`!getch` را انجام میدهد اما یک رشته برمیگرداند: یک دکمه معمولی به عنوان یک رشته ۱-نویسه، و یک دکمه خاص به عنوان نام آن، مانند ``KEY_UP``."
msgid "It's possible to not wait for the user using the :meth:`~curses.window.nodelay` window method. After ``nodelay(True)``, the reads for the window become non-blocking. To signal that no input is ready, :meth:`!get_wch` and :meth:`!getkey` raise an exception, and :meth:`!getch` returns ``-1``. There's also a :func:`~curses.halfdelay` function, which can be used to (in effect) set a timer on each read; if no input becomes available within a specified delay (measured in tenths of a second), the read fails the same way."
msgstr "استفاده از متد پنجره :meth:`~curses.window.nodelay` امکان عدم انتظار برای کاربر را فراهم میکند. پس از ``nodelay(True)``، خواندنها برای پنجره غیرمسدودکننده میشوند. برای سیگنال دادن اینکه هیچ ورودی آماده نیست، :meth:`!get_wch` و :meth:`!getkey` یک استثنا پرتاب میکنند، و :meth:`!getch` ``-1`` برمیگرداند. همچنین تابع :func:`~curses.halfdelay` وجود دارد که میتواند (در اثر) یک تایمر روی هر خواندن تنظیم کند؛ اگر هیچ ورودی در تاخیر مشخص شده (بر حسب دهم ثانیه) موجود نشود، خواندن به همان روش شکست میخورد."
msgid "Special keys such as Page Up, Home, or the cursor keys are returned by all three as one of the :ref:`KEY_* constants <curses-key-constants>`, all larger than 255. 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 "دکمههای خاص مانند Page Up، Home، یا دکمههای نشانگر توسط هر سه به عنوان یکی از :ref:`KEY_* constants <curses-key-constants>` برگردانده میشوند، که همگی بزرگتر از ۲۵۵ هستند. شما میتوانید مقدار برگردانده شده را با ثابتهایی مانند :const:`curses.KEY_PPAGE`، :const:`curses.KEY_HOME`، یا :const:`curses.KEY_LEFT` مقایسه کنید. حلقهی اصلی برنامهی شما ممکن است چیزی شبیه به این باشد::"
msgid ""
"while True:\n"
" c = stdscr.get_wch()\n"
" if c == 'p':\n"
" PrintDocument()\n"
" elif c == 'q':\n"
" break # Exit the while loop\n"
" elif c == curses.KEY_HOME:\n"
" x = y = 0"
msgstr ""
"while True:\n"
" c = stdscr.get_wch()\n"
" if c == 'p':\n"
" PrintDocument()\n"
" elif c == 'q':\n"
" break # Exit the while loop\n"
" elif c == curses.KEY_HOME:\n"
" x = y = 0"
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 "ماژول :mod:`curses.ascii` توابع عضویت در کلاسهای ASCII را فراهم میکند که آرگومانهایی از نوع عدد صحیح یا رشتهی تکنویسهای میپذیرند؛ این توابع ممکن است در نوشتن آزمونهای خواناتر برای چنین حلقههایی مفید باشند. این ماژول همچنین توابع تبدیل را فراهم میکند که آرگومانهایی از نوع عدد صحیح یا رشتهی تکنویسهای میپذیرند و همان نوع را برمیگردانند. برای مثال، :func:`curses.ascii.ctrl` نویسهی کنترلی متناظر با آرگومان خود را برمیگرداند."
msgid "There's also a method to retrieve an entire line, :meth:`~curses.window.getstr`. It isn't used very often, because its functionality is quite limited; the only editing keys available are the erase and kill characters, and the Enter key, which terminates the line. It returns a bytes object, and can optionally be limited to a fixed number of bytes. ::"
msgstr "همچنین متدی برای بازیابی یک سطر کامل وجود دارد، :meth:`~curses.window.getstr`. این متد بسیار استفاده نمیشود، زیرا کارکرد آن کاملاً محدود است؛ تنها دکمههای ویرایش موجود نویسههای erase و kill، و دکمه Enter هستند که سطر را خاتمه میدهند. این متد یک شیء bytes برمیگرداند، و میتواند بهصورت اختیاری به تعداد ثابتی از بایتها محدود شود. ::"
msgid ""
"curses.echo() # Enable echoing of characters\n"
"\n"
"# Get a line of at most 15 bytes, with the cursor on the top line\n"
"s = stdscr.getstr(0,0, 15)"
msgstr ""
"curses.echo() # Enable echoing of characters\n"
"\n"
"# Get a line of at most 15 bytes, with the cursor on the top line\n"
"s = stdscr.getstr(0,0, 15)"
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 "ماژول :mod:`curses.textpad` یک جعبهی متن فراهم میکند که از مجموعهای از کلیدبندیها (keybindings) شبیه به Emacs پشتیبانی میکند. متدهای مختلفی از کلاس :class:`~curses.textpad.Textbox` از ویرایش با اعتبارسنجی ورودی و جمعآوری نتایج ویرایش، چه با فاصلههای انتهایی و چه بدون آنها، پشتیبانی میکنند. در ادامه مثالی آمده است::"
msgid ""
"import curses\n"
"from curses.textpad import Textbox, rectangle\n"
"\n"
"def main(stdscr):\n"
" stdscr.addstr(0, 0, \"Enter IM message: (hit Ctrl-G to send)\")\n"
"\n"
" editwin = curses.newwin(5,30, 2,1)\n"
" rectangle(stdscr, 1,0, 1+5+1, 1+30+1)\n"
" stdscr.refresh()\n"
"\n"
" box = Textbox(editwin)\n"
"\n"
" # Let the user edit until Ctrl-G is struck.\n"
" box.edit()\n"
"\n"
" # Get resulting contents\n"
" message = box.gather()"
msgstr ""
"import curses\n"
"from curses.textpad import Textbox, rectangle\n"
"\n"
"def main(stdscr):\n"
" stdscr.addstr(0, 0, \"Enter IM message: (hit Ctrl-G to send)\")\n"
"\n"
" editwin = curses.newwin(5,30, 2,1)\n"
" rectangle(stdscr, 1,0, 1+5+1, 1+30+1)\n"
" stdscr.refresh()\n"
"\n"
" box = Textbox(editwin)\n"
"\n"
" # Let the user edit until Ctrl-G is struck.\n"
" box.edit()\n"
"\n"
" # Get resulting contents\n"
" message = box.gather()"
msgid "See the library documentation on :mod:`curses.textpad` for more details."
msgstr "برای جزئیات بیشتر، مستندات کتابخانه در مورد :mod:`curses.textpad` را ببینید."
msgid "For More Information"
msgstr "برای اطلاعات بیشتر"
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، اما صفحه کتابخانه پایتون برای ماژول :mod:`curses` اکنون نسبتاً کامل است. بهتر است در ادامه آن را مرور کنید."
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 :ref:`ACS_\\* <curses-acs-codes>` characters available to you."
msgstr "اگر در مورد رفتار دقیق توابع curses تردید دارید، به صفحههای راهنمای پیادهسازی curses خود مراجعه کنید، چه ncurses باشد و چه پیادهسازی یک فروشندهی یونیکس اختصاصی. صفحههای راهنما هرگونه رفتار غیرعادی را مستند میکنند و فهرستهای کاملی از همهی توابع، ویژگیها و نویسههای :ref:`ACS_\\* <curses-acs-codes>` در دسترس شما ارائه میدهند."
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 "از آنجا که API curses بسیار بزرگ است، برخی از توابع در رابط پایتون پشتیبانی نمیشوند. اغلب این موضوع به این دلیل نیست که پیادهسازی آنها دشوار است، بلکه به این دلیل است که هنوز کسی به آنها نیاز نداشته است. همچنین، پایتون هنوز از کتابخانهی menu مرتبط با ncurses پشتیبانی نمیکند. از وصلههایی که پشتیبانی از این موارد را اضافه کنند استقبال میشود؛ برای آموختن بیشتر در مورد ارسال وصلهها به پایتون، `راهنمای توسعهدهندهی پایتون <https://devguide.python.org/>`_ را ببینید."
msgid "`Writing Programs with NCURSES <https://invisible-island.net/ncurses/ncurses-intro.html>`_: a lengthy tutorial for C programmers."
msgstr "`Writing Programs with NCURSES <https://invisible-island.net/ncurses/ncurses-intro.html>`_: آموزشی مفصل برای برنامهنویسان C."
msgid "`The ncurses man page <https://linux.die.net/man/3/ncurses>`_"
msgstr "`صفحهی man مربوط به ncurses <https://linux.die.net/man/3/ncurses>`_"
msgid "`The ncurses FAQ <https://invisible-island.net/ncurses/ncurses.faq.html>`_"
msgstr "`پرسشهای متداول ncurses <https://invisible-island.net/ncurses/ncurses.faq.html>`_"
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>`_: ویدیویی از یک سخنرانی PyCon ۲۰۱۳ در مورد کنترل پایانهها با استفاده از curses یا Urwid."
msgid "`\"Console Applications with Urwid\" <https://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\" <https://pyvideo.org/video/1568/console-applications-with-urwid>`_: ویدیویی از یک سخنرانی در PyCon CA 2012 که برخی برنامههای نوشتهشده با استفاده از Urwid را نمایش میدهد."