# Copyright (C) Weimin Wang
# This file is distributed under the same license as the PyWebIO package.
#
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
# Pikhosh <pikhosh@gmail.com>, 2022.
msgid ""
msgstr ""
"Project-Id-Version: PyWebIO 1.5.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-02-26 16:35+0330\n"
"PO-Revision-Date: 2022-03-14 02:17+0330\n"
"Last-Translator: Pikhosh <pikhosh@gmail.com>\n"
"Language-Team: Persian <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
"Language: fa\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Lokalize 21.12.2\n"

#: ../../guide.rst:2
msgid "User's guide"
msgstr "راهنمای کاربر"

#: ../../guide.rst:4
msgid ""
"If you are familiar with web development, you may not be accustomed to "
"the usage of PyWebIO described below, which is different from the "
"traditional web development pattern that backend implement api and "
"frontend display content. In PyWebIO, you only need to write code in "
"Python."
msgstr ""
"اگر شما با توسعه وب آشنایی دارید، ممکن است که به "
"استفاده از PyWebIO که در زیر توضیح داده شده عادت نداشته باشید، که از "
"الگو توسعه وب سنتی که بک اند API را پیاده سازی و "
"فرانت اند محتوا را نمایش می دهد متفاوت است. در PyWebIO، شما فقط نیاز دارید که"
" به "
"پایتون کد بنویسید."

#: ../../guide.rst:8
msgid ""
"In fact, the way of writing PyWebIO applications is more like writing a "
"console program, except that the terminal here becomes a browser. Using "
"the imperative API provided by PyWebIO, you can simply call "
"``put_text()``, ``put_image()``, ``put_table()`` and other functions to "
"output text, pictures, tables and other content to the browser, or you "
"can call some functions such as ``input()``, ``select()``, "
"``file_upload()`` to display different forms on the browser to get user "
"input. In addition, PyWebIO also provides support for click events, "
"layout, etc. PyWebIO aims to allow you to use the least code to interact "
"with the user and provide a good user experience as much as possible."
msgstr ""
"در واقع، نحوه نوشتن اپلیکیشن های PyWebIO بیشتر شبیه نوشتن یک "
"برنامه کنسول است، بجز اینکه ترمینال در اینجا تبدیل به یک مرورگر می شود. با"
" استفاده "
"از API دستوری ارائه شده توسط PyWebIO، شما می توانید به راحتی "
"``put_text()``, ``put_image()``, ``put_table()`` و توابع دیگر را برای "
"خروجی دادن متن، تصاویر، جداول و محتوا های دیگر به مرورگر فراخوانی کنید یا شما "
"می توانید برخی توابع مانند ``input()``, ``select()``, "
"``file_upload()`` را برای نمایش فرم های متفاوت روی مرورگر برای دریافت ورودی "
"کاربر فراخوانی کنید. علاوه بر این، PyWebIO همچنین پشتیبانی برای رویداد های"
" کلیک، "
"چیدمان، و... را ارائه می دهد. PyWebIO هدف دارد تا به شما اجازه دهد که از"
" کمترین کد برای تعامل "
"با کاربر استفاده کنید و یک تجربه کاربری خوب را تا حد امکان ارائه دهید."

#: ../../guide.rst:15
msgid ""
"This user guide introduces you the most of the features of PyWebIO. There"
" is a demo link at the top right of the example codes in this document, "
"where you can run the example code online and see what happens."
msgstr ""
"این راهنمای کاربر بیشتر ویژگی های PyWebIO را به شما معرفی می کند. یک"
" لینک دمو در بالا سمت راست کد های مثال در این مستندات وجود دارد، "
"جایی که شما می توانید کد مثال را به طور آنلاین اجرا کنید و ببینید که چه"
" اتفاقی می افتد."

#: ../../guide.rst:19
msgid "Input"
msgstr "ورودی"

#: ../../guide.rst:21
msgid ""
"The input functions are defined in the :doc:`pywebio.input </input>` "
"module and can be imported using ``from pywebio.input import *``."
msgstr ""

#: ../../guide.rst:23
msgid ""
"When calling the input function, an input form  will be popped up on the "
"browser. PyWebIO's input functions is blocking (same as Python's built-in"
" ``input()`` function) and will not return until the form is successfully"
" submitted."
msgstr ""

#: ../../guide.rst:27
msgid "Basic input"
msgstr "ورودی پایه"

#: ../../guide.rst:29
msgid "Here are some basic types of input."
msgstr "در اینجا برخی از انواع پایه ورودی آورده شده."

#: ../../guide.rst:31
msgid "Text input:"
msgstr "ورودی متن:"

#: ../../guide.rst:33
#, python-format
msgid ""
"age = input(\"How old are you?\", type=NUMBER)\n"
"put_text('age = %r' % age)  # ..demo-only"
msgstr ""
"age = input(\"شما چند سال دارید؟\", type=NUMBER)\n"
"put_text('سن = %r' % age)  # ..demo-only"

#: ../../guide.rst:40
msgid ""
"After running the above code, the browser will pop up a text input field "
"to get the input. After the user completes the input and submits the "
"form, the function returns the value entered by the user."
msgstr ""

#: ../../guide.rst:43
msgid "Here are some other types of input functions:"
msgstr "در اینجا برخی از انواع دیگر توابع ورودی آورده شده:"

#: ../../guide.rst:45
#, python-format
msgid ""
"# Password input\n"
"password = input(\"Input password\", type=PASSWORD)\n"
"put_text('password = %r' % password)  # ..demo-only\n"
"## ----\n"
"\n"
"# Drop-down selection\n"
"gift = select('Which gift you want?', ['keyboard', 'ipad'])\n"
"put_text('gift = %r' % gift)  # ..demo-only\n"
"## ----\n"
"\n"
"# Checkbox\n"
"agree = checkbox(\"User Term\", options=['I agree to terms and "
"conditions'])\n"
"put_text('agree = %r' % agree)  # ..demo-only\n"
"## ----\n"
"\n"
"# Single choice\n"
"answer = radio(\"Choose one\", options=['A', 'B', 'C', 'D'])\n"
"put_text('answer = %r' % answer)  # ..demo-only\n"
"## ----\n"
"\n"
"# Multi-line text input\n"
"text = textarea('Text Area', rows=3, placeholder='Some text')\n"
"put_text('text = %r' % text)  # ..demo-only\n"
"## ----\n"
"\n"
"# File Upload\n"
"img = file_upload(\"Select a image:\", accept=\"image/*\")\n"
"if img:    # ..demo-only\n"
"    put_image(img['content'], title=img['filename'])  # ..demo-only"
msgstr ""
"# Password input\n"
"password = input(\"پسورد را وارد کنید\", type=PASSWORD)\n"
"put_text('پسورد = %r' % password)  # ..demo-only\n"
"## ----\n"
"\n"
"# Drop-down selection\n"
"gift = select('شما چه هدیه ای را می خواهید؟', ['keyboard', 'ipad'])\n"
"put_text('هدیه = %r' % gift)  # ..demo-only\n"
"## ----\n"
"\n"
"# Checkbox\n"
"agree = checkbox(\"شرط کاربر\", options=['من با شرایط و ضوابط موافقت می"
" کنم'])\n"
"put_text('موافقت = %r' % agree)  # ..demo-only\n"
"## ----\n"
"\n"
"# Single choice\n"
"answer = radio(\"یکی را انتخاب کنید\", options=['A', 'B', 'C', 'D'])\n"
"put_text('پاسخ = %r' % answer)  # ..demo-only\n"
"## ----\n"
"\n"
"# Multi-line text input\n"
"text = textarea('ناحیه متن', rows=3, placeholder='قدری متن')\n"
"put_text('متن = %r' % text)  # ..demo-only\n"
"## ----\n"
"\n"
"# File Upload\n"
"img = file_upload(\"یک تصویر انتخاب کنید:\", accept=\"image/*\")\n"
"if img:    # ..demo-only\n"
"    put_image(img['content'], title=img['filename'])  # ..demo-only"

#: ../../guide.rst:81
msgid "Parameter of input functions"
msgstr "پارامتر توابع ورودی"

#: ../../guide.rst:83
msgid ""
"There are many parameters that can be passed to the input function(for "
"complete parameters, please refer to the :doc:`function document "
"</input>`):"
msgstr ""

#: ../../guide.rst:86
msgid ""
"input('This is label', type=TEXT, placeholder='This is placeholder',\n"
"        help_text='This is help text', required=True)"
msgstr ""
"input('این لیبل است', type=TEXT, placeholder='این placeholder است',\n"
"        help_text='این help text است', required=True)"

#: ../../guide.rst:93 ../../guide.rst:129 ../../guide.rst:279
#: ../../guide.rst:586
msgid "The results of the above example are as follows:"
msgstr "نتایج مثال بالا به شرح زیر است:"

#: ../../guide.rst:97
msgid ""
"You can specify a validation function for the input by using ``validate``"
" parameter. The validation function should return ``None`` when the check"
" passes, otherwise an error message will be returned:"
msgstr ""

#: ../../guide.rst:100
#, python-format
msgid ""
"def check_age(p):  # return None when the check passes, otherwise return "
"the error message\n"
"    if p < 10:\n"
"        return 'Too young!!'\n"
"    if p > 60:\n"
"        return 'Too old!!'\n"
"\n"
"age = input(\"How old are you?\", type=NUMBER, validate=check_age)\n"
"put_text('age = %r' % age)  # ..demo-only"
msgstr ""
"def check_age(p):  # return None when the check passes, otherwise return "
"the error message\n"
"    if p < 10:\n"
"        return 'خیلی جوان!!'\n"
"    if p > 60:\n"
"        return 'خیلی پیر!!'\n"
"\n"
"age = input(\"شما چند سال دارید؟\", type=NUMBER, validate=check_age)\n"
"put_text('age = %r' % age)  # ..demo-only"

#: ../../guide.rst:113
msgid ""
"When the user input an illegal value, the input field is displayed as "
"follows:"
msgstr ""

#: ../../guide.rst:117
msgid ""
"You can use ``code`` parameter in :func:`pywebio.input.textarea()` to "
"make a code editing textarea."
msgstr ""

#: ../../guide.rst:119
msgid ""
"code = textarea('Code Edit', code={\n"
"    'mode': \"python\",\n"
"    'theme': 'darcula',\n"
"}, value='import something\\n# Write your python code')\n"
"put_code(code, language='python')  # ..demo-only"
msgstr ""
"code = textarea('ویرایش کد', code={\n"
"    'mode': \"python\",\n"
"    'theme': 'darcula',\n"
"}, value='import something\\n# کد پایتون خودتان را بنویسید')\n"
"put_code(code, language='python')  # ..demo-only"

#: ../../guide.rst:135
msgid "Input Group"
msgstr "گروه ورودی"

#: ../../guide.rst:137
msgid ""
"PyWebIO uses input group to get multiple inputs in a single form. "
"`pywebio.input.input_group()` accepts a list of single input function "
"call as parameter, and returns a dictionary with the ``name`` of the "
"single input as its key and the input data as its value:"
msgstr ""

#: ../../guide.rst:142
msgid ""
"def check_age(p):  # ..demo-only\n"
"    if p < 10:                  # ..demo-only\n"
"        return 'Too young!!'    # ..demo-only\n"
"    if p > 60:                  # ..demo-only\n"
"        return 'Too old!!'      # ..demo-only\n"
"                                # ..demo-only\n"
"data = input_group(\"Basic info\",[\n"
"  input('Input your name', name='name'),\n"
"  input('Input your age', name='age', type=NUMBER, validate=check_age)\n"
"])\n"
"put_text(data['name'], data['age'])"
msgstr ""
"def check_age(p):  # ..demo-only\n"
"    if p < 10:                  # ..demo-only\n"
"        return 'خیلی جوان!!'    # ..demo-only\n"
"    if p > 60:                  # ..demo-only\n"
"        return 'خیلی پیر!!'      # ..demo-only\n"
"                                # ..demo-only\n"
"data = input_group(\"اطلاعات پایه\",[\n"
"  input('نام خود را وارد کنید', name='name'),\n"
"  input('سن خود را وارد کنید', name='age', type=NUMBER, validate=check_age)\n"
"])\n"
"put_text(data['name'], data['age'])"

#: ../../guide.rst:158
msgid ""
"The input group also supports using ``validate`` parameter to set the "
"validation function, which accepts the entire form data as parameter:"
msgstr ""

#: ../../guide.rst:160
msgid ""
"def check_age(p):  # single input item validation  # ..demo-only\n"
"    if p < 10:                  # ..demo-only\n"
"        return 'Too young!!'    # ..demo-only\n"
"    if p > 60:                  # ..demo-only\n"
"        return 'Too old!!'      # ..demo-only\n"
"                                # ..demo-only\n"
"def check_form(data):  # return (input name, error msg) when validation "
"fail\n"
"    if len(data['name']) > 6:\n"
"        return ('name', 'Name too long!')\n"
"    if data['age'] <= 0:\n"
"        return ('age', 'Age can not be negative!')\n"
"\n"
"data = input_group(\"Basic info\",[           # ..demo-only\n"
"   input('Input your name', name='name'),   # ..demo-only\n"
"   input('Input your age', name='age', type=NUMBER, validate=check_age)  "
"# ..demo-only\n"
"], validate=check_form)              # ..demo-only\n"
"put_text(data['name'], data['age'])    # ..demo-only"
msgstr ""
"def check_age(p):  # single input item validation  # ..demo-only\n"
"    if p < 10:                  # ..demo-only\n"
"        return 'خیلی جوان!!'    # ..demo-only\n"
"    if p > 60:                  # ..demo-only\n"
"        return 'خیلی پیر!!'      # ..demo-only\n"
"                                # ..demo-only\n"
"def check_form(data):  # return (input name, error msg) when validation "
"fail\n"
"    if len(data['name']) > 6:\n"
"        return ('name', 'نام خیلی طولانی است!')\n"
"    if data['age'] <= 0:\n"
"        return ('age', 'سن نمی تواند منفی باشد!')\n"
"\n"
"data = input_group(\"اطلاعات پایه\",[           # ..demo-only\n"
"   input('نام خود را وارد کنید', name='name'),   # ..demo-only\n"
"   input('سن خود را وارد کنید', name='age', type=NUMBER, validate=check_age)  "
"# ..demo-only\n"
"], validate=check_form)              # ..demo-only\n"
"put_text(data['name'], data['age'])    # ..demo-only"

#: ../../guide.rst:183
msgid ""
"PyWebIO determines whether the input function is in `input_group()` or is"
" called alone according to whether the ``name`` parameter is passed. So "
"when calling an input function alone, **do not** set the ``name`` "
"parameter; when calling the input function in `input_group()`, you "
"**must** provide the ``name`` parameter."
msgstr ""

#: ../../guide.rst:188
msgid "Output"
msgstr "خروجی"

#: ../../guide.rst:190
msgid ""
"The output functions are all defined in the :doc:`pywebio.output "
"</output>` module and can be imported using ``from pywebio.output import "
"*``."
msgstr ""

#: ../../guide.rst:193
msgid ""
"When output functions is called, the content will be output to the "
"browser in real time. The output functions can be called at any time "
"during the application lifetime."
msgstr ""

#: ../../guide.rst:197
msgid "Basic Output"
msgstr "خروجی پایه"

#: ../../guide.rst:199
msgid ""
"Using output functions, you can output a variety of content, such as "
"text, tables, images and so on:"
msgstr ""

#: ../../guide.rst:201
msgid ""
"# Text Output\n"
"put_text(\"Hello world!\")\n"
"## ----\n"
"\n"
"# Table Output\n"
"put_table([\n"
"    ['Commodity', 'Price'],\n"
"    ['Apple', '5.5'],\n"
"    ['Banana', '7'],\n"
"])\n"
"## ----\n"
"\n"
"# Image Output\n"
"put_image(open('/path/to/some/image.png', 'rb').read())  # local image # "
"..doc-only\n"
"put_image('http://example.com/some-image.png')  # internet image # ..doc-"
"only\n"
"put_image('https://www.python.org/static/img/python-logo.png')  # ..demo-"
"only\n"
"## ----\n"
"\n"
"# Markdown Output\n"
"put_markdown('~~Strikethrough~~')\n"
"## ----\n"
"\n"
"# File Output\n"
"put_file('hello_word.txt', b'hello word!')\n"
"## ----\n"
"\n"
"# Show a PopUp\n"
"popup('popup title', 'popup text content')\n"
"\n"
"# Show a notification message\n"
"toast('New message 🔔')"
msgstr ""
"# Text Output\n"
"put_text(\"سلام دنیا!\")\n"
"## ----\n"
"\n"
"# Table Output\n"
"put_table([\n"
"    ['کالا', 'قیمت'],\n"
"    ['سیب', '5.5'],\n"
"    ['موز', '7'],\n"
"])\n"
"## ----\n"
"\n"
"# Image Output\n"
"put_image(open('/path/to/some/image.png', 'rb').read())  # local image # "
"..doc-only\n"
"put_image('http://example.com/some-image.png')  # internet image # ..doc-"
"only\n"
"put_image('https://www.python.org/static/img/python-logo.png')  # ..demo-"
"only\n"
"## ----\n"
"\n"
"# Markdown Output\n"
"put_markdown('~~Strikethrough~~')\n"
"## ----\n"
"\n"
"# File Output\n"
"put_file('hello_word.txt', b'hello word!')\n"
"## ----\n"
"\n"
"# Show a PopUp\n"
"popup('popup title', 'popup text content')\n"
"\n"
"# Show a notification message\n"
"toast('New message 🔔')"

#: ../../guide.rst:238
msgid ""
"For all output functions provided by PyWebIO, please refer to the "
":doc:`pywebio.output </output>` module. In addition, PyWebIO also "
"supports data visualization with some third-party libraries, see :doc"
":`Third-party library ecology </libraries_support>`."
msgstr ""

#: ../../guide.rst:245
msgid ""
"If you use PyWebIO in interactive execution environment of Python shell, "
"IPython or jupyter notebook, you need call `show()` method explicitly to "
"show output::"
msgstr ""

#: ../../guide.rst:248
msgid ""
">>> put_text(\"Hello world!\").show()\n"
">>> put_table([\n"
"...     ['A', 'B'],\n"
"...     [put_markdown(...), put_text('C')]\n"
"... ]).show()"
msgstr ""

#: ../../guide.rst:258
msgid "Combined Output"
msgstr "خروجی ترکیبی"

#: ../../guide.rst:260
msgid ""
"The output functions whose name starts with ``put_`` can be combined with"
" some output functions as part of the final output:"
msgstr ""

#: ../../guide.rst:262
msgid ""
"You can pass ``put_xxx()`` calls to `put_table() "
"<pywebio.output.put_table>` as cell content:"
msgstr ""

#: ../../guide.rst:264
msgid ""
"put_table([\n"
"    ['Type', 'Content'],\n"
"    ['html', put_html('X<sup>2</sup>')],\n"
"    ['text', '<hr/>'],  # equal to ['text', put_text('<hr/>')]\n"
"    ['buttons', put_buttons(['A', 'B'], onclick=...)],  # ..doc-only\n"
"    ['buttons', put_buttons(['A', 'B'], onclick=put_text)],  # ..demo-"
"only\n"
"    ['markdown', put_markdown('`Awesome PyWebIO!`')],\n"
"    ['file', put_file('hello.text', b'hello world')],\n"
"    ['table', put_table([['A', 'B'], ['C', 'D']])]\n"
"])"
msgstr ""

#: ../../guide.rst:283
msgid ""
"Similarly, you can pass ``put_xxx()`` calls to `popup() "
"<pywebio.output.popup>` as the popup content:"
msgstr ""

#: ../../guide.rst:285
msgid ""
"popup('Popup title', [\n"
"    put_html('<h3>Popup Content</h3>'),\n"
"    'plain html: <br/>',  # Equivalent to: put_text('plain html: <br/>')\n"
"    put_table([['A', 'B'], ['C', 'D']]),\n"
"    put_button('close_popup()', onclick=close_popup)\n"
"])"
msgstr ""

#: ../../guide.rst:296
msgid ""
"In addition, you can use `put_widget() <pywebio.output.put_widget>` to "
"make your own output widgets that can accept ``put_xxx()`` calls."
msgstr ""

#: ../../guide.rst:298
msgid ""
"For a full list of functions that accept ``put_xxx()`` calls as content, "
"see :ref:`Output functions list <output_func_list>`"
msgstr ""

#: ../../guide.rst:300
msgid "**Context Manager**"
msgstr ""

#: ../../guide.rst:302
msgid ""
"Some output functions that accept ``put_xxx()`` calls as content can be "
"used as context manager:"
msgstr ""

#: ../../guide.rst:304
msgid ""
"with put_collapse('This is title'):\n"
"    for i in range(4):\n"
"        put_text(i)\n"
"\n"
"    put_table([\n"
"        ['Commodity', 'Price'],\n"
"        ['Apple', '5.5'],\n"
"        ['Banana', '7'],\n"
"    ])"
msgstr ""

#: ../../guide.rst:318
msgid ""
"For a full list of functions that support context manager, see "
":ref:`Output functions list <output_func_list>`"
msgstr ""

#: ../../guide.rst:324
msgid "Click Callback"
msgstr "فراخوانی کلیک"

#: ../../guide.rst:326
msgid ""
"As we can see from the above, the interaction of PyWebIO has two parts: "
"input and output. The input function of PyWebIO is blocking, a form will "
"be displayed on the user's web browser when calling input function, the "
"input function will not return until the user submits the form. The "
"output function is used to output content to the browser in real time. "
"The input and output behavior of PyWebIO is consistent with the console "
"program. That's why we say PyWebIO turning the browser into a \"rich text"
" terminal\". So you can write PyWebIO applications in script programming "
"way."
msgstr ""

#: ../../guide.rst:332
msgid ""
"In addition, PyWebIO also supports event callbacks: PyWebIO allows you to"
" output some buttons and bind callbacks to them. The provided callback "
"function will be executed when the button is clicked."
msgstr ""

#: ../../guide.rst:335
msgid "This is an example:"
msgstr "این یک مثال است:"

#: ../../guide.rst:337
#, python-format
msgid ""
"from functools import partial\n"
"\n"
"def edit_row(choice, row):\n"
"    put_text(\"You click %s button ar row %s\" % (choice, row))\n"
"\n"
"put_table([\n"
"    ['Idx', 'Actions'],\n"
"    [1, put_buttons(['edit', 'delete'], onclick=partial(edit_row, "
"row=1))],\n"
"    [2, put_buttons(['edit', 'delete'], onclick=partial(edit_row, "
"row=2))],\n"
"    [3, put_buttons(['edit', 'delete'], onclick=partial(edit_row, "
"row=3))],\n"
"])"
msgstr ""

#: ../../guide.rst:353
msgid ""
"The call to `put_table() <pywebio.output.put_table>` will not block. When"
" user clicks a button, the corresponding callback function will be "
"invoked:"
msgstr ""

#: ../../guide.rst:358
msgid "Of course, PyWebIO also supports outputting individual button:"
msgstr ""

#: ../../guide.rst:360
#, python-format
msgid ""
"def btn_click(btn_val):\n"
"    put_text(\"You click %s button\" % btn_val)\n"
"\n"
"put_buttons(['A', 'B', 'C'], onclick=btn_click)  # a group of buttons\n"
"\n"
"put_button(\"Click me\", onclick=lambda: toast(\"Clicked\"))  # single "
"button"
msgstr ""

#: ../../guide.rst:371
msgid ""
"In fact, all output can be bound to click events, not just buttons. You "
"can call ``onclick()`` method after the output function (function name "
"like ``put_xxx()``) call:"
msgstr ""

#: ../../guide.rst:374
msgid ""
"put_image('some-image.png').onclick(lambda: toast('You click an image'))"
"  # ..doc-only\n"
"put_image('https://www.python.org/static/img/python-"
"logo.png').onclick(lambda: toast('You click an image'))  # ..demo-only\n"
"\n"
"# set onclick in combined output\n"
"put_table([\n"
"    ['Commodity', 'Price'],\n"
"    ['Apple', put_text('5.5').onclick(lambda: toast('You click the "
"text'))],\n"
"])"
msgstr ""

#: ../../guide.rst:387
msgid ""
"The return value of ``onclick()`` method is the object itself so it can "
"be used in combined output."
msgstr ""

#: ../../guide.rst:392
msgid "Output Scope"
msgstr "محدوده خروجی"

#: ../../guide.rst:394
msgid ""
"PyWebIO uses the scope model to give more control to the location of "
"content output. The output scope is a container of output content. You "
"can create a scope in somewhere and append content to it."
msgstr ""

#: ../../guide.rst:397
msgid ""
"Each output function (function name like ``put_xxx()``) will output its "
"content to a scope, the default is \"current scope\". The \"current "
"scope\" is set by `use_scope() <pywebio.output.use_scope>`."
msgstr ""

#: ../../guide.rst:402
msgid "**use_scope()**"
msgstr ""

#: ../../guide.rst:404
msgid ""
"You can use `use_scope() <pywebio.output.use_scope>` to open and enter a "
"new output scope, or enter an existing output scope:"
msgstr ""

#: ../../guide.rst:406
msgid ""
"with use_scope('scope1'):  # open and enter a new output: 'scope1'\n"
"    put_text('text1 in scope1')  # output text to scope1\n"
"\n"
"put_text('text in parent scope of scope1')  # output text to ROOT scope\n"
"\n"
"with use_scope('scope1'):  # enter an existing scope: 'scope1'\n"
"    put_text('text2 in scope1')  # output text to scope1"
msgstr ""

#: ../../guide.rst:418 ../../guide.rst:439
msgid "The results of the above code are as follows::"
msgstr "نتایج کد بالا به شرح زیر است::"

#: ../../guide.rst:420
msgid ""
"text1 in scope1\n"
"text2 in scope1\n"
"text in parent scope of scope1"
msgstr ""

#: ../../guide.rst:424
msgid ""
"You can use ``clear`` parameter in `use_scope() "
"<pywebio.output.use_scope>` to clear the existing content before entering"
" the scope:"
msgstr ""

#: ../../guide.rst:426
msgid ""
"with use_scope('scope2'):\n"
"    put_text('create scope2')\n"
"\n"
"put_text('text in parent scope of scope2')\n"
"## ----\n"
"\n"
"with use_scope('scope2', clear=True):  # enter the existing scope and "
"clear the previous content\n"
"    put_text('text in scope2')"
msgstr ""

#: ../../guide.rst:441
msgid ""
"text in scope2\n"
"text in parent scope of scope2"
msgstr ""

#: ../../guide.rst:444
msgid "`use_scope() <pywebio.output.use_scope>` can also be used as decorator:"
msgstr ""

#: ../../guide.rst:446
msgid ""
"import time  # ..demo-only\n"
"from datetime import datetime\n"
"\n"
"@use_scope('time', clear=True)\n"
"def show_time():\n"
"    put_text(datetime.now())\n"
"\n"
"while 1:          # ..demo-only\n"
"   show_time()    # ..demo-only\n"
"   time.sleep(1)  # ..demo-only"
msgstr ""

#: ../../guide.rst:461
msgid ""
"When calling ``show_time()`` for the first time, a ``time`` scope will be"
" created, and the current time will be output to it. And then every time "
"the ``show_time()`` is called, the new content will replace the previous "
"content."
msgstr ""

#: ../../guide.rst:464
msgid ""
"Scopes can be nested. At the beginning, PyWebIO applications have only "
"one ``ROOT`` scope. You can create new scope in a scope. For example, the"
" following code will create 3 scopes:"
msgstr ""

#: ../../guide.rst:467
#, python-format
msgid ""
"with use_scope('A'):\n"
"    put_text('Text in scope A')\n"
"\n"
"    with use_scope('B'):\n"
"        put_text('Text in scope B')\n"
"\n"
"with use_scope('C'):\n"
"    put_text('Text in scope C')\n"
"\n"
"put_html(\"\"\"<style>                                          # ..demo-"
"only\n"
"#pywebio-scope-A {border: 1px solid red;}                    # ..demo-"
"only\n"
"#pywebio-scope-B {border: 1px solid blue;margin:2px}         # ..demo-"
"only\n"
"#pywebio-scope-C {border: 1px solid green;margin-top:2px}    # ..demo-"
"only\n"
"</style>\"\"\")                                                 # ..demo-"
"only\n"
"put_text()                                                   # ..demo-"
"only\n"
"put_buttons([('Put text to %s' % i, i) for i in ('A', 'B', 'C')], lambda "
"s: put_text(s, scope=s))  # ..demo-only"
msgstr ""

#: ../../guide.rst:489
msgid "The above code will generate the following scope layout::"
msgstr ""

#: ../../guide.rst:491
msgid ""
"┌─ROOT────────────────────┐\n"
"│                         │\n"
"│ ┌─A───────────────────┐ │\n"
"│ │ Text in scope A     │ │\n"
"│ │ ┌─B───────────────┐ │ │\n"
"│ │ │ Text in scope B │ │ │\n"
"│ │ └─────────────────┘ │ │\n"
"│ └─────────────────────┘ │\n"
"│                         │\n"
"│ ┌─C───────────────────┐ │\n"
"│ │ Text in scope C     │ │\n"
"│ └─────────────────────┘ │\n"
"└─────────────────────────┘"
msgstr ""

#: ../../guide.rst:507
msgid "**put_scope()**"
msgstr ""

#: ../../guide.rst:509
msgid ""
"We already know that the scope is a container of output content. So can "
"we use this container as a sub-item of a output (like, set a cell in "
"table as a container)? Yes, you can use `put_scope() "
"<pywebio.output.put_scope>` to create a scope explicitly. The function "
"name starts with ``put_``, which means it can be pass to the functions "
"that accept ``put_xxx()`` calls."
msgstr ""

#: ../../guide.rst:514
msgid ""
"put_table([\n"
"    ['Name', 'Hobbies'],\n"
"    ['Tom', put_scope('hobby', content=put_text('Coding'))]  # hobby is "
"initialized to coding\n"
"])\n"
"\n"
"## ----\n"
"with use_scope('hobby', clear=True):\n"
"    put_text('Movie')  # hobby is reset to Movie\n"
"\n"
"## ----\n"
"# append Music, Drama to hobby\n"
"with use_scope('hobby'):\n"
"    put_text('Music')\n"
"    put_text('Drama')\n"
"\n"
"## ----\n"
"# insert the Coding into the top of the hobby\n"
"put_markdown('**Coding**', scope='hobby', position=0)"
msgstr ""

#: ../../guide.rst:538
msgid ""
"It is not allowed to have two scopes with the same name in the "
"application."
msgstr ""

#: ../../guide.rst:540
msgid "**Scope control**"
msgstr ""

#: ../../guide.rst:542
msgid ""
"In addition to `use_scope() <pywebio.output.use_scope>` and `put_scope() "
"<pywebio.output.put_scope>`, PyWebIO also provides the following scope "
"control functions:"
msgstr ""

#: ../../guide.rst:545
msgid "`clear(scope) <pywebio.output.clear>` : Clear the contents of the scope"
msgstr ""

#: ../../guide.rst:546
msgid "`remove(scope) <pywebio.output.remove>` : Remove scope"
msgstr ""

#: ../../guide.rst:547
msgid ""
"`scroll_to(scope) <pywebio.output.scroll_to>` : Scroll the page to the "
"scope"
msgstr ""

#: ../../guide.rst:549
msgid ""
"Also, all output functions (function name like ``put_xxx()``) support a "
"``scope`` parameter to specify the destination scope to output, and "
"support a ``position`` parameter to specify the insert position in target"
" scope. Refer :ref:`output module <scope_param>` for more information."
msgstr ""

#: ../../guide.rst:554
msgid "Layout"
msgstr "چیدمان"

#: ../../guide.rst:556
msgid ""
"In general, using the output functions introduced above is enough to "
"output what you want, but these outputs are arranged vertically. If you "
"want to create a more complex layout (such as displaying a code block on "
"the left side of the page and an image on the right), you need to use "
"layout functions."
msgstr ""

#: ../../guide.rst:560
msgid ""
"The ``pywebio.output`` module provides 3 layout functions, and you can "
"create complex layouts by combining them:"
msgstr ""

#: ../../guide.rst:562
msgid ""
"`put_row() <pywebio.output.put_row>` : Use row layout to output content. "
"The content is arranged horizontally"
msgstr ""

#: ../../guide.rst:563
msgid ""
"`put_column() <pywebio.output.put_column>` : Use column layout to output "
"content. The content is arranged vertically"
msgstr ""

#: ../../guide.rst:564
msgid ""
"`put_grid() <pywebio.output.put_grid>` : Output content using grid layout"
msgstr ""

#: ../../guide.rst:566
msgid "Here is an example by combining ``put_row()`` and ``put_column()``:"
msgstr ""

#: ../../guide.rst:568
msgid ""
"put_row([\n"
"    put_column([\n"
"        put_code('A'),\n"
"        put_row([\n"
"            put_code('B1'), None,  # None represents the space between "
"the output\n"
"            put_code('B2'), None,\n"
"            put_code('B3'),\n"
"        ]),\n"
"        put_code('C'),\n"
"    ]), None,\n"
"    put_code('D'), None,\n"
"    put_code('E')\n"
"])"
msgstr ""

#: ../../guide.rst:591
msgid "The layout function also supports customizing the size of each part::"
msgstr ""

#: ../../guide.rst:593
#, python-format
msgid ""
"put_row([put_image(...), put_image(...)], size='40% 60%')  # The ratio of"
" the width of two images is 2:3"
msgstr ""

#: ../../guide.rst:595
msgid ""
"For more information, please refer to the :ref:`layout functions "
"documentation <style_and_layout>`."
msgstr ""

#: ../../guide.rst:600
msgid "Style"
msgstr "استایل"

#: ../../guide.rst:602
msgid ""
"If you are familiar with `CSS <https://en.wikipedia.org/wiki/CSS>`_ "
"styles, you can use the ``style()`` method of output return to set a "
"custom style for the output."
msgstr ""

#: ../../guide.rst:605
msgid "You can set the CSS style for a single ``put_xxx()`` output:"
msgstr ""

#: ../../guide.rst:607
msgid ""
"put_text('hello').style('color: red; font-size: 20px')\n"
"\n"
"## ----\n"
"# in combined output\n"
"put_row([\n"
"    put_text('hello').style('color: red'),\n"
"    put_markdown('markdown')\n"
"]).style('margin-top: 20px')"
msgstr ""

#: ../../guide.rst:620
msgid ""
"The return value of ``style()`` method is the object itself so it can be "
"used in combined output."
msgstr ""

#: ../../guide.rst:625
msgid "Run application"
msgstr "اجرای اپلیکیشن"

#: ../../guide.rst:627
msgid ""
"In PyWebIO, there are two modes to run PyWebIO applications: running as a"
" script and using `pywebio.start_server() "
"<pywebio.platform.tornado.start_server>` or "
"`pywebio.platform.path_deploy() <pywebio.platform.path_deploy>` to run as"
" a web service."
msgstr ""

#: ../../guide.rst:632
msgid "Overview"
msgstr "بررسی اجمالی"

#: ../../guide.rst:636 ../../guide.rst:701
msgid "**Server mode**"
msgstr "**حالت سرور**"

#: ../../guide.rst:638
msgid ""
"In server mode, PyWebIO will start a web server to continuously provide "
"services. When the user accesses the service address, PyWebIO will open a"
" new session and run PyWebIO application in it."
msgstr ""

#: ../../guide.rst:641
msgid ""
"`start_server() <pywebio.platform.tornado.start_server>` is the most "
"common way to start a web server to serve given PyWebIO applications::"
msgstr ""

#: ../../guide.rst:644
msgid ""
"from pywebio import *\n"
"\n"
"def main():  # PyWebIO application function\n"
"    name = input.input(\"what's your name\")\n"
"    output.put_text(\"hello\", name)\n"
"\n"
"start_server(main, port=8080, debug=True)"
msgstr ""

#: ../../guide.rst:652
msgid ""
"Now head over to http://127.0.0.1:8080/, and you should see your hello "
"greeting."
msgstr ""

#: ../../guide.rst:654
msgid ""
"By using ``debug=True`` to enable debug mode, the server will "
"automatically reload if code changes."
msgstr ""

#: ../../guide.rst:656
msgid ""
"The `start_server() <pywebio.platform.tornado.start_server>` provide a "
"remote access support, when enabled (by passing `remote_access=True` to "
"`start_server()`), you will get a public, shareable address for the "
"current application, others can access your application in their browser "
"via this address. Because the processing happens on your device (as long "
"as your device stays on!), you don't have to worry about any "
"dependencies. Using remote access makes it easy to temporarily share the "
"application with others."
msgstr ""

#: ../../guide.rst:662
msgid ""
"Another way to deploy PyWebIO application as web service is using "
"`path_deploy() <pywebio.platform.path_deploy>`. `path_deploy() "
"<pywebio.platform.path_deploy>` is used to deploy the PyWebIO "
"applications from a directory. Just define PyWebIO applications in python"
" files under this directory, and you can access them via the path in the "
"URL. Refer to :ref:`platform module <dir_deploy>` for more information."
msgstr ""

#: ../../guide.rst:669
msgid ""
"Note that in Server mode, all functions from ``pywebio.input``, "
"``pywebio.output`` and ``pywebio.session`` modules can only be called in "
"the context of PyWebIO application functions. For example, the following "
"code is **not allowed**::"
msgstr ""

#: ../../guide.rst:672
msgid ""
"import pywebio\n"
"from pywebio.input import input\n"
"\n"
"port = input('Input port number:')   # ❌ error\n"
"pywebio.start_server(my_task_func, port=int(port))"
msgstr ""

#: ../../guide.rst:679 ../../guide.rst:696
msgid "**Script mode**"
msgstr "**حالت اسکریپت**"

#: ../../guide.rst:681
msgid ""
"If you never call ``start_server()`` or ``path_deploy()`` in your code, "
"then you are running PyWebIO application as script mode."
msgstr ""

#: ../../guide.rst:683
msgid ""
"In script mode, a web browser page will be open automatically when "
"running to the first call to PyWebIO interactive functions, and all "
"subsequent PyWebIO interactions will take place on this page. When the "
"script exit, the page will be inactive."
msgstr ""

#: ../../guide.rst:686
msgid ""
"If the user closes the browser before the script exiting, then subsequent"
" calls to PyWebIO's interactive functions will cause a `SessionException "
"<pywebio.exceptions.SessionException>` exception."
msgstr ""

#: ../../guide.rst:692
msgid "Concurrent"
msgstr "هم زمان"

#: ../../guide.rst:694
msgid "PyWebIO can be used in a multi-threading environment."
msgstr ""

#: ../../guide.rst:698
msgid ""
"In script mode, you can freely start new thread and call PyWebIO "
"interactive functions in it. When all `non-daemonic "
"<https://docs.python.org/3/library/threading.html#thread-objects>`_ "
"threads finish running, the script exits."
msgstr ""

#: ../../guide.rst:703
msgid ""
"In server mode, if you need to use PyWebIO interactive functions in new "
"thread, you need to use `pywebio.session.register_thread(thread) "
"<pywebio.session.register_thread>` to register the new thread (so that "
"PyWebIO can know which session the thread belongs to). If the PyWebIO "
"interactive function is not used in the new thread, no registration is "
"required. Threads that are not registered with `register_thread(thread) "
"<pywebio.session.register_thread>` calling PyWebIO's interactive "
"functions will cause `SessionNotFoundException "
"<pywebio.exceptions.SessionNotFoundException>`."
msgstr ""

#: ../../guide.rst:710
msgid "Example of using multi-threading in Server mode::"
msgstr ""

#: ../../guide.rst:712
msgid ""
"def show_time():\n"
"    while True:\n"
"        with use_scope(name='time', clear=True):\n"
"            put_text(datetime.datetime.now())\n"
"            time.sleep(1)\n"
"\n"
"def app():\n"
"    t = threading.Thread(target=show_time)\n"
"    register_thread(t)\n"
"    put_markdown('## Clock')\n"
"    t.start()  # run `show_time()` in background\n"
"\n"
"    # ❌ this thread will cause `SessionNotFoundException`\n"
"    threading.Thread(target=show_time).start()\n"
"\n"
"    put_text('Background task started.')\n"
"\n"
"\n"
"start_server(app, port=8080, debug=True)"
msgstr ""

#: ../../guide.rst:736
msgid "Close of session"
msgstr ""

#: ../../guide.rst:738
msgid ""
"When user close the browser page, the session will be closed. After the "
"browser page is closed, PyWebIO input function calls that have not yet "
"returned in the current session will cause `SessionClosedException "
"<pywebio.exceptions.SessionClosedException>`, and subsequent calls to "
"PyWebIO interactive functions will cause `SessionNotFoundException "
"<pywebio.exceptions.SessionNotFoundException>` or `SessionClosedException"
" <pywebio.exceptions.SessionClosedException>`."
msgstr ""

#: ../../guide.rst:743
msgid ""
"In most cases, you don't need to catch those exceptions, because let "
"those exceptions to abort the running is the right way to exit."
msgstr ""

#: ../../guide.rst:745
msgid ""
"You can use `pywebio.session.defer_call(func) "
"<pywebio.session.defer_call>` to set the function to be called when the "
"session closes. `defer_call(func) <pywebio.session.defer_call>` can be "
"used for resource cleaning. You can call `defer_call(func) "
"<pywebio.session.defer_call>` multiple times in the session, and the set "
"functions will be executed sequentially after the session closes."
msgstr ""

#: ../../guide.rst:751
msgid "More about PyWebIO"
msgstr "اطلاعات بیشتر درباره PyWebIO"

#: ../../guide.rst:752
msgid ""
"By now, you already get the most important features of PyWebIO and can "
"start to write awesome PyWebIO applications. However, there are some "
"other useful features we don't cover in the above. Here we just make a "
"briefly explain about them. When you need them in your application, you "
"can refer to their document."
msgstr ""

#: ../../guide.rst:756
msgid ""
"Also, :doc:`here </cookbook>` is a cookbook where you can find some "
"useful code snippets for your PyWebIO application."
msgstr ""

#: ../../guide.rst:759
msgid "``session`` module"
msgstr "ماژول ``session``"

#: ../../guide.rst:760
msgid ""
"The :doc:`pywebio.session </session>` module give you more control to "
"session."
msgstr ""

#: ../../guide.rst:762
msgid ""
"Use `set_env() <pywebio.session.set_env>` to configure the title, page "
"appearance, input panel and so on for current session."
msgstr ""

#: ../../guide.rst:764
msgid ""
"The `info <pywebio.session.info>` object provides a lot information about"
" the current session, such as the user IP address, user language and user"
" browser information."
msgstr ""

#: ../../guide.rst:767
msgid ""
"`local <pywebio.session.local>` is a session-local storage, it used to "
"save data whose values are session specific."
msgstr ""

#: ../../guide.rst:769
msgid ""
"`run_js() <pywebio.session.run_js>` let you execute JavaScript code in "
"user's browser, and `eval_js() <pywebio.session.eval_js>` let you execute"
" JavaScript expression and get the value of it."
msgstr ""

#: ../../guide.rst:773
msgid "``pin`` module"
msgstr "ماژول ``pin``"

#: ../../guide.rst:774
msgid ""
"As you already know, the input function of PyWebIO is blocking and the "
"input form will be destroyed after successful submission. In some cases, "
"you may want to make the input form not disappear after submission, and "
"can continue to receive input. So PyWebIO provides the :doc:`pywebio.pin "
"</pin>` module to achieve persistent input by pinning input widgets to "
"the page."
msgstr ""

#: ../../guide.rst:779
msgid "``platform`` module"
msgstr "ماژول ``platform``"

#: ../../guide.rst:781
msgid ""
"The :doc:`pywebio.platform </platform>` module provides support for "
"deploying PyWebIO applications in different ways."
msgstr ""

#: ../../guide.rst:783
msgid ""
"There are two protocols (WebSocket and HTTP) can be used in server to "
"communicates with the browser. The WebSocket is used by default. If you "
"want to use HTTP protocol, you can choose other ``start_server()`` "
"functions in this module."
msgstr ""

#: ../../guide.rst:786
msgid ""
"You might want to set some web page related configuration (such as SEO "
"information, js and css injection) for your PyWebIO application, "
"`pywebio.config() <pywebio.config>` can be helpful."
msgstr ""

#: ../../guide.rst:790
msgid "Advanced features"
msgstr "ویژگی های پیشرفته"

#: ../../guide.rst:792
msgid ""
"The PyWebIO application can be integrated into an existing Python web "
"project, the PyWebIO application and the web project share a web "
"framework. Refer to :ref:`Advanced Topic: Integration with Web Framework "
"<integration_web_framework>` for more information."
msgstr ""

#: ../../guide.rst:796
msgid ""
"PyWebIO also provides support for coroutine-based sessions. Refer to "
":ref:`Advanced Topic: Coroutine-based session <coroutine_based_session>` "
"for more information."
msgstr ""

#: ../../guide.rst:799
msgid ""
"If you try to bundles your PyWebIO application into a stand-alone "
"executable file, to make users can run the application without installing"
" a Python interpreter or any modules, you might want to refer to "
":ref:`Libraries support: Build stand-alone App <stand_alone_app>`"
msgstr ""

#: ../../guide.rst:802
msgid ""
"If you want to make some data visualization in your PyWebIO application, "
"you can't miss :ref:`Libraries support: Data visualization "
"<visualization>`"
msgstr ""

#: ../../guide.rst:805
msgid "Last but not least"
msgstr "آخرین اما نه کم اهمیت ترین"

#: ../../guide.rst:807
msgid ""
"This is basically all features of PyWebIO, you can continue to read the "
"rest of the documents, or start writing your PyWebIO applications now."
msgstr ""

#: ../../guide.rst:809
msgid ""
"Finally, please allow me to provide one more suggestion. When you "
"encounter a design problem when using PyWebIO, you can ask yourself a "
"question: What would I do if it is in a terminal program? If you already "
"have the answer, it can be done in the same way with PyWebIO. If the "
"problem persists or the solution is not good enough, you can consider the"
" :ref:`callback mechanism <callback>` or  :doc:`pin <./pin>` module."
msgstr ""

#: ../../guide.rst:814
msgid "OK, Have fun with PyWebIO!"
msgstr "خیلی خب، با PyWebIO اوقات خوشی را داشته باشید!"

