# SOME DESCRIPTIVE TITLE. # Copyright (C) Kovid Goyal # This file is distributed under the same license as the calibre package. # # Translators: # Yuri Chornoivan , 2014,2017-2023,2025-2026 msgid "" msgstr "" "Project-Id-Version: calibre\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-07-30 18:07+0000\n" "PO-Revision-Date: 2014-06-17 08:34+0000\n" "Last-Translator: Yuri Chornoivan , 2014,2017-2023,2025-2026\n" "Language-Team: Ukrainian (http://app.transifex.com/calibre/calibre/language/uk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: uk\n" "Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (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 дуже простим і надає розвитку програми шаленого темпу. Через своє походження calibre має всеосяжний інтерфейс командного рядка для усіх свої функціональних можливостей. Документацію з нього можна знайти у розділі :doc:`generated/uk/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:`розділ ` щодо написання додатків до calibre. Наприклад, додавання підтримки нового пристрою у calibre типово полягає у написанні менш ніж 100 рядків коду у формі додатка драйвера пристрою. Ви можете ознайомитися зі списком `вбудованих драйверів `_. Так само, додавання підтримки нових форматів перетворення полягає у написанні додатків форматів введення і виведення даних. Іншим прикладом модульної побудови є :ref:`система рецептів ` для отримання новин. З іншими прикладами додатків, розроблених для розширення можливостей 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. Усі драйвери на основі USBMS у calibre успадковуються від цього драйвера." #: ../../../__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 "ebooks — увесь код, який пов’язано із перетворенням та метаданими електронних книг. Варто розпочати з ``calibre.ebooks.conversion.cli``, модуля, який забезпечує роботу програми :command:`ebook-convert`. Процесом перетворення керує ``conversion.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, із маніфестом manifest, вмістом, змістом, путівником, даними html тощо. Класом, який керує цим представленням, є клас OEBBook у ``ebooks.oeb.base``. Різноманітні перетворення, які застосовуються до книги під час обробки, зберігаються у :file:`oeb/transforms/*.py`. Код додатків вхідних і вихідних даних зберігається у :file:`conversion/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 — графічний інтерфейс користувача. Ініціалізація інтерфейсу виконується у ``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:`архіву з кодом програми `." #: ../../../__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:`архіву `." #: ../../../__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 "Якщо ви плануєте внести лише незначні зміни, ви можете створити з них «інструкцію об’єднання», а потім долучити її до квитка у `системі стеження за вадами `_ calibre. Процедура така: вносимо зміни, а потім віддаємо такі команди::" #: ../../../__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 "Якщо ви плануєте значний розвиток коду calibre, вам варто створити обліковий запис на `GitHub `__. Нижче наведено базові настанови щодо створення власної копії коду calibre у спосіб, який надасть вам змогу надсилати запити щодо об’єднання (pull requests) для включення вашого коду до основного сховища коду 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, як це описано тут: `Generating SSH keys `_" #: ../../../__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 `__. Далі, відкрийте вікно командного рядка і перейдіть до отриманої теки з кодом 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 `__. Далі, відкрийте вікно термінала і перейдіть до отриманої теки з кодом 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/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 за допомогою `бінарного пакунка для встановлення `_. Далі, відкрийте вікно термінала і перейдіть до отриманої теки з кодом 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 для вашої справжньої бібліотеки, досягти цього можна за допомогою запуску calibre з файлів .bat або скриптів оболонки. У наведеному нижче прикладі показано, як досягти цього у 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" #: ../../../__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 "Цей улюблений спосіб діагностування Ковіда. Просто вставте інструкції print у потрібні вам місця у коді і запустіть програму з термінала. Наприклад, ви можете запустити графічний інтерфейс програми з термінала ось так::" #: ../../../__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 із доступом до усіх локально визначених змінних (змінних у області local). У інтерактивному командному рядку передбачено навіть автоматичне доповнення за натисканням клавіші :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-debug, які описано у попередньому розділі. Щойно буде досягнуто визначеної вище точки у коді, роботу 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, модуль 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" #: ../../../__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 "Можна скористатися вбудованим засобом діагностики у вашому улюбленому комплексному середовищі для розробки, якщо там передбачено віддалену діагностику. Першим кроком є додавання адреси клону src calibre до змінної ``PYTHONPATH`` у вашому комплексному середовищі для розробки. Іншими словами, тека, яку ви визначили для змінної ``CALIBRE_DEVELOP_FROM`` вище, має також бути серед тек у змінній ``PYTHONPATH`` вашого комплексного середовища для розробки." #: ../../../__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 "Далі, розташуйте модуль віддаленого засобу діагностики комплексного середовища розробки у підтеці :file:`src` клону початкового коду calibre. Додайте код, який потрібен для запуску віддаленого засобу діагностики у код calibre у потрібному вам місці, наприклад у функції main. Далі, запустіть calibre у звичний спосіб. Після цього ваше комплексне середовище розробки має з’єднатися із засобом віддаленої діагностики, запущеним у 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, який міститься у ньому. Ось так::" #: ../../../__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 "Документація з програмного інтерфейсу до різноманітних частин calibre"