From 6d3d8f1f5279595d78267ed830cc0abb6babccb3 Mon Sep 17 00:00:00 2001 From: flywire Date: Fri, 5 Nov 2021 13:25:45 +0200 Subject: Simplify location description Change-Id: I943bdd1ab68d0f73f3e7735b62c8ef228eecd72a Reviewed-on: https://gerrit.libreoffice.org/c/help/+/124700 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- Package_html_media.mk | 1 + source/media/helpimg/sbasic/Library-Container.svg | 130 ++++++++++++++++++++++ source/text/sbasic/python/python_locations.xhp | 29 +++-- 3 files changed, 150 insertions(+), 10 deletions(-) create mode 100644 source/media/helpimg/sbasic/Library-Container.svg diff --git a/Package_html_media.mk b/Package_html_media.mk index 25ddb7910b..66cd339f1a 100644 --- a/Package_html_media.mk +++ b/Package_html_media.mk @@ -134,6 +134,7 @@ $(eval $(call gb_Package_add_files_with_dir,helpcontent2_html_media,$(LIBO_SHARE helpimg/sbasic/If_statement.svg \ helpimg/sbasic/Input_statement.svg \ helpimg/sbasic/LetSet_statement.svg \ + helpimg/sbasic/Library-Container.svg \ helpimg/sbasic/Line-Input_statement.svg \ helpimg/sbasic/MkDir_statement.svg \ helpimg/sbasic/On-Error_statement.svg \ diff --git a/source/media/helpimg/sbasic/Library-Container.svg b/source/media/helpimg/sbasic/Library-Container.svg new file mode 100644 index 0000000000..b64eb8f72e --- /dev/null +++ b/source/media/helpimg/sbasic/Library-Container.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Library Container + + + + + + + + Module A + + + + + + + + Library B + + + + + + + + Library C + + + + + + + + Module 1 + + + + + + + + Module 2 + + + + + + + + Macro 1 + + + + + + + + Macro 2 + + + + \ No newline at end of file diff --git a/source/text/sbasic/python/python_locations.xhp b/source/text/sbasic/python/python_locations.xhp index 4ec027b43e..6a5faa544b 100644 --- a/source/text/sbasic/python/python_locations.xhp +++ b/source/text/sbasic/python/python_locations.xhp @@ -18,13 +18,28 @@
Python Scripts Organization and Location - The Python script files are stored in the filesystem, in folders controlled by %PRODUCTNAME. The macros can be started at installation, user or file level. + %PRODUCTNAME 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 %PRODUCTNAME. + Library Container diagram + Figure: Macro Library hierarchy + The containers are accessible in all %PRODUCTNAME 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: + + + My Macros: personal macros available for the %PRODUCTNAME user + + + %PRODUCTNAME Macros: system macros distributed with LibreOffice for every computer user + + + Document macros: every document can contain macro libraries available in that document for all users + +

Python Script Locations

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

%PRODUCTNAME Macros container

+

%PRODUCTNAME Macros

Existing macros in this location (container) were copied by the installation program and are available to every computer user, and any open document can access macros stored the container. You need administrative rights to store or edit macros here. - The %PRODUCTNAME Macros container location in the file system depends on the operating system: @@ -48,13 +63,7 @@

Document macros

Document macros are embedded in the document and are accessible only when the document is open.

Libraries, Modules and Macros

- Like BASIC macros, Python macros can be organized in libraries, modules and macros. -

Creating a Python Library

- Libraries are folders in the container tree. To create a library, add a folder in the target container. The library name is the folder name. -

Creating a Python Module.

- A module is a python file in the library or the container. Create a module adding a file in the container. -

Python macros

- A macro is a python object in the module. + 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.
-- cgit