From ff95264637de17c48fa5de9765c97bb103cf077b Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Fri, 7 Dec 2018 17:36:56 -0200 Subject: [PATCH] Add info on python location in filesystem Change-Id: Iae5f0cc2d95f8f24d2ba7d5ee8e9013d87c851f6 Reviewed-on: https://gerrit.libreoffice.org/65096 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- .../text/sbasic/python/python_locations.xhp | 44 ++++++++++++++++--- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/source/text/sbasic/python/python_locations.xhp b/source/text/sbasic/python/python_locations.xhp index f8bb85ff52..24462b698e 100644 --- a/source/text/sbasic/python/python_locations.xhp +++ b/source/text/sbasic/python/python_locations.xhp @@ -11,19 +11,49 @@ - Location of Python Scripts + Python Scripts Organization /text/sbasic/python/python_locations.xhp
- Location of Python scripts - The Python script files are simply stored within the file system. - + Python scripts Organization and Location + The Python script files are stored in the file system, in folders controlled by %PRODUCTNAME. The macros can be stared at installation, user or file level.
- %PRODUCTNAME installation share - %PRODUCTNAME user profile - Embedded in the document +

Python Script Locations

+

%PRODUCTNAME Macros container

+ 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 LibreOfficeDev Macros container location in the file system depends on the operating system: + + + For Windows, C:\Program Files (x86)\LibreOffice\Basis\share\Scripts\python. + + + For Linux and macOS, in $(Installation)/share/Scripts/python. + + +

My Macros

+ This container is accessible only by the %PRODUCTNAME user. Any open document can access macros stored the container. Macros in this location are stored in the %PRODUCTNAME user profile. + The My Macros container location is in the user space and depends on the operating system: + + + For Windows, in C:\Users\current-user\AppData\Roaming\libreoffice\4\user\Scripts\python. + + + For Linux and macOS, in $(HOME)/.config/libreoffice/4/user/Scripts/python. + + +

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 organized in libraries, modules and macros. Note that a module may not be part of a library. +

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.