diff options
author | LibreOfficiant <OpenOfficiant@sfr.fr> | 2019-02-20 09:29:30 +0100 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2019-02-20 18:03:38 +0100 |
commit | f134b8cd96bcbff338b60d28347328d0e63d67c9 (patch) | |
tree | 12bd27f267b8834a1cee53e202bbf53f07520910 | |
parent | 794ae7722052440c8ea19b039cd229542d1f0ea5 (diff) |
Spelling offence made to BeanShell requires correction
+ link cleanup
Change-Id: If186f97bfd4ae8c4ccc2220ea8af9f1a6d1d8a2d
Reviewed-on: https://gerrit.libreoffice.org/68064
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r-- | source/text/sbasic/python/python_programming.xhp | 16 | ||||
-rw-r--r-- | source/text/sbasic/python/python_screen.xhp | 10 |
2 files changed, 13 insertions, 13 deletions
diff --git a/source/text/sbasic/python/python_programming.xhp b/source/text/sbasic/python/python_programming.xhp index 627c0ffbae..47ed4a3632 100644 --- a/source/text/sbasic/python/python_programming.xhp +++ b/source/text/sbasic/python/python_programming.xhp @@ -23,9 +23,9 @@ <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> </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 ="external">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" 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> <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 ="external">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" name="description of XSCRIPTCONTEXT">description of XSCRIPTCONTEXT</link>. <literal>XSCRIPTCONTEXT</literal> methods summarize as:</paragraph> <table id="N0223"> <tablerow> <tablecell> @@ -77,9 +77,9 @@ <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 ="external">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" 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> </section> - <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 ="external">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" 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> <table id="N0243"> <tablerow> <tablecell> @@ -202,7 +202,7 @@ </tablerow> <tablerow> <tablecell> - <paragraph role="tablecontent" id="N0284">See Creating a Dialog</paragraph> + <paragraph role="tablecontent" id="N0284">See <link href="text/sbasic/python/python_dialog.xhp" name="Opening a Dialog">Opening a Dialog</link></paragraph> </tablecell> <tablecell> <paragraph role="tablecontent" localize="false" id="N0285">CreateUnoDialog()</paragraph> @@ -210,7 +210,7 @@ </tablerow> <tablerow> <tablecell> - <paragraph role="tablecontent" id="N0286">See Creating a Listener</paragraph> + <paragraph role="tablecontent" id="N0286">See <link href="text/sbasic/python/python_listener.xhp" name="Creating a Listener">Creating a Listener</link></paragraph> </tablecell> <tablecell> <paragraph role="tablecontent" localize="false" id="N0287">CreateUnoListener()</paragraph> @@ -269,7 +269,7 @@ </table> <h2 id="N0297">Importing an embedded Module</h2> <section id="PythonEmbeddedImport" > - <paragraph role="paragraph" id="N0298">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 ="external">%PRODUCTNAME Application Programming Interface</link> (API) or download <link href="https://www.libreoffice.org/download/download/" name ="external">%PRODUCTNAME Software Development Kit</link> (SDK).</paragraph> + <paragraph role="paragraph" id="N0298">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="N0299">Importing a Python document embedded module is illustrated below, exception handling is not detailed:</paragraph> <pycode> <paragraph role="pycode" localize="false" id="N0300">import uno, sys</paragraph> @@ -295,7 +295,7 @@ </pycode> </section> <section id="relatedtopics"> - <paragraph role="paragraph" id="N0321"><link href="text/sbasic/shared/uno_objects.xhp" name ="external">Basic UNO Objects, Functions and Services</link></paragraph> + <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> <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 e6d1d89f44..755fd7a4f2 100644 --- a/source/text/sbasic/python/python_screen.xhp +++ b/source/text/sbasic/python/python_screen.xhp @@ -22,8 +22,8 @@ </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> <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> - <paragraph role="tip" id="N0436">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.</paragraph> - <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> + <paragraph role="tip" id="N0436">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.</paragraph> + <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> <paragraph role="code" id="N0440" localize="false">InputBox(txt, title=None, default=None)<br/></paragraph> @@ -37,10 +37,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">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" name="User macros">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">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" name="User macros">My macros</link> Standard Basic library,</paragraph> </listitem> <listitem> <paragraph role="listitem" id="N0452">Restart %PRODUCTNAME.</paragraph> @@ -95,7 +95,7 @@ </bascode> <section id="relatedTopics"> <paragraph role="paragraph" id="N0505"> - <link href="text/sbasic/python/python_2_basic.xhp">Calling Basic macros from Python</link> + <link href="text/sbasic/python/python_2_basic.xhp" name="Calling Basic macros from Python">Calling Basic macros from Python</link> </paragraph> <embed href="text/sbasic/shared/03010000.xhp#BasicScreenIO"/> <embed href="text/sbasic/python/python_examples.xhp#pythonexamples2"/> |