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>
This commit is contained in:
LibreOfficiant
2019-02-20 09:29:30 +01:00
committed by Adolfo Jayme Barrientos
parent 794ae77220
commit f134b8cd96
2 changed files with 13 additions and 13 deletions

View File

@ -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>&lt;User Profile&gt;/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>&lt;User Profile&gt;/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"/>