Організація і розташування сценаріїв на Python

LibreOffice macros are grouped in module files, modules are usually grouped in library folders, and libraries are grouped in library containers although containers can contain modules too.

A library is used as a major grouping for either an entire category of macros, or for an entire application. Modules usually split functionality, such as user interaction and calculations. Individual macros are subroutines and functions. The Figure below shows an example of the hierarchical structure of macro libraries in LibreOffice.

Library Container diagram

Figure: Macro Library hierarchy

The containers are accessible in all LibreOffice programs through the user interface. Go to Tools > Macros > Organize Macros > Python, to open the Python Macros dialog.

Three library containers are shown in the Macro From list:

  1. My Macros: personal macros available for the LibreOffice user

  2. Application Macros: system macros distributed with LibreOffice for every computer user

  3. Document macros: every document can contain macro libraries available in that document for all users

Розташування сценаріїв на Python

Refer to Getting Session Information in order to get programmatic access to Python script locations.

Application Macros

Макроси, наявні в цьому місці (контейнері), скопійовані програмою встановлення і доступні кожному користувачеві комп'ютера, і будь-який відкритий документ може мати доступ до макросів, що зберігаються в контейнері. Для зберігання або редагування макросів тут потрібні права адміністратора.

Розташування контейнера макросів LibreOffice у файловій системі залежить від операційної системи:

Мої макроси

Цей контейнер доступний лише користувачеві LibreOffice. Будь-який відкритий документ може мати доступ до макросів, що зберігаються в контейнері. Макроси в цьому місці зберігаються у профілі користувача LibreOffice.

Контейнер Мої макроси знаходиться у просторі користувача і залежить від операційної системи:

Макроси документа

Макроси документів вбудовуються в документ і доступні лише тоді, коли документ відкритий.

Бібліотеки, модулі та макроси

Python macros can be organized in libraries, modules and macros. Use the Macro Library hierarchy as a guide when creating or installing new macros in module files, new module files in library folders or new library folders in containers.

Будь ласка, підтримайте нас!