diff options
Diffstat (limited to 'source/text/sbasic/python')
-rw-r--r-- | source/text/sbasic/python/main0000.xhp | 12 | ||||
-rw-r--r-- | source/text/sbasic/python/python_2_basic.xhp | 12 | ||||
-rw-r--r-- | source/text/sbasic/python/python_dialogs.xhp | 4 | ||||
-rw-r--r-- | source/text/sbasic/python/python_document_events.xhp | 8 | ||||
-rw-r--r-- | source/text/sbasic/python/python_examples.xhp | 2 | ||||
-rw-r--r-- | source/text/sbasic/python/python_handler.xhp | 12 | ||||
-rw-r--r-- | source/text/sbasic/python/python_ide.xhp | 6 | ||||
-rw-r--r-- | source/text/sbasic/python/python_import.xhp | 2 | ||||
-rw-r--r-- | source/text/sbasic/python/python_listener.xhp | 10 | ||||
-rw-r--r-- | source/text/sbasic/python/python_locations.xhp | 4 | ||||
-rw-r--r-- | source/text/sbasic/python/python_platform.xhp | 2 | ||||
-rw-r--r-- | source/text/sbasic/python/python_programming.xhp | 18 | ||||
-rw-r--r-- | source/text/sbasic/python/python_screen.xhp | 12 | ||||
-rw-r--r-- | source/text/sbasic/python/python_session.xhp | 2 | ||||
-rw-r--r-- | source/text/sbasic/python/python_shell.xhp | 6 |
15 files changed, 56 insertions, 56 deletions
diff --git a/source/text/sbasic/python/main0000.xhp b/source/text/sbasic/python/main0000.xhp index 40aaa194ea..8898ca3e1e 100644 --- a/source/text/sbasic/python/main0000.xhp +++ b/source/text/sbasic/python/main0000.xhp @@ -20,11 +20,11 @@ <bookmark_value>Python;macros</bookmark_value> <bookmark_value>scripts;Python</bookmark_value> </bookmark> - <h1 id="hd_id3154232"><variable id="pythonscriptshelp"><link href="text/sbasic/python/main0000.xhp" name="mainpython">%PRODUCTNAME Python Scripts Help</link></variable></h1> + <h1 id="hd_id3154232"><variable id="pythonscriptshelp"><link href="text/sbasic/python/main0000.xhp">%PRODUCTNAME Python Scripts Help</link></variable></h1> <section id="pythonold"> - <paragraph id="par_id3153894" role="paragraph" xml-lang="en-US">%PRODUCTNAME provides an Application Programming Interface (API) that allows controlling the $[officename] components with different programming languages by using the $[officename] Software Development Kit (SDK). For more information about the $[officename] API and the Software Development Kit, visit <link href="https://api.libreoffice.org/" name="api.libreoffice.org">https://api.libreoffice.org</link></paragraph> - <paragraph id="par_id3147226" role="paragraph" xml-lang="en-US">This help section explains the most common Python script functions for %PRODUCTNAME. For more in-depth information please refer to the <link href="https://wiki.documentfoundation.org/Macros/Python_Design_Guide" name="wiki.documentfoundation.org PYTHON Guide">Designing & Developing Python Applications</link> on the Wiki.</paragraph> + <paragraph id="par_id3153894" role="paragraph" xml-lang="en-US">%PRODUCTNAME provides an Application Programming Interface (API) that allows controlling the $[officename] components with different programming languages by using the $[officename] Software Development Kit (SDK). For more information about the $[officename] API and the Software Development Kit, visit <link href="https://api.libreoffice.org/">https://api.libreoffice.org</link></paragraph> + <paragraph id="par_id3147226" role="paragraph" xml-lang="en-US">This help section explains the most common Python script functions for %PRODUCTNAME. For more in-depth information please refer to the <link href="https://wiki.documentfoundation.org/Macros/Python_Design_Guide">Designing & Developing Python Applications</link> on the Wiki.</paragraph> </section> <h2 id="hd_id3146957">Working with Python Scripts in %PRODUCTNAME</h2> <paragraph role="paragraph" id="N0102">You can execute Python scripts choosing <menuitem>Tools - Macros - Run Macro</menuitem>. Editing scripts can be done with your preferred text editor. Python scripts are present in various locations detailed hereafter. You can refer to Programming examples for macros illustrating how to run the Python interactive console from %PRODUCTNAME.</paragraph> @@ -46,9 +46,9 @@ <section id="pyModules"> <h2 id="hd_id901655365903313">%PRODUCTNAME Python Modules</h2> - <paragraph role="paragraph" id="par_id21655367848705"><link href="text/sbasic/python/python_screen.xhp" name="msgbox module"><literal>msgbox</literal> module</link></paragraph> - <paragraph role="paragraph" id="par_id801655368030968"><link href="text/sbasic/shared/03/lib_ScriptForge.xhp" name="scriptforge module"><literal>scriptforge</literal> module</link></paragraph> - <paragraph role="paragraph" id="par_id12655637848750"><link href="text/sbasic/python/python_programming.xhp#uno" name="uno module"><literal>uno</literal> module</link></paragraph> + <paragraph role="paragraph" id="par_id21655367848705"><link href="text/sbasic/python/python_screen.xhp"><literal>msgbox</literal> module</link></paragraph> + <paragraph role="paragraph" id="par_id801655368030968"><link href="text/sbasic/shared/03/lib_ScriptForge.xhp"><literal>scriptforge</literal> module</link></paragraph> + <paragraph role="paragraph" id="par_id12655637848750"><link href="text/sbasic/python/python_programming.xhp#uno"><literal>uno</literal> module</link></paragraph> </section> <embed href="text/swriter/main0000.xhp#helpabouthelp"/> diff --git a/source/text/sbasic/python/python_2_basic.xhp b/source/text/sbasic/python/python_2_basic.xhp index 0ce9f44177..11c4a7ab7d 100644 --- a/source/text/sbasic/python/python_2_basic.xhp +++ b/source/text/sbasic/python/python_2_basic.xhp @@ -19,7 +19,7 @@ <bookmark_value>Python;Calling Basic</bookmark_value> <bookmark_value>ParamArray</bookmark_value> </bookmark> - <h1 id="N0331"><variable id="py2ba_h1"><link href="text/sbasic/python/python_2_basic.xhp" name="Calling Basic macros from Python">Calling Basic Macros from Python</link></variable></h1> + <h1 id="N0331"><variable id="py2ba_h1"><link href="text/sbasic/python/python_2_basic.xhp">Calling Basic Macros from Python</link></variable></h1> <paragraph role="paragraph" id="N0332">You can call %PRODUCTNAME Basic macros from Python scripts, and notable features can be obtained in return such as:</paragraph> <list type="unordered"> <listitem><paragraph role="listitem" id="N0333">Simple logging facilities out of <literal>Access2Base</literal> library Trace console,</paragraph></listitem> @@ -31,9 +31,9 @@ </section> <tip id="N0337">It is recommended to have knowledge of Python standard modules and %PRODUCTNAME API features prior to perform inter-language calls from Python to Basic, JavaScript or any other script engine.</tip> <!-- WIP - Context clarifications needed in below warning --> - <warning id="N0338">When running Python scripts from an Integrated Development Environment (IDE), the %PRODUCTNAME-embedded Basic engine may be absent. Avoid Python-to-%PRODUCTNAME Basic calls in such contexts. However Python environment and Universal Networks Objects (UNO) are fully available. Refer to <link href="text/sbasic/python/python_ide.xhp" name ="Setting Up an Integrated IDE for Python">Setting Up an Integrated IDE for Python</link> for more information.</warning> + <warning id="N0338">When running Python scripts from an Integrated Development Environment (IDE), the %PRODUCTNAME-embedded Basic engine may be absent. Avoid Python-to-%PRODUCTNAME Basic calls in such contexts. However Python environment and Universal Networks Objects (UNO) are fully available. Refer to <link href="text/sbasic/python/python_ide.xhp">Setting Up an Integrated IDE for Python</link> for more information.</warning> <h2 id="N0339">Retrieving %PRODUCTNAME Basic Scripts</h2> - <paragraph role="paragraph" id="N0340">%PRODUCTNAME Basic macros can be personal, shared, or embedded in documents. In order to execute them, Python run time needs to be provided with Basic macro locations. Implementing the <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScript.html" name ="XScriptProvider interface">com.sun.star.script.provider.XScriptProvider</link> interface allows the retrieval of executable scripts:</paragraph> + <paragraph role="paragraph" id="N0340">%PRODUCTNAME Basic macros can be personal, shared, or embedded in documents. In order to execute them, Python run time needs to be provided with Basic macro locations. Implementing the <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScript.html">com.sun.star.script.provider.XScriptProvider</link> interface allows the retrieval of executable scripts:</paragraph> <section id="Python_getBasicScript" > <bookmark branch="index" id="N0341"> <bookmark_value>API;script.provider.MasterScriptProviderFactory: Retrieving Basic scripts</bookmark_value> @@ -69,7 +69,7 @@ <bookmark branch="index" id="N0364ndx"> <bookmark_value>API;script.provider.XScript : Executing Basic scripts</bookmark_value> </bookmark> - <paragraph role="paragraph" id="N0364">The %PRODUCTNAME Software Development Kit (SDK) documentation for <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScript.html#a11a551f5a2520f74c5109cd8c9f8c7b7" name ="XScript interface">com.sun.star.script.provider.XScript</link> interface details the calling convention for inter-language calls. Invocation of functions requires three arrays:</paragraph> + <paragraph role="paragraph" id="N0364">The %PRODUCTNAME Software Development Kit (SDK) documentation for <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScript.html#a11a551f5a2520f74c5109cd8c9f8c7b7">com.sun.star.script.provider.XScript</link> interface details the calling convention for inter-language calls. Invocation of functions requires three arrays:</paragraph> <list type="unordered"> <listitem><paragraph role="listitem" id="N0365">the first lists the arguments of the called routine</paragraph></listitem> <listitem><paragraph role="listitem" id="N0366">the second identifies modified arguments</paragraph></listitem> @@ -81,8 +81,8 @@ <paragraph role="paragraph" localize="false" id="N0370"><input>script.invoke((message,), tuple, ())</input></paragraph> <paragraph role="paragraph" localize="false" id="N0371"><input>script.invoke((args), (), results)</input></paragraph> <h3 id="N0372">Examples of Personal or Shared Scripts</h3> - <paragraph role="paragraph" id="N0373">Examples in <link href="text/sbasic/python/python_screen.xhp" name ="Input/Output to Screen">Input/Output to Screen</link> detail Python to Basic invocation calls. <link href="text/sbasic/python/python_document_events.xhp" name ="Monitoring Document Events">Monitoring Document Events</link> illustrates the usage of *args Python idiom to print a variable number of parameters to <literal>Access2Base</literal> logging console dialog.</paragraph> - <tip id="N0374">At time of development you can interrupt Python script execution using <link href="https://berma.pagesperso-orange.fr/index2.html" name ="Xray extension">Xray extension</link> in order to inspect properties and methods of UNO objects. The APSO extension debugger allows object introspection using either Xray either MRI extensions.</tip> + <paragraph role="paragraph" id="N0373">Examples in <link href="text/sbasic/python/python_screen.xhp">Input/Output to Screen</link> detail Python to Basic invocation calls. <link href="text/sbasic/python/python_document_events.xhp">Monitoring Document Events</link> illustrates the usage of *args Python idiom to print a variable number of parameters to <literal>Access2Base</literal> logging console dialog.</paragraph> + <tip id="N0374">At time of development you can interrupt Python script execution using <link href="https://berma.pagesperso-orange.fr/index2.html">Xray extension</link> in order to inspect properties and methods of UNO objects. The APSO extension debugger allows object introspection using either Xray either MRI extensions.</tip> <pycode> <paragraph role="pycode" id="N0375" localize="false">def xray(myObject):</paragraph> <paragraph role="pycode" id="N0376" localize="false"> script = getBasicScript(library="XrayTool", module="_Main", macro="Xray")</paragraph> diff --git a/source/text/sbasic/python/python_dialogs.xhp b/source/text/sbasic/python/python_dialogs.xhp index ee6c6ee0fc..cd10848260 100644 --- a/source/text/sbasic/python/python_dialogs.xhp +++ b/source/text/sbasic/python/python_dialogs.xhp @@ -21,9 +21,9 @@ <bookmark_value>dialogs;Python</bookmark_value> </bookmark> <section id="pythondialog1"> - <h1 id="N0336"><variable id="pythondialog"><link href="text/sbasic/python/python_dialogs.xhp" name="command_name">Opening a Dialog with Python</link></variable></h1> + <h1 id="N0336"><variable id="pythondialog"><link href="text/sbasic/python/python_dialogs.xhp">Opening a Dialog with Python</link></variable></h1> </section> - <paragraph role="paragraph" id="N0337">%PRODUCTNAME static dialogs are created with the <link href="text/sbasic/guide/create_dialog.xhp" name="dialog editor">Dialog editor</link> and are stored in varying places according to their personal (My Macros), shared (Application Macros) or document-embedded nature. In reverse, dynamic dialogs are constructed at runtime, from Basic or Python scripts, or using any other <link href="text/shared/guide/scripting.xhp">%PRODUCTNAME supported language</link> for that matter. Opening static dialogs with Python is illustrated herewith. Exception handling and internationalization are omitted for clarity.</paragraph> + <paragraph role="paragraph" id="N0337">%PRODUCTNAME static dialogs are created with the <link href="text/sbasic/guide/create_dialog.xhp">Dialog editor</link> and are stored in varying places according to their personal (My Macros), shared (Application Macros) or document-embedded nature. In reverse, dynamic dialogs are constructed at runtime, from Basic or Python scripts, or using any other <link href="text/shared/guide/scripting.xhp">%PRODUCTNAME supported language</link> for that matter. Opening static dialogs with Python is illustrated herewith. Exception handling and internationalization are omitted for clarity.</paragraph> <h2 id="N0338">My Macros or Application Macros dialogs</h2> <paragraph role="paragraph" id="N0339">The examples below open <literal>Access2Base Trace</literal> console or the imported <literal>TutorialsDialog</literal> dialog with <menuitem>Tools - Macros - Run Macro</menuitem> menu:</paragraph> <pycode> diff --git a/source/text/sbasic/python/python_document_events.xhp b/source/text/sbasic/python/python_document_events.xhp index 814047b1be..883f7697ef 100644 --- a/source/text/sbasic/python/python_document_events.xhp +++ b/source/text/sbasic/python/python_document_events.xhp @@ -26,7 +26,7 @@ <bookmark_value>API;lang.EventObject: Monitoring Document Event</bookmark_value> </bookmark> <section id="pythonmonitor1"> - <h1 id="N0527"><variable id="pythonmonitor"><link href="text/sbasic/python/python_document_events.xhp" name="Monitoring Document Events">Listening to Document Events</link></variable></h1> + <h1 id="N0527"><variable id="pythonmonitor"><link href="text/sbasic/python/python_document_events.xhp">Listening to Document Events</link></variable></h1> <paragraph role="paragraph" id="par_id641630582314861">Listening to document events can help in the following situations:</paragraph> <list type="unordered"> <listitem> @@ -42,7 +42,7 @@ <paragraph id="par_id601630582398998" role="listitem">Import math Python packages before opening a Calc document. Release these packages when the document closes.</paragraph> </listitem> </list> - <paragraph role="paragraph" id="N0528">Next to <link href="text/sbasic/shared/01040000.xhp" name ="assigning macros to events">assigning macros to events</link>, one can monitor events raised by %PRODUCTNAME documents. Application Programming Interface (API) broadcasters are responsible for calling event scripts. Unlike listeners that require to define all supported methods, even if unused, document monitors require only two methods next to hooked event scripts.</paragraph> + <paragraph role="paragraph" id="N0528">Next to <link href="text/sbasic/shared/01040000.xhp">assigning macros to events</link>, one can monitor events raised by %PRODUCTNAME documents. Application Programming Interface (API) broadcasters are responsible for calling event scripts. Unlike listeners that require to define all supported methods, even if unused, document monitors require only two methods next to hooked event scripts.</paragraph> </section> <h2 id="N0529">Monitoring Document Events</h2> <paragraph role="paragraph" id="N0530">Monitoring is illustrated herewith for Basic and Python languages using object-oriented programming. Assigning <literal>OnLoad</literal> script, to the <menuitem>Open Document</menuitem> event, suffices to initiate and terminate document event monitoring. <menuitem>Tools - Customize</menuitem> menu <menuitem>Events</menuitem> tab is used to assign either scripts.</paragraph> @@ -163,7 +163,7 @@ <paragraph role="pycode" localize="false" id="N0646"> return xScript</paragraph> </pycode> <warning id="N0647">Mind the misspelled <literal>documentEventOccured</literal> method that inherits a typo from %PRODUCTNAME Application Programming Interface (API).</warning> - <paragraph role="tip" id="N0648"><menuitem>Start application</menuitem> and <menuitem>Close application</menuitem> events can respectively be used to set and to unset Python path for user scripts or %PRODUCTNAME scripts. In a similar fashion, document based Python libraries or modules can be loaded and released using <menuitem>Open document</menuitem> and <menuitem>Document closed</menuitem> events. Refer to <link href="text/sbasic/python/python_import.xhp" name ="Importing Python Modules">Importing Python Modules</link> for more information.</paragraph> + <paragraph role="tip" id="N0648"><menuitem>Start application</menuitem> and <menuitem>Close application</menuitem> events can respectively be used to set and to unset Python path for user scripts or %PRODUCTNAME scripts. In a similar fashion, document based Python libraries or modules can be loaded and released using <menuitem>Open document</menuitem> and <menuitem>Document closed</menuitem> events. Refer to <link href="text/sbasic/python/python_import.xhp">Importing Python Modules</link> for more information.</paragraph> <h3 id="N0649">With %PRODUCTNAME Basic</h3> <bookmark xml-lang="en-US" branch="index" id="bm_id591622446367707"> <bookmark_value>API;GlobalScope.BasicLibraries</bookmark_value> @@ -269,7 +269,7 @@ <paragraph role="pycode" localize="false" id="N0745"> </paragraph> <paragraph role="pycode" localize="false" id="N0746">g_exportedScripts = (displayAvailableEvents,)</paragraph> </pycode> - <note id="N0747">The <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-python" name ="Alternative Python Script Organizer">Alternative Python Script Organizer (APSO)</link> extension is used to render events information on screen.</note> + <note id="N0747">The <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-python">Alternative Python Script Organizer (APSO)</link> extension is used to render events information on screen.</note> <h3 id="N0748">With %PRODUCTNAME Basic</h3> <bascode> <paragraph role="bascode" localize="false" id="N0749">Sub DisplayAvailableEvents</paragraph> diff --git a/source/text/sbasic/python/python_examples.xhp b/source/text/sbasic/python/python_examples.xhp index 90913e6528..6085266cd5 100644 --- a/source/text/sbasic/python/python_examples.xhp +++ b/source/text/sbasic/python/python_examples.xhp @@ -22,7 +22,7 @@ <bookmark_value>Python;session</bookmark_value> <bookmark_value>Python;screen input/output</bookmark_value> </bookmark> - <h1 id="hd_id201901031407"><variable id="pythonexamples2"><link href="text/sbasic/python/python_examples.xhp" name="python examples">Python programming examples</link></variable></h1> + <h1 id="hd_id201901031407"><variable id="pythonexamples2"><link href="text/sbasic/python/python_examples.xhp">Python programming examples</link></variable></h1> </section> <embed href="text/sbasic/python/python_session.xhp#pythonsession"/> <embed href="text/sbasic/python/python_platform.xhp#pythonplatform"/> diff --git a/source/text/sbasic/python/python_handler.xhp b/source/text/sbasic/python/python_handler.xhp index 87887105e3..0378032847 100644 --- a/source/text/sbasic/python/python_handler.xhp +++ b/source/text/sbasic/python/python_handler.xhp @@ -24,8 +24,8 @@ <bookmark_value>API;XDialogEventHandler</bookmark_value> </bookmark> <bookmark xml-lang="en-US" branch="hid/cui/ui/assigncomponentdialog/AssignComponent" id="bm_id66701251" localize="false"/> - <h1 id="N0665"><variable id="pythonhandler_h1"><link href="text/sbasic/python/python_handler.xhp" name="Creating a Dialog Handler">Creating a Dialog Handler</link></variable></h1> - <paragraph role="paragraph" id="N0666">Next to <link href="text/sbasic/shared/01040000.xhp" name ="Assigning macros to events">assigning macros to events</link> or <link href="text/sbasic/basic/python/python_listener" name ="creating event listeners">creating event listeners</link>, one can use dialog handlers, whose principle is to define UNO keywords, or methods, that are mapped to events to watch for. The event handler is responsible for executing methods using the <literal>vnd.sun.star.UNO:<method_name></literal> protocol. Unlike listeners that require to define all supported methods, even if unused, dialog handlers require only two methods on top of intended control hook scripts.</paragraph> + <h1 id="N0665"><variable id="pythonhandler_h1"><link href="text/sbasic/python/python_handler.xhp">Creating a Dialog Handler</link></variable></h1> + <paragraph role="paragraph" id="N0666">Next to <link href="text/sbasic/shared/01040000.xhp">assigning macros to events</link> or <link href="text/sbasic/basic/python/python_listener">creating event listeners</link>, one can use dialog handlers, whose principle is to define UNO keywords, or methods, that are mapped to events to watch for. The event handler is responsible for executing methods using the <literal>vnd.sun.star.UNO:<method_name></literal> protocol. Unlike listeners that require to define all supported methods, even if unused, dialog handlers require only two methods on top of intended control hook scripts.</paragraph> <paragraph role="paragraph" id="N0667">The advantages of this approach are:</paragraph> <list type="unordered"> <listitem><paragraph role="listitem" id="N0668">It packs the code that handles event-driven macros,</paragraph></listitem> @@ -34,7 +34,7 @@ <paragraph role="paragraph" id="N0670">This mechanism is illustrated herewith for Basic and Python languages using an imported copy of <literal>Access2Base</literal> <literal>dlgTrace</literal> dialog. Exception handling and localisation are omitted for clarity.</paragraph> <h2 id="N0671">Assigning Dialog methods</h2> <paragraph role="paragraph" id="N0672">Export <literal>Access2Base</literal> <literal>dlgTrace</literal> dialog and import it into <literal>MyLib</literal> application library.</paragraph> - <paragraph role="paragraph" id="N0673">Inside the control properties pane of the <link href="text/sbasic/guide/create_dialog.xhp" name ="Dialog Editor">Dialog Editor</link>, use the Events tab to replace macro assignments by component assignments, and type in the intended method names:</paragraph> + <paragraph role="paragraph" id="N0673">Inside the control properties pane of the <link href="text/sbasic/guide/create_dialog.xhp">Dialog Editor</link>, use the Events tab to replace macro assignments by component assignments, and type in the intended method names:</paragraph> <list type="unordered"> <listitem><paragraph role="listitem" id="N0674">Set <literal>Dump to file</literal> dialog button component method name to <literal>_dump2File</literal></paragraph></listitem> <listitem><paragraph role="listitem" id="N0675">Optionally define <literal>txtTracelog</literal> key pressed and mouse button pressed events component method names as <literal>_openHelp</literal></paragraph></listitem> @@ -42,7 +42,7 @@ </list> <paragraph role="paragraph" id="N0677">Events assigned actions should mention the <literal>vnd.sun.star.UNO:</literal> protocol.</paragraph> <h2 id="N0678">Creating the handler</h2> - <paragraph role="paragraph" id="N0679"><literal>createDialogWithHandler</literal> method of <link href="https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1awt_1_1DialogProvider2.html" name ="com.sun.star.awt.DialogProvider2">com.sun.star.awt.DialogProvider2</link> service is used to set the dialog and its handler. The handler is responsible for implementing <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1awt_1_1XDialogEventHandler.html" name ="com.sun.star.awt.XDialogEventHandler">com.sun.star.awt.XDialogEventHandler</link> interface.</paragraph> + <paragraph role="paragraph" id="N0679"><literal>createDialogWithHandler</literal> method of <link href="https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1awt_1_1DialogProvider2.html">com.sun.star.awt.DialogProvider2</link> service is used to set the dialog and its handler. The handler is responsible for implementing <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1awt_1_1XDialogEventHandler.html">com.sun.star.awt.XDialogEventHandler</link> interface.</paragraph> <warning id="N0680">All component method names must be explicitly declared when using a dialog handler.</warning> <h3 id="N0681">With Python</h3> <paragraph role="paragraph" id="N0682">In this example the dialog is located on the computer.</paragraph> @@ -110,7 +110,7 @@ <paragraph role="pycode" localize="false" id="N0739"> </paragraph> </pycode> <note id="N0740">As expected, <literal>onOkHasFocus</literal> missing method throws an exception.</note> - <tip id="N0741">Refer to <link href="text/sbasic/python/python_2_basic.xhp" name ="Python calls to %PRODUCTNAME Basic">Python calls to %PRODUCTNAME Basic</link> page for <literal>getBasicScript</literal> routine description and for details about cross-language scripting execution.</tip> + <tip id="N0741">Refer to <link href="text/sbasic/python/python_2_basic.xhp">Python calls to %PRODUCTNAME Basic</link> page for <literal>getBasicScript</literal> routine description and for details about cross-language scripting execution.</tip> <h3 id="N0742">With %PRODUCTNAME Basic</h3> <paragraph role="paragraph" id="N0743">In this example the dialog is embedded in a document, and can equally be located on the computer.</paragraph> <bascode> @@ -158,7 +158,7 @@ <section id="relatedtopics" > <embed href="text/sbasic/python/python_2_basic.xhp#py2ba_h1"/> <embed href="text/sbasic/guide/show_dialog.xhp#show_dialog"/> - <paragraph role="paragraph" id="N0505"><link href="text/sbasic/shared/03132000.xhp" name ="CreateUnoListener Function">CreateUnoListener Function</link></paragraph> + <paragraph role="paragraph" id="N0505"><link href="text/sbasic/shared/03132000.xhp">CreateUnoListener Function</link></paragraph> <embed href="text/sbasic/python/python_listener.xhp#pythonlistener"/> <embed href="text/sbasic/python/python_dialogs.xhp#pythondialog"/> <embed href="text/sbasic/python/python_document_events.xhp#pythonmonitor"/> diff --git a/source/text/sbasic/python/python_ide.xhp b/source/text/sbasic/python/python_ide.xhp index e6d715630e..2f14ea9f64 100644 --- a/source/text/sbasic/python/python_ide.xhp +++ b/source/text/sbasic/python/python_ide.xhp @@ -23,12 +23,12 @@ <bookmark_value>python;IDE - integrated development environment</bookmark_value> <bookmark_value>python;editor</bookmark_value> </bookmark> - <h1 id="hd_id151543348965464"><variable id="pythonideh1"><link href="text/sbasic/python/python_ide.xhp" name="Python IDE Setup">Setting up an Integrated Development Environment (IDE) for Python</link></variable></h1> + <h1 id="hd_id151543348965464"><variable id="pythonideh1"><link href="text/sbasic/python/python_ide.xhp">Setting up an Integrated Development Environment (IDE) for Python</link></variable></h1> <paragraph id="par_id541543348965465" role="paragraph" xml-lang="en-US">Writing Python macros requires extra configuration steps to set an IDE of choice.</paragraph> </section> - <paragraph role="paragraph" id="N0106">Unlike Basic language macros development in %PRODUCTNAME, developing Python scripts for %PRODUCTNAME requires to configure an external Integrated Development Environment (IDE). Multiple IDEs are available that range from beginners to advanced Python coders. While using a Python IDE programmers benefit from numerous features such as syntax highlighting, code folding, class browsing, code completion, coding standard enforcement, test driven development, debugging, version control and many more. You can refer to <link href="https://wiki.documentfoundation.org/Macros/Python_Design_Guide" name="Designing & Developing Python Applications">Designing & Developing Python Applications</link> on the Wiki for more in-depth information about the setup of a bridge between your IDE and a running instance %PRODUCTNAME.</paragraph> + <paragraph role="paragraph" id="N0106">Unlike Basic language macros development in %PRODUCTNAME, developing Python scripts for %PRODUCTNAME requires to configure an external Integrated Development Environment (IDE). Multiple IDEs are available that range from beginners to advanced Python coders. While using a Python IDE programmers benefit from numerous features such as syntax highlighting, code folding, class browsing, code completion, coding standard enforcement, test driven development, debugging, version control and many more. You can refer to <link href="https://wiki.documentfoundation.org/Macros/Python_Design_Guide">Designing & Developing Python Applications</link> on the Wiki for more in-depth information about the setup of a bridge between your IDE and a running instance %PRODUCTNAME.</paragraph> <h2 id="hd_id761544698669786">The APSO Extension</h2> - <paragraph role="paragraph" id="N0104">The <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-python" name="Alternative Python Script Organizer (APSO)">Alternative Python Script Organizer (APSO)</link> extension eases the edition of Python scripts, in particular when embedded in a document. Using APSO you can configure your preferred source code editor, start the integrated Python shell and debug Python scripts. Extensions exist that help inspect arbitrary UNO objects, refer to <link href="https://wiki.documentfoundation.org/Macros/Python_Design_Guide" name="eDesigning & Developing Python Applications">Designing & Developing Python Applications</link> for additional details on such extensions.</paragraph> + <paragraph role="paragraph" id="N0104">The <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-python">Alternative Python Script Organizer (APSO)</link> extension eases the edition of Python scripts, in particular when embedded in a document. Using APSO you can configure your preferred source code editor, start the integrated Python shell and debug Python scripts. Extensions exist that help inspect arbitrary UNO objects, refer to <link href="https://wiki.documentfoundation.org/Macros/Python_Design_Guide">Designing & Developing Python Applications</link> for additional details on such extensions.</paragraph> <section id="relatedtopics"> <embed href="text/sbasic/python/main0000.xhp#pythonscriptshelp"/> </section> diff --git a/source/text/sbasic/python/python_import.xhp b/source/text/sbasic/python/python_import.xhp index af3b243d3b..da92932beb 100644 --- a/source/text/sbasic/python/python_import.xhp +++ b/source/text/sbasic/python/python_import.xhp @@ -21,7 +21,7 @@ <bookmark_value>Python;pythonpath</bookmark_value> <bookmark_value>PythonLibraries</bookmark_value> </bookmark> - <h1 id="N0462"><variable id="pythonimporth1"><link href="text/sbasic/python/python_import.xhp" name="python imports">Importing Python Modules</link></variable></h1> + <h1 id="N0462"><variable id="pythonimporth1"><link href="text/sbasic/python/python_import.xhp">Importing Python Modules</link></variable></h1> <paragraph role="paragraph" id="N0463">%PRODUCTNAME Python scripts come in three distinct flavors, they can be personal, shared or embedded in documents. They are stored in varying places described in <link href="text/sbasic/python/python_locations.xhp">Python Scripts Organization and Location</link>. In order to import Python modules, their locations must be known from Python at run time.</paragraph> <paragraph role="paragraph" id="N0464">This mechanism is illustrated for file system based modules and document based modules. Exception handling is omitted for clarity. The terms library or directory, scripts or modules are used interchangeably. A Python macro refers to a function inside a module.</paragraph> <warning id="N0465">Note that <literal><User Profile>/Scripts/python/pythonpath</literal> local directory is always explored when running a Python macro from <literal><User Profile>/Scripts/python</literal>.</warning> diff --git a/source/text/sbasic/python/python_listener.xhp b/source/text/sbasic/python/python_listener.xhp index c9f97398a8..f4f88165c3 100644 --- a/source/text/sbasic/python/python_listener.xhp +++ b/source/text/sbasic/python/python_listener.xhp @@ -26,9 +26,9 @@ <bookmark_value>API;XActionListener</bookmark_value> </bookmark> <section id="pythonlistener1"> - <h1 id="N0386"><variable id="pythonlistener"><link href="text/sbasic/python/python_listener.xhp" name="python listeners">Creating Event Listeners</link></variable></h1> + <h1 id="N0386"><variable id="pythonlistener"><link href="text/sbasic/python/python_listener.xhp">Creating Event Listeners</link></variable></h1> </section> - <paragraph role="paragraph" id="N0387">Events raised by dialogs, documents, forms or graphical controls can be linked to macros, which is referred to as event-driven programming. The most common method to relate events to macros are the <literal>Events</literal> tab in <menuitem>Tools – Customize</menuitem> menu and the <link href="text/sbasic/guide/create_dialog.xhp" name ="Create dialog">Dialog Editor</link> Control properties pane from <menuitem>Tools - Macros – Organise Dialogs...</menuitem> menu.</paragraph> + <paragraph role="paragraph" id="N0387">Events raised by dialogs, documents, forms or graphical controls can be linked to macros, which is referred to as event-driven programming. The most common method to relate events to macros are the <literal>Events</literal> tab in <menuitem>Tools – Customize</menuitem> menu and the <link href="text/sbasic/guide/create_dialog.xhp">Dialog Editor</link> Control properties pane from <menuitem>Tools - Macros – Organise Dialogs...</menuitem> menu.</paragraph> <paragraph role="paragraph" id="N0388">Graphical artifacts, keyboard inputs, mouse moves and other man/machine interactions can be controlled using UNO listeners that watch for the user’s behavior. Listeners are dynamic program code alternatives to macro assignments. One may create as many UNO listeners as events to watch for. A single listener can also handle multiple user interface controls.</paragraph> <h2 id="N0389">Creating an event listener</h2> <paragraph role="paragraph" id="N0390">Listeners get attached to controls held in dialogs, as well as to document or form events. Listeners are also used when creating runtime dialogs or when adding controls to a dialog on the fly.</paragraph> @@ -152,13 +152,13 @@ <paragraph role="bascode" localize="false" id="N0497">End Sub ' awt_disposing</paragraph> </bascode> <h2 id="N0498">Other Event Listeners</h2> - <paragraph role="paragraph" id="N0499">Listeners are usually coded along with <link href="text/sbasic/python/python_dialogs.xhp" name ="dialog opening">dialog opening</link>. Numerous listener approaches are possible such as event handlers for dialogs or event monitors for documents or forms.</paragraph> + <paragraph role="paragraph" id="N0499">Listeners are usually coded along with <link href="text/sbasic/python/python_dialogs.xhp">dialog opening</link>. Numerous listener approaches are possible such as event handlers for dialogs or event monitors for documents or forms.</paragraph> <section id="relatedtopics" > <embed href="text/sbasic/guide/sample_code.xhp#sample_code"/> <embed href="text/sbasic/shared/03132000.xhp#CreateUnoListener"/> <embed href="text/swriter/01/05060700.xhp#"/> - <paragraph role="paragraph" id="N0506"><link href="text/swriter/01/05060700.xhp" name ="Events mapping to objects">Events mapping to objects</link></paragraph> - <paragraph role="paragraph" id="N0509">See also <link href="text/sbasic/shared/01040000.xhp" name ="Document events">Document events</link>, <link href="text/shared/02/01170202.xhp" name ="Form events">Form events</link>.</paragraph> + <paragraph role="paragraph" id="N0506"><link href="text/swriter/01/05060700.xhp">Events mapping to objects</link></paragraph> + <paragraph role="paragraph" id="N0509">See also <link href="text/sbasic/shared/01040000.xhp">Document events</link>, <link href="text/shared/02/01170202.xhp">Form events</link>.</paragraph> <embed href="text/sbasic/python/python_handler.xhp#pythonhandler_h1"/> <embed href="text/sbasic/python/python_document_events.xhp#pythonmonitor"/> <embed href="text/sbasic/python/python_examples.xhp#pythonexamples2"/> diff --git a/source/text/sbasic/python/python_locations.xhp b/source/text/sbasic/python/python_locations.xhp index 9f145416a8..6895faa1b0 100644 --- a/source/text/sbasic/python/python_locations.xhp +++ b/source/text/sbasic/python/python_locations.xhp @@ -17,7 +17,7 @@ </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="hd_id391543358231021" role="heading" level="1" xml-lang="en-US"><variable id="pythonlocations1"><link href="text/sbasic/python/python_locations.xhp">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> @@ -37,7 +37,7 @@ </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> + <paragraph id="par_id121551089455774" role="paragraph" xml-lang="en-US">Refer to <link href="text/sbasic/python/python_session.xhp">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> diff --git a/source/text/sbasic/python/python_platform.xhp b/source/text/sbasic/python/python_platform.xhp index 9056ffaf3f..a96c01fc54 100644 --- a/source/text/sbasic/python/python_platform.xhp +++ b/source/text/sbasic/python/python_platform.xhp @@ -24,7 +24,7 @@ <bookmark_value>API;ConfigurationAccess</bookmark_value> <bookmark_value>Tools;GetRegistryContent</bookmark_value> </bookmark> - <h1 id="N0509"><variable id="pythonplatform"><link href="text/sbasic/python/python_platform.xhp" name="platform01">Identifying the operating system</link></variable></h1> + <h1 id="N0509"><variable id="pythonplatform"><link href="text/sbasic/python/python_platform.xhp">Identifying the operating system</link></variable></h1> <paragraph role="paragraph" id="N0510">Identifying the operating system can be performed with Python or Basic language.</paragraph> <note id="N0511">ComputerName property is solely available for Windows. Basic calls to Python macros help overcome %PRODUCTNAME Basic limitations.</note> <h2 id="N0512">Using a Python class:</h2> diff --git a/source/text/sbasic/python/python_programming.xhp b/source/text/sbasic/python/python_programming.xhp index f70148d687..71ba96cbc1 100644 --- a/source/text/sbasic/python/python_programming.xhp +++ b/source/text/sbasic/python/python_programming.xhp @@ -26,11 +26,11 @@ <bookmark_value>uno.py;getDocument</bookmark_value> </bookmark> <section id="pythonprogramming"> - <h1 id="hd_id691546462755220"><variable id="pythonprogrammingheading"><link href="text/sbasic/python/python_programming.xhp" name="python programming">Programming with Python Scripts</link></variable></h1> + <h1 id="hd_id691546462755220"><variable id="pythonprogrammingheading"><link href="text/sbasic/python/python_programming.xhp">Programming with Python Scripts</link></variable></h1> </section> - <paragraph role="paragraph" id="N0220">A Python macro is a function within a .py file, identified as a module. Unlike %PRODUCTNAME Basic and its dozen of <link href="text/sbasic/shared/uno_objects.xhp" name="UNO objects functions or services">UNO objects functions or services</link>, Python macros use the <literal>XSCRIPTCONTEXT</literal> UNO single object, shared with JavaScript and BeanShell. The <literal>g_exportedScripts</literal> global tuple explicitly lists selectable macros from a module. Python modules hold autonomous code logic, and are independent from one another.</paragraph> + <paragraph role="paragraph" id="N0220">A Python macro is a function within a .py file, identified as a module. Unlike %PRODUCTNAME Basic and its dozen of <link href="text/sbasic/shared/uno_objects.xhp">UNO objects functions or services</link>, Python macros use the <literal>XSCRIPTCONTEXT</literal> UNO single object, shared with JavaScript and BeanShell. The <literal>g_exportedScripts</literal> global tuple explicitly lists selectable macros from a module. Python modules hold autonomous code logic, and are independent from one another.</paragraph> <h2 id="N0221">XSCRIPTCONTEXT Global Variable</h2> - <paragraph role="paragraph" id="N0222">Genuine Basic UNO facilities can be inferred from <literal>XSCRIPTCONTEXT</literal> global variable. Refer to %PRODUCTNAME API for a complete <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScriptContext.html" name="description of XSCRIPTCONTEXT">description of XSCRIPTCONTEXT</link>. <literal>XSCRIPTCONTEXT</literal> methods summarize as:</paragraph> + <paragraph role="paragraph" id="N0222">Genuine Basic UNO facilities can be inferred from <literal>XSCRIPTCONTEXT</literal> global variable. Refer to %PRODUCTNAME API for a complete <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScriptContext.html">description of XSCRIPTCONTEXT</link>. <literal>XSCRIPTCONTEXT</literal> methods summarize as:</paragraph> <table id="N0223"> <tablerow> <tablecell> @@ -82,10 +82,10 @@ <h2 id="N0239">Module import</h2> <warning id="N0240"><literal>XSCRIPTCONTEXT</literal> is not provided to imported modules.</warning> <section id="PythonFileSystemImport" > - <paragraph role="paragraph" id="N0241">%PRODUCTNAME Basic libraries contain classes, routines and variables, Python modules contain classes, functions and variables. Common pieces of reusable Python or UNO features must be stored in <link href="text/sbasic/python/python_locations.xhp" name="My macros">My macros</link> within <literal>(User Profile)/Scripts/python/pythonpath</literal>. Python libraries help organize modules in order to prevent module name collisions. Import <literal>uno.py</literal> inside shared modules.</paragraph> + <paragraph role="paragraph" id="N0241">%PRODUCTNAME Basic libraries contain classes, routines and variables, Python modules contain classes, functions and variables. Common pieces of reusable Python or UNO features must be stored in <link href="text/sbasic/python/python_locations.xhp">My macros</link> within <literal>(User Profile)/Scripts/python/pythonpath</literal>. Python libraries help organize modules in order to prevent module name collisions. Import <literal>uno.py</literal> inside shared modules.</paragraph> </section> <section id="uno"> - <paragraph role="paragraph" id="N0242">Genuine BASIC UNO facilities can be inferred using <literal>uno.py</literal> module. Use <link href="text/sbasic/python/python_shell.xhp" name="Python interactive shell">Python interactive shell</link> to get a complete module description using <literal>dir()</literal> and <literal>help()</literal> Python commands.</paragraph> + <paragraph role="paragraph" id="N0242">Genuine BASIC UNO facilities can be inferred using <literal>uno.py</literal> module. Use <link href="text/sbasic/python/python_shell.xhp">Python interactive shell</link> to get a complete module description using <literal>dir()</literal> and <literal>help()</literal> Python commands.</paragraph> <bookmark xml-lang="en-US" branch="index" id="bm_id391659034206678"> <bookmark_value>uno.py</bookmark_value> <bookmark_value>uno.py;absolutize</bookmark_value> @@ -221,7 +221,7 @@ </tablerow> <tablerow> <tablecell> - <paragraph role="tablecontent" id="N0284">See <link href="text/sbasic/python/python_dialogs.xhp" name="Opening a Dialog">Opening a Dialog</link></paragraph> + <paragraph role="tablecontent" id="N0284">See <link href="text/sbasic/python/python_dialogs.xhp">Opening a Dialog</link></paragraph> </tablecell> <tablecell> <paragraph role="tablecontent" localize="false" id="N0285">CreateUnoDialog()</paragraph> @@ -229,7 +229,7 @@ </tablerow> <tablerow> <tablecell> - <paragraph role="tablecontent" id="N0286">See <link href="text/sbasic/python/python_listener.xhp" name="Creating a Listener">Creating a Listener</link></paragraph> + <paragraph role="tablecontent" id="N0286">See <link href="text/sbasic/python/python_listener.xhp">Creating a Listener</link></paragraph> </tablecell> <tablecell> <paragraph role="tablecontent" localize="false" id="N0287">CreateUnoListener()</paragraph> @@ -303,7 +303,7 @@ </table> <h2 id="N1297">Importing an embedded Module</h2> <section id="PythonEmbeddedImport" > - <paragraph role="paragraph" id="N1298">Similarly to %PRODUCTNAME Basic that supports browsing and dynamic loading of libraries, Python libraries can be explored and imported on demand. For more information on library containers, visit <link href="https://api.libreoffice.org/" name="API Documentation site">%PRODUCTNAME Application Programming Interface</link> (API) or download <link href="https://www.libreoffice.org/download/download/" name="SDK download page">%PRODUCTNAME Software Development Kit</link> (SDK).</paragraph> + <paragraph role="paragraph" id="N1298">Similarly to %PRODUCTNAME Basic that supports browsing and dynamic loading of libraries, Python libraries can be explored and imported on demand. For more information on library containers, visit <link href="https://api.libreoffice.org/">%PRODUCTNAME Application Programming Interface</link> (API) or download <link href="https://www.libreoffice.org/download/download/">%PRODUCTNAME Software Development Kit</link> (SDK).</paragraph> <paragraph role="paragraph" id="N3299">Importing a Python document embedded module is illustrated below, exception handling is not detailed:</paragraph> <pycode> <paragraph role="pycode" localize="false" id="N1300">import uno, sys</paragraph> @@ -329,7 +329,7 @@ </pycode> </section> <section id="relatedtopics"> - <paragraph role="paragraph" id="N0321"><link href="text/sbasic/shared/uno_objects.xhp" name="UNO objects page">Basic UNO Objects, Functions and Services</link></paragraph> + <paragraph role="paragraph" id="N0321"><link href="text/sbasic/shared/uno_objects.xhp">Basic UNO Objects, Functions and Services</link></paragraph> <embed href="text/sbasic/python/python_import.xhp#pythonimporth1"/> <embed href="text/sbasic/python/python_screen.xhp#ioscreen"/> <embed href="text/sbasic/python/main0000.xhp#pythonscriptshelp"/> diff --git a/source/text/sbasic/python/python_screen.xhp b/source/text/sbasic/python/python_screen.xhp index a40c6bc793..2cfc4c23cf 100644 --- a/source/text/sbasic/python/python_screen.xhp +++ b/source/text/sbasic/python/python_screen.xhp @@ -22,9 +22,9 @@ <bookmark_value>API;script.provider.MasterScriptProvider: Screen Input/Output</bookmark_value> <bookmark_value>API;script.provider.XScript: Screen Input/Output</bookmark_value> </bookmark> - <h1 id="N0434"><variable id="ioscreen"><link href="text/sbasic/python/python_screen.xhp" name="IO to screen">Input/Output to Screen</link></variable></h1> + <h1 id="N0434"><variable id="ioscreen"><link href="text/sbasic/python/python_screen.xhp">Input/Output to Screen</link></variable></h1> <paragraph role="paragraph" id="N0435">Python standard output file is not available when running Python macros from <menuitem>Tools – Macros - Run Macro</menuitem>... menu. Presenting the output of a module requires the Python interactive console. Features such as <literal>input()</literal>, <literal>print()</literal>, <literal>repr()</literal> and <literal>str()</literal> are available from the Python shell.</paragraph> - <tip id="msgbox_tip">%PRODUCTNAME <literal>msgbox</literal> Python module proposes a <literal>msgbox()</literal> method that is illustrated in <link href="text/sbasic/python/python_handler.xhp" name="msgbox example">Creating Event Listeners</link> and <link href="text/sbasic/python/python_handler.xhp" name="msgbox_example">Creating a dialog handler</link> example pages.</tip> + <tip id="msgbox_tip">%PRODUCTNAME <literal>msgbox</literal> Python module proposes a <literal>msgbox()</literal> method that is illustrated in <link href="text/sbasic/python/python_handler.xhp">Creating Event Listeners</link> and <link href="text/sbasic/python/python_handler.xhp">Creating a dialog handler</link> example pages.</tip> <paragraph role="paragraph" id="N0437">%PRODUCTNAME Basic proposes <literal>InputBox()</literal>, <literal>Msgbox()</literal> and <literal>Print()</literal> screen I/O functions. Python alternatives exist relying either on %PRODUCTNAME API Abstract Windowing Toolkit, either on Python to Basic function calls. The latter proposes a syntax that is intentionally close to that of Basic, and uses a Python module next to a Basic module. The API Scripting Framework is used to perform Basic, BeanShell, JavaScript and Python inter-languages function calls.</paragraph> <h2 id="N0438">Python syntax:</h2> <paragraph role="code" id="N0439" localize="false">MsgBox(txt, buttons=0, title=None)<br/></paragraph> @@ -39,10 +39,10 @@ <h2 id="N0449">Installation:</h2> <list type="unordered"> <listitem> - <paragraph role="listitem" id="N0450">Copy <literal>screen_io</literal> Python module in <link href="text/sbasic/python/python_locations.xhp" name="User macros">My macros</link> within <UserProfile>/Scripts/python/pythonpath,</paragraph> + <paragraph role="listitem" id="N0450">Copy <literal>screen_io</literal> Python module in <link href="text/sbasic/python/python_locations.xhp">My macros</link> within <UserProfile>/Scripts/python/pythonpath,</paragraph> </listitem> <listitem> - <paragraph role="listitem" id="N0451">Copy <literal>uiScripts</literal> Basic module in <link href="text/sbasic/python/python_locations.xhp" name="User macros">My macros</link> Standard Basic library,</paragraph> + <paragraph role="listitem" id="N0451">Copy <literal>uiScripts</literal> Basic module in <link href="text/sbasic/python/python_locations.xhp">My macros</link> Standard Basic library,</paragraph> </listitem> <listitem> <paragraph role="listitem" id="N0452">Restart %PRODUCTNAME.</paragraph> @@ -80,7 +80,7 @@ <paragraph role="pycode" localize="false" id="N0490"> xScript = scriptPro.getScript(scriptName)</paragraph> <paragraph role="pycode" localize="false" id="N0491"> return xScript</paragraph> </pycode> - <note id="par_id161655364816553"><literal>MsgBox</literal> and <literal>InputBox</literal> methods from the <link href="text/sbasic/shared/03/sf_basic.xhp" name="Basic service">Basic service</link> included in <link href="text/sbasic/shared/03/lib_ScriptForge.xhp" name="scriptforge module"> the ScriptForge libraries</link> call directly their native Basic counterparts.</note> + <note id="par_id161655364816553"><literal>MsgBox</literal> and <literal>InputBox</literal> methods from the <link href="text/sbasic/shared/03/sf_basic.xhp">Basic service</link> included in <link href="text/sbasic/shared/03/lib_ScriptForge.xhp"> the ScriptForge libraries</link> call directly their native Basic counterparts.</note> <h3 id="N0492"><literal>uiScripts</literal> Basic module</h3> <bascode> <paragraph role="bascode" localize="false" id="N0493">Option Explicit</paragraph> @@ -96,7 +96,7 @@ <paragraph role="bascode" localize="false" id="N0503"> Print msg</paragraph> <paragraph role="bascode" localize="false" id="N0504">End Sub</paragraph> </bascode> - <tip id="tip_APSO">The <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-python" name="apso">Alternative Python Script Organizer</link> (APSO) extension offers a msgbox() function out of its <literal>apso_utils</literal> module.</tip> + <tip id="tip_APSO">The <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-python">Alternative Python Script Organizer</link> (APSO) extension offers a msgbox() function out of its <literal>apso_utils</literal> module.</tip> <section id="relatedtopics"> <embed href="text/sbasic/shared/03010000.xhp#BasicScreenIO"/> <embed href="text/sbasic/python/python_examples.xhp#pythonexamples2"/> diff --git a/source/text/sbasic/python/python_session.xhp b/source/text/sbasic/python/python_session.xhp index f8c378dee7..57538dc779 100644 --- a/source/text/sbasic/python/python_session.xhp +++ b/source/text/sbasic/python/python_session.xhp @@ -24,7 +24,7 @@ <bookmark_value>Session;UserPythonScripts</bookmark_value> <bookmark_value>API;PathSubstitution</bookmark_value> </bookmark> - <h1 id="N0340"><variable id="pythonsession"><link href="text/sbasic/python/python_session.xhp" name="session01">Getting Session Information</link></variable></h1> + <h1 id="N0340"><variable id="pythonsession"><link href="text/sbasic/python/python_session.xhp">Getting Session Information</link></variable></h1> <paragraph role="paragraph" id="N0341">Computing %PRODUCTNAME user profile and shared modules system file paths can be performed with Python or with Basic languages. BeanShell, Java, JavaScript and Python scripts locations can be derived from this information.</paragraph> <h2 id="N0343">Examples:</h2> <paragraph role="paragraph" id="N0344">With Python shell.</paragraph> diff --git a/source/text/sbasic/python/python_shell.xhp b/source/text/sbasic/python/python_shell.xhp index 9fd47cf964..2734089c6d 100644 --- a/source/text/sbasic/python/python_shell.xhp +++ b/source/text/sbasic/python/python_shell.xhp @@ -21,7 +21,7 @@ <bookmark_value>Python;Shell</bookmark_value> </bookmark> <section id="pythonshell"> - <h1 id="N0118"><variable id="pythonshell1"><link href="text/sbasic/python/python_shell.xhp" name="python shell">Running Python Interactive Console</link></variable></h1> + <h1 id="N0118"><variable id="pythonshell1"><link href="text/sbasic/python/python_shell.xhp">Running Python Interactive Console</link></variable></h1> </section> <paragraph role="paragraph" id="N0119">The Python interactive console, also known as Python interpreter or Python shell, provides programmers with a quick way to execute commands and try out and test code without creating a file. UNO objects introspection as well as %PRODUCTNAME Python modules documentation can be obtained from the terminal.</paragraph> @@ -68,14 +68,14 @@ </switch> <h2 id="hd_id311633513620803">Alternative console</h2> - <paragraph role="paragraph" id="par_id81632760673283">Use <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-Python" name="APSO extension">APSO extension</link> console as an alternative:</paragraph> + <paragraph role="paragraph" id="par_id81632760673283">Use <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-Python">APSO extension</link> console as an alternative:</paragraph> <paragraph role="paragraph" id="N0144"> <image src="media/helpimg/python/python_shell.png" id="N0144"><alt id="N0144">APSO console</alt></image> </paragraph> <section id="relatedtopics"> <embed href="text/sbasic/python/python_examples.xhp#pythonexamples2"/> <embed href="text/sbasic/python/main0000.xhp#pythonscriptshelp"/> - <paragraph role="paragraph" id="par_id351633599611244"><link href="text/sbasic/shared/03/sf_exception.xhp?#PythonShell" name="PythonShell method"><literal>PythonShell</literal></link> function in <link href="text/sbasic/shared/03/sf_exception.xhp" name="ScriptForge.Exception service"><literal>ScriptForge.Exception</literal></link> service</paragraph> + <paragraph role="paragraph" id="par_id351633599611244"><link href="text/sbasic/shared/03/sf_exception.xhp?#PythonShell"><literal>PythonShell</literal></link> function in <link href="text/sbasic/shared/03/sf_exception.xhp"><literal>ScriptForge.Exception</literal></link> service</paragraph> </section> </body> |