# SOME DESCRIPTIVE TITLE. # Copyright (C) Kovid Goyal # This file is distributed under the same license as the calibre package. # # Translators: # Andrei Stepanov, 2026 # ashed , 2020-2023,2025-2026 # Родион Р., 2020 # Родион Р., 2019 msgid "" msgstr "" "Project-Id-Version: calibre\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 16:50+0000\n" "PO-Revision-Date: 2014-06-17 08:34+0000\n" "Last-Translator: Andrei Stepanov, 2026\n" "Language-Team: Russian (http://app.transifex.com/calibre/calibre/language/ru/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ru\n" "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" #: ../../../__w/calibre/calibre/manual/develop.rst:4 msgid "Setting up a calibre development environment" msgstr "Настройка среды разработки calibre" #: ../../../__w/calibre/calibre/manual/develop.rst:6 msgid "" "calibre is completely open source, licensed under the `GNU GPL v3 " "`_. This means that you are free to " "download and modify the program to your heart's content. In this section, " "you will learn how to get a calibre development environment set up on the " "operating system of your choice. calibre is written primarily in `Python " "`_ with some C/C++ code for speed and system " "interfacing. Note that calibre requires at least Python 3.8." msgstr "У calibre полностью открытый исходный код, лицензированный `GNU GPL v3 `_. То есть вы можете загружать и изменять программу по собственному желанию. В этом разделе вы узнаете, как настроить среду разработки calibre на выбранной операционной системе. В основном calibre написана на `Python `_ со вставками кода на C/C++ для повышения скорости и взаимодействия с системой. Обратите внимание, что calibre требует, как минимум, Python 3.8." #: ../../../__w/calibre/calibre/manual/develop.rst:14 msgid "Contents" msgstr "Содержание" #: ../../../__w/calibre/calibre/manual/develop.rst:17 msgid "Design philosophy" msgstr "Философия разработки" #: ../../../__w/calibre/calibre/manual/develop.rst:19 msgid "" "calibre has its roots in the Unix world, which means that its design is " "highly modular. The modules interact with each other via well defined " "interfaces. This makes adding new features and fixing bugs in calibre very " "easy, resulting in a frenetic pace of development. Because of its roots, " "calibre has a comprehensive command line interface for all its functions, " "documented in :doc:`generated/en/cli-index`." msgstr "Истоки calibre лежат в мире Unix, что означает высокую модульность её дизайна. Модули взаимодействуют друг с другом через чётко определённые интерфейсы. Это заметно облегчает добавление новых возможностей и исправление ошибок, вызывая бурный темп развития. Из-за своих корней calibre имеет полноценный интерфейс командной строки для всех функций, задокументированный в разделе «:doc:`generated/ru/cli-index`»." #: ../../../__w/calibre/calibre/manual/develop.rst:24 msgid "" "The modular design of calibre is expressed via ``Plugins``. There is a " ":ref:`tutorial ` on writing calibre plugins. For example, adding " "support for a new device to calibre typically involves writing fewer than " "100 lines of code in the form of a device driver plugin. You can browse the " "`built-in drivers " "`_. " "Similarly, adding support for new conversion formats involves writing " "input/output format plugins. Another example of the modular design is the " ":ref:`recipe system ` for fetching news. For more examples of plugins " "designed to add features to calibre, see the `Index of plugins " "`_." msgstr "Модульная конструкция calibre выражается через «Плагины». Существует :ref:`tutorial` по написанию плагинов calibre. Напр., добавление поддержки нового устройства в calibre обычно включает в себя написание менее 100 строк кода в виде плагина драйвера устройства. Вы можете просмотреть `встроенные драйверы `_. Точно так же добавление поддержки новых форматов преобразования включает в себя написание плагинов формата ввода/вывода. Другим примером модульного дизайна является :ref:`recipe system` для получения новостей. Дополнительные примеры плагинов, предназначенных для добавления функций в calibre, см. В разделе «Индекс плагинов `_." #: ../../../__w/calibre/calibre/manual/develop.rst:34 msgid "Code layout" msgstr "Макет кода" #: ../../../__w/calibre/calibre/manual/develop.rst:36 msgid "" "All the calibre Python code is in the ``calibre`` package. This package " "contains the following main sub-packages" msgstr "Весь Python код calibre находится в пакете ``calibre``. Этот пакет содержит следующие основные подпакеты" #: ../../../__w/calibre/calibre/manual/develop.rst:38 msgid "" "devices - All the device drivers. Just look through some of the built-in " "drivers to get an idea for how they work." msgstr "devices — все драйверы устройств. Просто просмотрите некоторые встроенные драйверы, чтобы понять, как они работают." #: ../../../__w/calibre/calibre/manual/develop.rst:40 msgid "" "For details, see: ``devices.interface`` which defines the interface " "supported by device drivers and ``devices.usbms`` which defines a generic " "driver that connects to a USBMS device. All USBMS based drivers in calibre " "inherit from it." msgstr "Подробнее см.: ``devices.interface``, определяющий интерфейс, поддерживаемый драйверами устройств, и ``devices.usbms``, определяющий универсальный драйвер, который подключается к устройству USBMS. Все драйверы calibre на базе USBMS наследуются от него." #: ../../../__w/calibre/calibre/manual/develop.rst:43 msgid "" "e-books - All the e-book conversion/metadata code. A good starting point is" " ``calibre.ebooks.conversion.cli`` which is the module powering the " ":command:`ebook-convert` command. The conversion process is controlled via " "``conversion.plumber``. The format independent code is all in ``ebooks.oeb``" " and the format dependent code is in ``ebooks.format_name``." msgstr "e-books — весь код преобразования электронных книг/метаданных. Хорошая отправная точка — ``calibre.ebooks.conversion.cli``, который является модулем, включающим команду :command:`ebook-convert`. Процесс преобразования контролируется через ``translation.plumber``. Код, не зависящий от формата, находится в ``ebooks.oeb``, а код, зависящий от формата, — в ``ebooks.format_name``." #: ../../../__w/calibre/calibre/manual/develop.rst:47 msgid "" "Metadata reading, writing, and downloading is all in ``ebooks.metadata``" msgstr "Чтение, запись и загрузка метаданных — всё это в ``ebooks.metadata``" #: ../../../__w/calibre/calibre/manual/develop.rst:48 msgid "" "Conversion happens in a pipeline, for the structure of the pipeline, see " ":ref:`conversion-introduction`. The pipeline consists of an input plugin, " "various transforms and an output plugin. The code that constructs and drives" " the pipeline is in :file:`plumber.py`. The pipeline works on a " "representation of an e-book that is like an unzipped epub, with manifest, " "spine, toc, guide, html content, etc. The class that manages this " "representation is OEBBook in ``ebooks.oeb.base``. The various " "transformations that are applied to the book during conversions live in " ":file:`oeb/transforms/*.py`. And the input and output plugins live in " ":file:`conversion/plugins/*.py`." msgstr "Преобразование происходит в конвейере (о структуре конвейера см. :ref:`conversion-introduction`). Конвейер состоит из входного плагина, различных трансформаций и выходного плагина. Код, который создаёт и управляет конвейером, находится в :file:`plumber.py`. Конвейер работает над представлением электронной книги, похожей на разархивированный epub, с манифестом, spine, toc, guide, html-содержимым и т. д. Класс, который управляет этим представлением, — OEBBook в ``ebooks.oeb.base``, различные трансформации, применяемые к книге во время конвертации, находятся в :file:`oeb/transforms/*.py`. А входные и выходные плагины — в :file:`translation/plugins/*.py`." #: ../../../__w/calibre/calibre/manual/develop.rst:58 msgid "" "E-book editing happens using a different container object. It is documented " "in :ref:`polish_api`." msgstr "Редактирование электронной книги происходит с использованием другого объекта контейнера. Это задокументировано в :ref:`polish_api`." #: ../../../__w/calibre/calibre/manual/develop.rst:61 msgid "" "db - The database back-end. See :ref:`db_api` for the interface to the " "calibre library." msgstr "db — серверная часть базы данных. См.: :ref:`db_api` об интерфейсе библиотеки calibre." #: ../../../__w/calibre/calibre/manual/develop.rst:63 msgid "Content server: ``srv`` is the calibre Content server." msgstr "Контент-сервер: ``srv`` — это контент-сервер calibre." #: ../../../__w/calibre/calibre/manual/develop.rst:65 msgid "" "gui2 - The Graphical User Interface. GUI initialization happens in " "``gui2.main`` and ``gui2.ui``. The e-book-viewer is in ``gui2.viewer``. The " "e-book editor is in ``gui2.tweak_book``." msgstr "gui2 — графический интерфейс пользователя. Инициализация GUI происходит в ``gui2.main`` и ``gui2.ui``. Программа просмотра электронных книг находится в ``gui2.viewer``. Редактор электронных книг находится в ``gui2.tweak_book``." #: ../../../__w/calibre/calibre/manual/develop.rst:67 msgid "" "If you want to locate the entry points for all the various calibre " "executables, look at the ``entry_points`` structure in `linux.py " "`_." msgstr "Если вы хотите найти точки входа для всех исполняемых файлов calibre различного уровня, посмотрите на структуру ``entry_points`` в `linux.py `_." #: ../../../__w/calibre/calibre/manual/develop.rst:71 msgid "" "If you need help understanding the code, post in the `development forum " "`_ and you will " "most likely get help from one of calibre's many developers." msgstr "Если вам нужна помощь в понимании кода, отправьте сообщение на `форум разработчиков `_, и вы, скорее всего, получите помощь от одного из многих разработчиков calibre." #: ../../../__w/calibre/calibre/manual/develop.rst:75 msgid "Getting the code" msgstr "Получение кода" #: ../../../__w/calibre/calibre/manual/develop.rst:77 msgid "" "You can get the calibre source code in two ways, using a version control " "system or directly downloading a :website_base:`tarball `." msgstr "Получить исходный код calibre можно двумя способами: при помощи системы управления версиями или прямой загрузкой архива :website_base:`tarball `." #: ../../../__w/calibre/calibre/manual/develop.rst:80 msgid "" "calibre uses `Git `_, a distributed version " "control system. Git is available on all the platforms calibre supports. " "After installing Git, you can get the calibre source code with the command::" msgstr "calibre использует `Git `_, распределенную систему контроля версий. Git доступен на всех платформах, поддерживаемых calibre. После установки Git вы можете получить исходный код calibre с помощью команды::" #: ../../../__w/calibre/calibre/manual/develop.rst:86 msgid "" "On Windows you will need the complete path name, that will be something like" " :file:`C:\\\\Program Files\\\\Git\\\\git.exe`." msgstr "В Windows вам потребуется полный путь, который будет выглядеть примерно так :file:`C:\\\\Program Files\\\\Git\\\\git.exe`." #: ../../../__w/calibre/calibre/manual/develop.rst:88 msgid "" "calibre is a very large project with a very long source control history, so " "the above can take a while (10 mins to an hour depending on your internet " "speed)." msgstr "calibre — это очень большой проект с очень длинной историей управления исходным кодом, поэтому описанное выше может занять некоторое время (от 10 минут до часа в зависимости от скорости вашего интернета)." #: ../../../__w/calibre/calibre/manual/develop.rst:91 msgid "" "If you want to get the code faster, the source code for the latest release " "is always available as an :website_base:`archive `." msgstr "Хотите получить код быстрее - исходный код последней версии всегда доступен в виде :website_base:`archive `." #: ../../../__w/calibre/calibre/manual/develop.rst:94 msgid "To update a branch to the latest code, use the command::" msgstr "Чтобы обновить ветку до последнего кода, используйте команду::" #: ../../../__w/calibre/calibre/manual/develop.rst:98 msgid "" "You can also browse the code at `GitHub " "`_." msgstr "Вы также можете просмотреть код на `GitHub `_" #: ../../../__w/calibre/calibre/manual/develop.rst:101 msgid "Submitting your changes to be included" msgstr "Отправка ваших изменений для включения" #: ../../../__w/calibre/calibre/manual/develop.rst:103 msgid "" "If you only plan to make a few small changes, you can make your changes and " "create a \"merge directive\" which you can then attach to a ticket in the " "calibre `bug tracker `_. To do this, " "make your changes, then run::" msgstr "Если вы планируете внести только несколько небольших изменений, вы можете внести свои изменения и создать «merge directive», которую затем можете прикрепить к заявке в `calibre bug tracker `_. Для этого внесите свои изменения, затем запустите::" #: ../../../__w/calibre/calibre/manual/develop.rst:111 msgid "" "This will create a :file:`my-changes` file in the current folder, simply " "attach that to a ticket on the calibre `bug tracker " "`_. Note that this will include *all* " "the commits you have made. If you only want to send some commits, you have " "to change ``origin/master`` above. To send only the last commit, use::" msgstr "Это создаст файл :file:`my-changes` в текущей папке, просто прикрепите его к тикету на трекере ошибок calibre `_. Обратите внимание, что сюда будут включены *все* сделанные вами коммиты. Если вы хотите отправить только несколько коммитов, вам нужно изменить ``origin/master`` выше. Чтобы отправить только последний коммит, используйте::" #: ../../../__w/calibre/calibre/manual/develop.rst:119 msgid "" "To send the last *n* commits, replace *1* with *n*, for example, for the " "last 3 commits::" msgstr "Чтобы отправить последние *n* коммитов, замените *1* на *n*, напр., для последних 3 коммитов::" #: ../../../__w/calibre/calibre/manual/develop.rst:124 msgid "Be careful to not include merges when using ``HEAD~n``." msgstr "Будьте осторожны, чтобы не включать слияния при использовании ``HEAD~n``." #: ../../../__w/calibre/calibre/manual/develop.rst:126 msgid "" "If you plan to do a lot of development on calibre, then the best method is " "to create a `GitHub `__ account. Below is a basic guide " "to setting up your own fork of calibre in a way that will allow you to " "submit pull requests for inclusion into the main calibre repository:" msgstr "Если вы планируете много заниматься разработкой, то лучше всего создать учетную запись `GitHub `__. Ниже приведено основное руководство по настройке собственного форка calibre таким образом, чтобы вы могли отправлять пулл-реквесты для включения в основной репозиторий calibre:" #: ../../../__w/calibre/calibre/manual/develop.rst:131 msgid "" "Setup git on your machine as described in this article: `Setup Git " "`_" msgstr "Настройте git на своём компьютере, как описано в статье: `Setup Git `_" #: ../../../__w/calibre/calibre/manual/develop.rst:132 msgid "" "Setup ssh keys for authentication to GitHub, as described here: `Generating " "SSH keys `_" msgstr "Настройте ssh-ключи для аутентификации на GitHub, как описано здесь: `Генерация SSH-ключей `_" #: ../../../__w/calibre/calibre/manual/develop.rst:133 msgid "" "Go to https://github.com/kovidgoyal/calibre and click the :guilabel:`Fork` " "button." msgstr "Перейдите на https://github.com/kovidgoyal/calibre и нажмите кнопку :guilabel:`Fork`." #: ../../../__w/calibre/calibre/manual/develop.rst:134 msgid "In a Terminal do::" msgstr "В Терминале делай::" #: ../../../__w/calibre/calibre/manual/develop.rst:139 msgid "" "Replace above with your GitHub username. That will get your fork " "checked out locally." msgstr "Замените выше своим именем пользователя GitHub. Это позволит проверить ваш форк локально." #: ../../../__w/calibre/calibre/manual/develop.rst:140 msgid "" "You can make changes and commit them whenever you like. When you are ready " "to have your work merged, do a::" msgstr "Вы можете вносить изменения и коммитить их в любое время. Когда вы будете готовы объединить свою работу, сделайте::" #: ../../../__w/calibre/calibre/manual/develop.rst:144 msgid "" "and go to ``https://github.com//calibre`` and click the " ":guilabel:`Pull Request` button to generate a pull request that can be " "merged." msgstr "и перейдите к ``https://github.com//calibre`` и нажмите кнопку :guilabel:`Pull Request`, чтобы сгенерировать пул-реквест, который можно объединить." #: ../../../__w/calibre/calibre/manual/develop.rst:145 msgid "" "You can update your local copy with code from the main repo at any time by " "doing::" msgstr "Вы можете в любое время обновить свою локальную копию кодом из основного репозитория, выполнив::" #: ../../../__w/calibre/calibre/manual/develop.rst:150 msgid "" "You should also keep an eye on the calibre `development forum " "`_. Before making " "major changes, you should discuss them in the forum or contact Kovid " "directly (his email address is all over the source code)." msgstr "Вам также следует следить за `форумом по разработке calibre `_. Прежде чем вносить серьезные изменения, вы должны обсудить их на форуме или напрямую связаться с Ковидом (его адрес электронной почты указан по всему исходному коду)." #: ../../../__w/calibre/calibre/manual/develop.rst:156 msgid "Windows development environment" msgstr "Среда разработки под Windows" #: ../../../__w/calibre/calibre/manual/develop.rst:158 #: ../../../__w/calibre/calibre/manual/develop.rst:192 #: ../../../__w/calibre/calibre/manual/develop.rst:229 msgid "" "You must also get the calibre source code separately as described above." msgstr "Вы также должны получить исходный код calibre отдельно, как описано выше." #: ../../../__w/calibre/calibre/manual/develop.rst:160 msgid "" "Install calibre normally, using the `Windows installer `__. Then open a Command Prompt and change to the" " previously checked out calibre code folder. For example::" msgstr "Установите calibre обычным образом, используя `Windows installer `__. Затем откройте командную строку и перейдите в ранее проверенную папку кода calibre. Напр.::" #: ../../../__w/calibre/calibre/manual/develop.rst:165 #: ../../../__w/calibre/calibre/manual/develop.rst:241 msgid "calibre is the folder that contains the src and resources sub-folders." msgstr "calibre - это папка, содержащая подпапки src и resources." #: ../../../__w/calibre/calibre/manual/develop.rst:167 msgid "" "The next step is to set the environment variable ``CALIBRE_DEVELOP_FROM`` to" " the absolute path of the src folder. So, following the example above, it " "would be ``C:\\Users\\kovid\\work\\calibre\\src``. `Here is a short guide " "`_ to setting environment variables on Windows." msgstr "Следующий шаг - установка переменной среды CALIBRE_DEVELOP_FROM = абсолютный путь к папке src. Итак, следуя приведенному выше примеру, это будет ``C:\\Users\\kovid\\work\\calibre\\src``. `Вот краткое руководство `_ по настройке переменных среды в Windows." #: ../../../__w/calibre/calibre/manual/develop.rst:172 msgid "" "Once you have set the environment variable, open a new command prompt and " "check that it was correctly set by using the command::" msgstr "После того, как вы установили переменную окружения, откройте новую командную строку и проверьте, что она была правильно установлена, используя команду::" #: ../../../__w/calibre/calibre/manual/develop.rst:177 #: ../../../__w/calibre/calibre/manual/develop.rst:260 msgid "" "Setting this environment variable means that calibre will now load all its " "Python code from the specified location." msgstr "Установка этой переменной окружения означает, что calibre теперь будет загружать весь свой код Python из указанного места." #: ../../../__w/calibre/calibre/manual/develop.rst:179 msgid "" "That's it! You are now ready to start hacking on the calibre code. For " "example, open the file :file:`src\\\\calibre\\\\__init__.py` in your " "favorite editor and add the line::" msgstr "Это всё! Теперь вы готовы взломать код calibre. Напр., откройте файл :file:`src\\\\calibre\\\\__init__.py` в вашем любимом редакторе и добавьте строку::" #: ../../../__w/calibre/calibre/manual/develop.rst:184 #: ../../../__w/calibre/calibre/manual/develop.rst:267 msgid "" "near the top of the file. Now run the command :command:`calibredb`. The very" " first line of output should be ``Hello, world!``." msgstr "в верхней части файла. Теперь запустите команду :command:`calibredb`. Самая первая строка вывода должна быть ``Hello, world!``." #: ../../../__w/calibre/calibre/manual/develop.rst:186 msgid "" "You can also setup a calibre development environment inside the free " "Microsoft Visual Studio, if you like, following the instructions `here " "`_." msgstr "Вы также можете настроить окужение разработки calibre в бесплатной Microsoft Visual Studio, если хотите, следуя инструкциям `здесь `_." #: ../../../__w/calibre/calibre/manual/develop.rst:190 msgid "macOS development environment" msgstr "Среда разработки под macOS" #: ../../../__w/calibre/calibre/manual/develop.rst:194 msgid "" "Install calibre normally using the `provided .dmg `__. Then open a Terminal and change to the " "previously checked out calibre code folder, for example::" msgstr "Установите calibre обычным образом, используя `предоставленный .dmg `__. Затем откройте Terminal и перейдите в ранее проверенную папку кода calibre. Напр.::" #: ../../../__w/calibre/calibre/manual/develop.rst:199 msgid "" "calibre is the folder that contains the src and resources sub-folders. The " "calibre command line tools are found inside the calibre app bundle, in " ":file:`/Applications/calibre.app/Contents/MacOS` you should add this folder " "to your PATH environment variable, if you want to run the command line tools" " easily." msgstr "calibre - это папка, содержащая подпапки src и resources. Инструменты командной строки calibre находятся внутри пакета приложений calibre, в :file:`/Applications/calibre.app/Contents/MacOS`, вы должны добавить эту папку в переменную среды PATH, если вы хотите легко запускать инструменты командной строки." #: ../../../__w/calibre/calibre/manual/develop.rst:205 msgid "" "The next step is to create a bash script that will set the environment " "variable ``CALIBRE_DEVELOP_FROM`` to the absolute path of the src folder " "when running calibre in debug mode." msgstr "Следующий шаг - создание сценария bash, который установит для переменной среды ``CALIBRE_DEVELOP_FROM`` абсолютный путь к папке src при запуске calibre в режиме отладки." #: ../../../__w/calibre/calibre/manual/develop.rst:208 msgid "Create a plain text file::" msgstr "Создайте простой текстовый файл::" #: ../../../__w/calibre/calibre/manual/develop.rst:214 msgid "" "Save this file as :file:`/usr/local/bin/calibre-develop`, then set its " "permissions so that it can be executed::" msgstr "Сохраните этот файл как :file:`/usr/local/bin/calibre-develop`, затем установите ему права доступа так, чтобы он мог выполняться::" #: ../../../__w/calibre/calibre/manual/develop.rst:218 msgid "Once you have done this, run::" msgstr "Как только вы это сделали, запустите::" #: ../../../__w/calibre/calibre/manual/develop.rst:222 msgid "" "You should see some diagnostic information in the Terminal window as calibre" " starts up, and you should see an asterisk after the version number in the " "GUI window, indicating that you are running from source." msgstr "При запуске calibre вы должны увидеть диагностическую информацию в окне терминала, а в окне графического интерфейса вы увидите звездочку после номера версии, указывающую, что вы запустились из исходников." #: ../../../__w/calibre/calibre/manual/develop.rst:227 msgid "Linux development environment" msgstr "Среда разработки под Linux" #: ../../../__w/calibre/calibre/manual/develop.rst:231 msgid "" "calibre is primarily developed on Linux. You have two choices in setting up " "the development environment. You can install the calibre binary as normal " "and use that as a runtime environment to do your development. This approach " "is similar to that used in Windows and macOS. Alternatively, you can install" " calibre from source. Instructions for setting up a development environment " "from source are in the INSTALL file in the source tree. Here we will address" " using the binary as a runtime, which is the recommended method." msgstr "calibre в основном разработан на Linux. У вас есть два варианта настройки среды разработки. Вы можете установить бинарный файл calibre как обычно и использовать его в качестве среды выполнения для разработки. Этот подход аналогичен тому, который используется в Windows и macOS. Кроме того, вы можете установить calibre из исходных кодов. Инструкции по настройке среды разработки из исходного кода находятся в файле INSTALL в дереве исходного кода. Здесь мы рассмотрим использование двоичного файла в качестве среды выполнения, что является рекомендуемым методом." #: ../../../__w/calibre/calibre/manual/develop.rst:237 msgid "" "Install calibre using the `binary installer `_. Then open a terminal and change to the " "previously checked out calibre code folder, for example::" msgstr "Установите calibre обычным образом, используя `binary installer `_. Затем откройте терминал и перейдите в ранее проверенную папку кода calibre. Напр.::" #: ../../../__w/calibre/calibre/manual/develop.rst:243 msgid "" "The next step is to set the environment variable ``CALIBRE_DEVELOP_FROM`` to" " the absolute path of the src folder. So, following the example above, it " "would be ``/home/kovid/work/calibre/src``. How to set environment variables " "depends on your Linux distribution and what shell you are using." msgstr "Следующий шаг - установка переменной среды CALIBRE_DEVELOP_FROM = абсолютный путь к папке src. Итак, следуя приведенному выше примеру, это будет /home/kovid/work/calibre/src. Как установить переменные среды, зависит от вашего дистрибутива Linux и используемой оболочки." #: ../../../__w/calibre/calibre/manual/develop.rst:248 msgid "" "It is recommended to use the binary installer provided from upstream. Should" " you insist on using a package provided by your distribution, use the " "``CALIBRE_PYTHON_PATH`` and ``CALIBRE_RESOURCES_PATH`` variables instead. " "You can get these by running ``calibre-debug --paths``. But note that " "distribution calibre packages are often terminally broken and are completely" " unsupported." msgstr "Рекомендуется использовать бинарный установщик, предоставленный из апстрима. Если вы настаиваете на использовании пакета, предоставленного вашим дистрибутивом, используйте вместо этого переменные ``CALIBRE_PYTHON_PATH`` и ``CALIBRE_RESOURCES_PATH``. Вы можете получить их, выполнив команду ``calibre-debug --paths``. Но обратите внимание, что дистрибутивные пакеты calibre часто безнадежно ломаются и полностью не поддерживаются." #: ../../../__w/calibre/calibre/manual/develop.rst:255 msgid "" "Once you have set the environment variable, open a new terminal and check " "that it was correctly set by using the command::" msgstr "После того, как вы установили переменную окружения, откройте новый терминал и проверьте, что она была правильно установлена, используя команду::" #: ../../../__w/calibre/calibre/manual/develop.rst:262 msgid "" "That's it! You are now ready to start hacking on the calibre code. For " "example, open the file :file:`src/calibre/__init__.py` in your favorite " "editor and add the line::" msgstr "Это всё! Теперь вы готовы взломать код calibre. Напр., откройте файл :file:`src\\\\calibre\\\\__init__.py` в вашем любимом редакторе и добавьте строку::" #: ../../../__w/calibre/calibre/manual/develop.rst:270 msgid "" "Having separate \"normal\" and \"development\" calibre installs on the same " "computer" msgstr "Раздельная установка «обычной» и «разрабатываемой» версий calibre на одном компьютере" #: ../../../__w/calibre/calibre/manual/develop.rst:272 msgid "" "The calibre source tree is very stable and rarely breaks, but if you feel " "the need to run from source on a separate test library and run the released " "calibre version with your everyday library, you can achieve this easily " "using .bat files or shell scripts to launch calibre. The example below shows" " how to do this on Windows using .bat files (the instructions for other " "platforms are the same, just use a shell script instead of a .bat file)" msgstr "Исходное дерево кодов calibre очень стабильно и редко ломается, но если вы чувствуете необходимость запуска из источника в отдельной тестовой библиотеке и запускаете выпущенную версию calibre с вашей повседневной библиотекой, вы можете легко добиться этого, используя файлы .bat или сценарии оболочки для запуска calibre. В приведенном ниже примере показано, как сделать это в Windows с использованием файлов .bat (инструкции для других платформ такие же, просто используйте сценарий оболочки вместо файла .bat)" #: ../../../__w/calibre/calibre/manual/develop.rst:277 msgid "To launch the release version of calibre with your everyday library:" msgstr "Для запуска стабильной версии Calibre с вашей основной библиотекой:" #: ../../../__w/calibre/calibre/manual/develop.rst:279 msgid "calibre-normal.bat::" msgstr "calibre-normal.bat::" #: ../../../__w/calibre/calibre/manual/develop.rst:283 msgid "calibre-dev.bat::" msgstr "calibre-dev.bat::" #: ../../../__w/calibre/calibre/manual/develop.rst:290 msgid "Debugging tips" msgstr "Советы по отладке" #: ../../../__w/calibre/calibre/manual/develop.rst:292 msgid "" "Python is a dynamically typed language with excellent facilities for " "introspection. Kovid wrote the core calibre code without once using a " "debugger. There are many strategies to debug calibre code:" msgstr "Python — это динамически типизированный язык с отличными возможностями для самоанализа. Ковид написал код ядра calibre без единого использования отладчика. Существует много стратегий для отладки кода calibre:" #: ../../../__w/calibre/calibre/manual/develop.rst:297 msgid "Using print statements" msgstr "Использование print statements" #: ../../../__w/calibre/calibre/manual/develop.rst:299 msgid "" "This is Kovid's favorite way to debug. Simply insert print statements at " "points of interest and run your program in the terminal. For example, you " "can start the GUI from the terminal as::" msgstr "Это любимый способ отладки Ковида. Просто вставьте операторы печати в интересующие места и запустите вашу программу в терминале. Напр., вы можете запустить графический интерфейс из терминала как::" #: ../../../__w/calibre/calibre/manual/develop.rst:304 msgid "Similarly, you can start the E-book viewer as::" msgstr "Точно так же вы можете запустить просмотрщик электронных книг как::" #: ../../../__w/calibre/calibre/manual/develop.rst:308 msgid "The e-book editor can be started as::" msgstr "Редактор электронных книг может быть запущен так::" #: ../../../__w/calibre/calibre/manual/develop.rst:313 msgid "Using an interactive Python interpreter" msgstr "Использование интерактивного интерпретатора Python" #: ../../../__w/calibre/calibre/manual/develop.rst:315 msgid "" "You can insert the following two lines of code to start an interactive " "Python session at that point::" msgstr "Вы можете вставить следующие две строки кода, чтобы начать интерактивный сеанс Python в этой точке::" #: ../../../__w/calibre/calibre/manual/develop.rst:320 msgid "" "When running from the command line, this will start an interactive Python " "interpreter with access to all locally defined variables (variables in the " "local scope). The interactive prompt even has :kbd:`Tab` completion for " "object properties and you can use the various Python facilities for " "introspection, such as :func:`dir`, :func:`type`, :func:`repr`, etc." msgstr "При запуске из командной строки запускается интерактивный интерпретатор Python с доступом ко всем локально определенным переменным (переменным в локальной области). Интерактивная подсказка даже имеет завершение по :kbd:`Tab` для свойств объекта, и вы можете использовать различные возможности Python для интроспекции, такие как :func:`dir`, :func:`type`, :func:`repr` и т. д." #: ../../../__w/calibre/calibre/manual/develop.rst:326 msgid "Using the Python debugger as a remote debugger" msgstr "Использовать отладчик Python как удаленный отладчик" #: ../../../__w/calibre/calibre/manual/develop.rst:328 msgid "" "You can use the builtin Python debugger (pdb) as a remote debugger from the " "command line. First, start the remote debugger at the point in the calibre " "code you are interested in, like this::" msgstr "Вы можете использовать встроенный отладчик Python (pdb) в качестве удаленного отладчика из командной строки. Сначала запустите удаленный отладчик в интересующем вас месте кода calibre, напр.::" #: ../../../__w/calibre/calibre/manual/develop.rst:335 msgid "" "Then run calibre, either as normal, or using one of the calibre-debug " "commands described in the previous section. Once the above point in the code" " is reached, calibre will freeze, waiting for the debugger to connect." msgstr "Затем запустите calibre, как обычно, или с помощью одной из команд отладки calibre, описанных в предыдущем разделе. Как только вышеуказанная точка в коде будет достигнута, calibre остановится, ожидая подключения отладчика." #: ../../../__w/calibre/calibre/manual/develop.rst:339 msgid "" "Now open a terminal or command prompt and use the following command to start" " the debugging session::" msgstr "Теперь откройте терминал или командную строку и используйте следующую команду для запуска сеанса отладки::" #: ../../../__w/calibre/calibre/manual/develop.rst:344 msgid "" "You can read about how to use the Python debugger in the `Python stdlib docs" " for the pdb module `_." msgstr "Прочитать о том, как использовать отладчик Python, можно в `Документации Python stdlib для модуля pdb (англ.) `_." #: ../../../__w/calibre/calibre/manual/develop.rst:348 msgid "" "By default, the remote debugger will try to connect on port 4444. You can " "change it, by passing the port parameter to both the set_trace() and the " "cli() functions above, like this: ``set_trace(port=1234)`` and " "``cli(port=1234)``." msgstr "По умолчанию удаленный отладчик будет пытаться подключиться к порту 4444. Вы можете изменить его, передав параметр порта обеим функциям set_trace() и cli(), описанным выше, напр.: ``set_trace(port=1234)`` и ``cli(port=1234)``." #: ../../../__w/calibre/calibre/manual/develop.rst:354 msgid "" "The Python debugger cannot handle multiple threads, so you have to call " "set_trace once per thread, each time with a different port number." msgstr "Отладчик Python не может обрабатывать несколько потоков, поэтому вы должны вызывать set_trace один раз для потока, каждый раз с другим номером порта." #: ../../../__w/calibre/calibre/manual/develop.rst:358 msgid "Using the debugger in your favorite Python IDE" msgstr "Использование отладчика в вашей любимой Python IDE" #: ../../../__w/calibre/calibre/manual/develop.rst:360 msgid "" "It is possible to use the builtin debugger in your favorite Python IDE, if " "it supports remote debugging. The first step is to add the calibre src " "checkout to the ``PYTHONPATH`` in your IDE. In other words, the folder you " "set as ``CALIBRE_DEVELOP_FROM`` above, must also be in the ``PYTHONPATH`` of" " your IDE." msgstr "Можно использовать встроенный отладчик в вашей любимой среде разработки Python, если он поддерживает удаленную отладку. Первый шаг - добавить проверку calibre src в PYTHONPATH в вашей среде IDE. Другими словами, папка, которую вы установили как CALIBRE_DEVELOP_FROM выше, также должна находиться в PYTHONPATH вашей IDE." #: ../../../__w/calibre/calibre/manual/develop.rst:365 msgid "" "Then place the IDE's remote debugger module into the :file:`src` sub-folder " "of the calibre source code checkout. Add whatever code is needed to launch " "the remote debugger to calibre at the point of interest, for example in the " "main function. Then run calibre as normal. Your IDE should now be able to " "connect to the remote debugger running inside calibre." msgstr "Затем поместите модуль удаленного отладчика IDE в подпапку :file:`src` проверки исходного кода calibre. Добавьте любой код, необходимый для запуска удаленного отладчика до нужного уровня, напр., в основной функции. Затем запустите calibre как обычно. Теперь ваша IDE должна иметь возможность подключаться к удаленному отладчику, работающему внутри calibre." #: ../../../__w/calibre/calibre/manual/develop.rst:372 msgid "Executing arbitrary scripts in the calibre Python environment" msgstr "Выполнение произвольных скриптов в окружении Python calibre " #: ../../../__w/calibre/calibre/manual/develop.rst:374 msgid "" "The :command:`calibre-debug` command provides a couple of handy switches to " "execute your own code, with access to the calibre modules::" msgstr "Команда :command:`calibre-debug` предоставляет несколько удобных ключей для выполнения собственного кода с доступом к модулям calibre::" #: ../../../__w/calibre/calibre/manual/develop.rst:379 msgid "" "is great for testing a little snippet of code on the command line. It works " "in the same way as the -c switch to the Python interpreter::" msgstr "отлично подходит для тестирования небольшого фрагмента кода в командной строке. Он работает так же, как ключ -c для интерпретатора Python::" #: ../../../__w/calibre/calibre/manual/develop.rst:383 msgid "" "can be used to execute your own Python script. It works in the same way as " "passing the script to the Python interpreter, except that the calibre " "environment is fully initialized, so you can use all the calibre code in " "your script. To use command line arguments with your script, use the form::" msgstr "может быть использован для выполнения вашего собственного скрипта Python. Он работает так же, как и передача скрипта интерпретатору Python, за исключением того, что окружение calibre полностью инициализировано, поэтому вы можете использовать весь код calibre в своем скрипте. Чтобы использовать аргументы командной строки с вашим скриптом, используйте форму::" #: ../../../__w/calibre/calibre/manual/develop.rst:388 msgid "" "The ``--`` causes all subsequent arguments to be passed to your script." msgstr "``--`` заставляет все последующие аргументы быть переданными в ваш скрипт." #: ../../../__w/calibre/calibre/manual/develop.rst:392 msgid "Running the calibre test suite" msgstr "Запуск набора тестов Calibre" #: ../../../__w/calibre/calibre/manual/develop.rst:394 msgid "The calibre test suite can be run by::" msgstr "Набор тестов Calibre можно запустить с помощью:" #: ../../../__w/calibre/calibre/manual/develop.rst:400 msgid "Using calibre in your projects" msgstr "Использование calibre в собственных проектах" #: ../../../__w/calibre/calibre/manual/develop.rst:402 msgid "" "It is possible to directly use calibre functions/code in your Python " "project. Two ways exist to do this:" msgstr "Можно напрямую использовать функции/код calibre в вашем проекте Python. Существует два способа сделать это:" #: ../../../__w/calibre/calibre/manual/develop.rst:405 msgid "Binary install of calibre" msgstr "Установка исполняемого файла calibre" #: ../../../__w/calibre/calibre/manual/develop.rst:407 msgid "" "If you have a binary install of calibre, you can use the Python interpreter " "bundled with calibre, like this::" msgstr "Если у вас есть бинарная установка calibre, вы можете использовать интерпретатор Python в комплекте с calibre, напр.::" #: ../../../__w/calibre/calibre/manual/develop.rst:412 msgid "Source install on Linux" msgstr "Установка из исходного кода в Linux" #: ../../../__w/calibre/calibre/manual/develop.rst:414 msgid "" "In addition to using the above technique, if you do a source install on " "Linux, you can also directly import calibre, as follows::" msgstr "Помимо использования описанной выше техники, если вы выполняете установку из исходного кода в Linux, вы также можете напрямую импортировать calibre, как показано ниже::" #: ../../../__w/calibre/calibre/manual/develop.rst:422 msgid "" "It is essential that you import the init_calibre module before any other " "calibre modules/packages as it sets up the interpreter to run calibre code." msgstr "Важно, чтобы вы импортировали модуль init_calibre перед любыми другими модулями/пакетами calibre, поскольку он настраивает интерпретатор для запуска кода calibre." #: ../../../__w/calibre/calibre/manual/develop.rst:426 msgid "API documentation for various parts of calibre" msgstr "Документация API различных частей calibre"