summaryrefslogtreecommitdiffstats
path: root/helpcontent2/source/text/sbasic/python/python_locations.xhp
diff options
context:
space:
mode:
Diffstat (limited to 'helpcontent2/source/text/sbasic/python/python_locations.xhp')
-rw-r--r--helpcontent2/source/text/sbasic/python/python_locations.xhp72
1 files changed, 72 insertions, 0 deletions
diff --git a/helpcontent2/source/text/sbasic/python/python_locations.xhp b/helpcontent2/source/text/sbasic/python/python_locations.xhp
new file mode 100644
index 000000000..9f145416a
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/python/python_locations.xhp
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<helpdocument version="1.0">
+ <!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ -->
+
+ <meta>
+ <topic id="pythonlocations" indexer="include" status="PUBLISH">
+ <title id="tit" xml-lang="en-US">Python Scripts Organization</title>
+ <filename>/text/sbasic/python/python_locations.xhp</filename>
+ </topic>
+ </meta>
+ <body>
+ <section id="pythonlocation">
+ <paragraph id="hd_id391543358231021" role="heading" level="1" xml-lang="en-US"><variable id="pythonlocations1"><link href="text/sbasic/python/python_locations.xhp" name="command_name">Python Scripts Organization and Location</link></variable></paragraph>
+ <paragraph id="par_id481636114810038" role="paragraph" xml-lang="en-US">%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.</paragraph>
+ <paragraph role="paragraph" id="par_id771543358231022">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.</paragraph>
+ <paragraph role="image" id="par_id771636279690940"><image src="media/helpimg/sbasic/Library-Container.svg" id="img_id121636285791637" width="8cm" height="5.5cm"><alt id="alt_id471636279690940">Library Container diagram</alt></image></paragraph>
+ <paragraph role="paragraph" id="par_id171636114787810"><emph>Figure:</emph> Macro Library hierarchy</paragraph>
+ <paragraph role="paragraph" id="par_id801636114790638">The containers are accessible in all %PRODUCTNAME programs through the user interface. Go to <menuitem>Tools > Macros > Organize Macros > Python</menuitem>, to open the Python Macros dialog.</paragraph>
+ <paragraph role="paragraph" id="par_id801636114808666">Three library containers are shown in the Macro From list:</paragraph>
+ <list type="ordered">
+ <listitem>
+ <paragraph id="par_id321636114854594" role="listitem"><emph>My Macros:</emph> personal macros available for the %PRODUCTNAME user</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph id="par_id471636114847530" role="listitem"><emph>Application Macros:</emph> system macros distributed with %PRODUCTNAME for every computer user</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph id="par_id191636114858218" role="listitem"><emph>Document macros:</emph> every document can contain macro libraries available in that document for all users</paragraph>
+ </listitem>
+ </list>
+ </section>
+ <h2 id="hd_id911544049584458">Python Script Locations</h2>
+ <paragraph id="par_id121551089455774" role="paragraph" xml-lang="en-US">Refer to <link href="text/sbasic/python/python_session.xhp" name="Getting Session Information">Getting Session Information</link> in order to get programmatic access to Python script locations.</paragraph>
+ <h3 id="hd_id591544049572647">Application Macros</h3>
+ <paragraph role="paragraph" id="par_id261544049064421">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.</paragraph>
+ <paragraph role="paragraph" id="par_id861544210028670">The %PRODUCTNAME Macros container location in the file system depends on the operating system:</paragraph>
+ <list type="unordered">
+ <listitem>
+ <paragraph id="par_id191544210072242" role="listitem">For <emph>Windows</emph>: <literal>{Installation}\share\Scripts\python</literal>.</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph id="par_id61544210078654" role="listitem">For <emph>Linux</emph> and <emph>macOS</emph>: <literal>{Installation}/share/Scripts/python</literal>.</paragraph>
+ </listitem>
+ </list>
+ <h3 id="hd_id861544049692222">My Macros</h3>
+ <paragraph role="paragraph" id="par_id981544049055996">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.</paragraph>
+ <paragraph role="paragraph" id="par_id341544210187846">The My Macros container location is in the user space and depends on the operating system:</paragraph>
+ <list type="unordered">
+ <listitem>
+ <paragraph id="par_id381544210213190" role="listitem">For <emph>Windows</emph>,<br/><literal>%APPDATA%\LibreOffice\4\user\Scripts\python</literal>.</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph id="par_id691544210219850" role="listitem">For <emph>Linux</emph> and <emph>macOS</emph>,<br/><literal>$HOME/.config/libreoffice/4/user/Scripts/python</literal>.</paragraph>
+ </listitem>
+ </list>
+ <h3 id="hd_id101544049707712">Document macros</h3>
+ <paragraph role="paragraph" id="par_id31544049046497">Document macros are embedded in the document and are accessible only when the document is open.</paragraph>
+ <h2 id="hd_id171544049715310">Libraries, Modules and Macros</h2>
+ <paragraph role="paragraph" id="par_id181544209916707">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.</paragraph>
+ <section id="relatedtopics">
+ <embed href="text/sbasic/python/python_session.xhp#pythonsession"/>
+ <embed href="text/sbasic/python/main0000.xhp#pythonscriptshelp"/>
+ </section>
+</body>
+</helpdocument>