-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathatexit.po
More file actions
158 lines (133 loc) · 13.5 KB
/
Copy pathatexit.po
File metadata and controls
158 lines (133 loc) · 13.5 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
# 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:
# Revisto <theRevisto@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-15 11:33+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 ":mod:`!atexit` --- Exit handlers"
msgstr ":mod:`!atexit` --- هندلرهای خروج"
msgid "The :mod:`!atexit` module defines functions to register and unregister :dfn:`exit handlers`: functions that are automatically executed \"at exit\", that is, upon normal program termination (for instance, if :func:`sys.exit` is called or the main module's execution completes) or, more generally, upon :term:`interpreter shutdown`."
msgstr "ماژول :mod:`!atexit` توابعی را برای ثبت و لغو ثبت :dfn:`هندلرهای خروج (exit handlers)` تعریف میکند: توابعی که بهصورت خودکار «در خروج» اجرا میشوند، یعنی در هنگام خاتمهی عادی برنامه (مثلاً اگر :func:`sys.exit` فراخوانی شود یا اجرای ماژول اصلی کامل شود) یا، بهصورت کلیتر، در هنگام :term:`خاتمهی مفسر <interpreter shutdown>`."
msgid "At exit, all registered exit handlers are called in the *reverse* order in which they were registered. If you register ``A``, ``B``, and ``C``, at interpreter shutdown time they will be run in the order ``C``, ``B``, ``A``. The assumption is that lower level modules will normally be imported before higher level modules and thus must be cleaned up later."
msgstr "در خروج، تمام هندلرهای خروج ثبتشده به ترتیب *معکوس* ترتیبی که ثبت شدهاند فراخوانی میشوند. اگر ``A``، ``B``، و ``C`` را ثبت کنید، در زمان خاتمهی مفسر آنها به ترتیب ``C``، ``B``، ``A`` اجرا خواهند شد. فرض این است که ماژولهای سطح پایین معمولاً قبل از ماژولهای سطح بالا وارد (import) میشوند و بنابراین باید بعداً پاکسازی شوند."
msgid "If an exception is raised during execution of an exit handler, a traceback is printed (unless :exc:`SystemExit` is raised) and the exception information is saved. After all exit handlers have had a chance to run, the last exception to be raised is re-raised."
msgstr "اگر یک استثنا در طول اجرای یک هندلر خروج رخ دهد، یک ردگیری چاپ میشود (مگر اینکه :exc:`SystemExit` رخ دهد) و اطلاعات استثنا ذخیره میشود. پس از اینکه تمام هندلرهای خروج فرصت اجرا را داشته باشند، آخرین استثنای رخداده مجدداً پرتاب میشود."
msgid "In programs that use multiple interpreters, each interpreter has its own stack of exit handlers, which are executed when the interpreter shuts down (for example, with :meth:`concurrent.interpreters.Interpreter.close` or the C API :c:func:`Py_EndInterpreter`). Registration functions in this module only affect the interpreter they are called from."
msgstr "در برنامههایی که از چندین مفسر استفاده میکنند، هر مفسر پشتهی خودِ هندلرهای خروج را دارد، که هنگام خاتمهی مفسر اجرا میشوند (مثلاً با :meth:`concurrent.interpreters.Interpreter.close` یا API زبان C :c:func:`Py_EndInterpreter`). توابع ثبت در این ماژول تنها بر مفسری که از آن فراخوانی شدهاند تأثیر میگذارند."
msgid "**Note:** Exit handlers are not called when the program is killed by a signal not handled by Python, when a Python fatal internal error is detected, or when :func:`os._exit` is called."
msgstr "**نکته:** هندلرهای خروج فراخوانی نمیشوند وقتی برنامه توسط سیگنالی که توسط پایتون مدیریت نمیشود متوقف میشود، وقتی یک خطای داخلی مهلک پایتون شناسایی میشود، یا وقتی :func:`os._exit` فراخوانی میشود."
msgid "**Note:** The effect of registering or unregistering functions from within a cleanup function is undefined."
msgstr "**توجه:** اثر ثبت یا لغو ثبت توابع از درون یک تابع پاکسازی تعریفنشده است."
msgid "When writing exit handlers, especially in C API extensions, keep in mind that other exit handlers may still run arbitrary Python code after you clean up. Such code should succeed or fail with an exception, rather than crash."
msgstr "هنگام نوشتن هندلرهای خروج، بهویژه در افزونههای API زبان C، به یاد داشته باشید که سایر هندلرهای خروج همچنان ممکن است کد پایتون دلخواه را پس از پاکسازی شما اجرا کنند. چنین کدی باید با موفقیت انجام شود یا با یک استثنا شکست بخورد، نه اینکه باعث فروپاشی شود."
msgid "Attempts to start a new thread or :func:`os.fork` a new process in an exit handler now leads to :exc:`RuntimeError`. Previously, this could cause race conditions between the main Python runtime thread freeing thread states while internal :mod:`threading` routines or the new process try to use that state, which could lead to crashes rather than clean shutdown."
msgstr "تلاش برای شروع یک نخ جدید یا :func:`os.fork` یک فرایند جدید در یک هندلر خروج اکنون منجر به :exc:`RuntimeError` میشود. پیش از این، این میتوانست شرایط رقابتی را بین نخ اصلی رانتایم پایتون که وضعیت نخها را آزاد میکند در حالی که روالهای داخلی :mod:`threading` یا فرایند جدید سعی در استفاده از آن وضعیت دارند، ایجاد کند که میتوانست منجر به فروپاشی شود تا خاتمهی تمیز."
msgid "When used with subinterpreters, registered functions are local to the interpreter they were registered in."
msgstr "هنگام استفاده با زیرمفسرها، توابع ثبتشده محلی به مفسری هستند که در آن ثبت شدهاند."
msgid "Register *func* as an exit handler. Any optional arguments that are to be passed to *func* must be passed as arguments to :func:`register`. It is possible to register the same function and arguments more than once."
msgstr "*func* را به عنوان یک هندلر خروج ثبت کنید. هر آرگومان اختیاری که قرار است به *func* پاس داده شود باید به عنوان آرگومان به :func:`register` پاس داده شود. امکان ثبت یک تابع و آرگومانهای یکسان بیش از یک بار وجود دارد."
msgid "This function returns *func*, which makes it possible to use it as a decorator."
msgstr "این تابع، *func* را برمیگرداند که امکان استفاده از آن بهعنوان دکوراتور را فراهم میکند."
msgid "Remove *func* from the list of exit handlers. :func:`unregister` silently does nothing if *func* was not previously registered. If *func* has been registered more than once, every occurrence of that function in the :mod:`!atexit` call stack will be removed. Equality comparisons (``==``) are used internally during unregistration, so function references do not need to have matching identities."
msgstr "*func* را از فهرست هندلرهای خروج حذف کنید. اگر *func* قبلاً ثبت نشده باشد، :func:`unregister` بهصورت بیصدا کاری انجام نمیدهد. اگر *func* بیش از یک بار ثبت شده باشد، هر وقوع از آن تابع در پشتهی فراخوانی :mod:`!atexit` حذف خواهد شد. مقایسههای برابری (``==``) بهصورت داخلی در طول لغو ثبت استفاده میشوند، بنابراین ارجاعهای تابع نیازی به داشتن هویتهای مطابق ندارند."
msgid "Module :mod:`readline`"
msgstr "ماژول :mod:`readline`"
msgid "Useful example of :mod:`!atexit` to read and write :mod:`readline` history files."
msgstr "مثالی مفید از :mod:`!atexit` برای خواندن و نوشتن پروندههای تاریخچهی :mod:`readline`."
msgid ":mod:`!atexit` Example"
msgstr "مثال :mod:`!atexit`"
msgid "The following simple example demonstrates how a module can initialize a counter from a file when it is imported and save the counter's updated value automatically when the program terminates without relying on the application making an explicit call into this module at termination. ::"
msgstr "مثال سادهی زیر نشان میدهد که چگونه یک ماژول میتواند هنگامی که ایمپورت میشود، یک شمارنده را از یک پرونده مقداردهی اولیه کند و مقدار بهروزشدهی شمارنده را بهصورت خودکار هنگام پایان برنامه ذخیره کند، بدون اینکه به فراخوانی صریح این ماژول توسط برنامه کاربردی در زمان پایان نیاز باشد. ::"
msgid ""
"try:\n"
" with open('counterfile') as infile:\n"
" _count = int(infile.read())\n"
"except FileNotFoundError:\n"
" _count = 0\n"
"\n"
"def incrcounter(n):\n"
" global _count\n"
" _count = _count + n\n"
"\n"
"def savecounter():\n"
" with open('counterfile', 'w') as outfile:\n"
" outfile.write('%d' % _count)\n"
"\n"
"import atexit\n"
"\n"
"atexit.register(savecounter)"
msgstr ""
"try:\n"
" with open('counterfile') as infile:\n"
" _count = int(infile.read())\n"
"except FileNotFoundError:\n"
" _count = 0\n"
"\n"
"def incrcounter(n):\n"
" global _count\n"
" _count = _count + n\n"
"\n"
"def savecounter():\n"
" with open('counterfile', 'w') as outfile:\n"
" outfile.write('%d' % _count)\n"
"\n"
"import atexit\n"
"\n"
"atexit.register(savecounter)"
msgid "Positional and keyword arguments may also be passed to :func:`register` to be passed along to the registered function when it is called::"
msgstr "همچنین میتوان آرگومانهای جایگاهی و کلیدواژهای را به :func:`register` ارسال کرد تا در زمان فراخوانی تابع ثبتشده، به آن تابع ارسال شوند::"
msgid ""
"def goodbye(name, adjective):\n"
" print('Goodbye %s, it was %s to meet you.' % (name, adjective))\n"
"\n"
"import atexit\n"
"\n"
"atexit.register(goodbye, 'Donny', 'nice')\n"
"# or:\n"
"atexit.register(goodbye, adjective='nice', name='Donny')"
msgstr ""
"def goodbye(name, adjective):\n"
" print('Goodbye %s, it was %s to meet you.' % (name, adjective))\n"
"\n"
"import atexit\n"
"\n"
"atexit.register(goodbye, 'Donny', 'nice')\n"
"# or:\n"
"atexit.register(goodbye, adjective='nice', name='Donny')"
msgid "Usage as a :term:`decorator`::"
msgstr "استفاده بهعنوان یک :term:`دکوراتور <decorator>`::"
msgid ""
"import atexit\n"
"\n"
"@atexit.register\n"
"def goodbye():\n"
" print('You are now leaving the Python sector.')"
msgstr ""
"import atexit\n"
"\n"
"@atexit.register\n"
"def goodbye():\n"
" print('You are now leaving the Python sector.')"
msgid "This only works with functions that can be called without arguments."
msgstr "این تنها با توابعی کار میکند که بتوان آنها را بدون آرگومان فراخوانی کرد."
#~ msgid "The :mod:`!atexit` module defines functions to register and unregister cleanup functions. Functions thus registered are automatically executed upon normal interpreter termination. :mod:`!atexit` runs these functions in the *reverse* order in which they were registered; if you register ``A``, ``B``, and ``C``, at interpreter termination time they will be run in the order ``C``, ``B``, ``A``."
#~ msgstr "ماژول :mod:`!atexit` توابعی را برای ثبت و لغو ثبت توابع پاکسازی تعریف میکند. توابعی که بدین ترتیب ثبت شوند، بهطور خودکار در زمان خاتمه عادی مفسر اجرا میشوند. :mod:`!atexit` این توابع را به ترتیب *معکوس* ثبت اجرا میکند؛ اگر ``A``، ``B`` و ``C`` را ثبت کنید، در زمان خاتمه مفسر به ترتیب ``C``، ``B``، ``A`` اجرا خواهند شد."
#~ msgid "Attempts to start a new thread or :func:`os.fork` a new process in a registered function now leads to :exc:`RuntimeError`."
#~ msgstr "تلاش برای آغاز یک نخ جدید یا ایجاد یک فرآیند جدید با :func:`os.fork` در یک تابع ثبتشده اکنون منجر به :exc:`RuntimeError` میشود."