From f134b8cd96bcbff338b60d28347328d0e63d67c9 Mon Sep 17 00:00:00 2001 From: LibreOfficiant Date: Wed, 20 Feb 2019 09:29:30 +0100 Subject: 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 --- source/text/sbasic/python/python_programming.xhp | 16 ++++++++-------- 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 @@

Programming with Python Scripts

- A Python macro is a function within a .py file, identified as a module. Unlike %PRODUCTNAME Basic and its dozen of UNO objects functions or services, Python macros use the XSCRIPTCONTEXT UNO single object, shared with JavaScript and Beanshell. The g_exportedScripts global tuple explicitly lists selectable macros from a module. Python modules hold autonomous code logic, and are independent from one another. + A Python macro is a function within a .py file, identified as a module. Unlike %PRODUCTNAME Basic and its dozen of UNO objects functions or services, Python macros use the XSCRIPTCONTEXT UNO single object, shared with JavaScript and BeanShell. The g_exportedScripts global tuple explicitly lists selectable macros from a module. Python modules hold autonomous code logic, and are independent from one another.

XSCRIPTCONTEXT Global Variable

- Genuine Basic UNO facilities can be inferred from XSCRIPTCONTEXT global variable. Refer to %PRODUCTNAME API for a complete description of XSCRIPTCONTEXT. XSCRIPTCONTEXT methods summarize as: + Genuine Basic UNO facilities can be inferred from XSCRIPTCONTEXT global variable. Refer to %PRODUCTNAME API for a complete description of XSCRIPTCONTEXT. XSCRIPTCONTEXT methods summarize as: @@ -77,9 +77,9 @@

Module import

XSCRIPTCONTEXT is not provided to imported modules.
- %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 My macros within <User Profile>/Scripts/python/pythonpath. Python libraries help organize modules in order to prevent module name collisions. Import uno.py inside shared modules. + %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 My macros within <User Profile>/Scripts/python/pythonpath. Python libraries help organize modules in order to prevent module name collisions. Import uno.py inside shared modules.
- Genuine BASIC UNO facilities can be inferred using uno.py module. Use Python interactive shell to get a complete module description using dir() and help() Python commands. + Genuine BASIC UNO facilities can be inferred using uno.py module. Use Python interactive shell to get a complete module description using dir() and help() Python commands.
@@ -202,7 +202,7 @@ - See Creating a Dialog + See Opening a Dialog CreateUnoDialog() @@ -210,7 +210,7 @@ - See Creating a Listener + See Creating a Listener CreateUnoListener() @@ -269,7 +269,7 @@

Importing an embedded Module

- 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 %PRODUCTNAME Application Programming Interface (API) or download %PRODUCTNAME Software Development Kit (SDK). + 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 %PRODUCTNAME Application Programming Interface (API) or download %PRODUCTNAME Software Development Kit (SDK). Importing a Python document embedded module is illustrated below, exception handling is not detailed: import uno, sys @@ -295,7 +295,7 @@
- Basic UNO Objects, Functions and Services + Basic UNO Objects, Functions and Services 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 @@

Input/Output to Screen

Python standard output file is not available when running Python macros from Tools – Macros - Run Macro... menu. Presenting the output of a module requires the Python interactive console. Features such as input(), print(), repr() and str() are available from the Python shell. - The Alternative Python Script Organizer (APSO) extension offers a msgbox() function out of its apso_utils module. - %PRODUCTNAME Basic proposes InputBox(), Msgbox() and Print() 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. + The Alternative Python Script Organizer (APSO) extension offers a msgbox() function out of its apso_utils module. + %PRODUCTNAME Basic proposes InputBox(), Msgbox() and Print() 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.

Python syntax:

MsgBox(txt, buttons=0, title=None)
InputBox(txt, title=None, default=None)
@@ -37,10 +37,10 @@

Installation:

- Copy screen_io Python module in My macros within <UserProfile>/Scripts/python/pythonpath, + Copy screen_io Python module in My macros within <UserProfile>/Scripts/python/pythonpath, - Copy uiScripts Basic module in My macros Standard Basic library, + Copy uiScripts Basic module in My macros Standard Basic library, Restart %PRODUCTNAME. @@ -95,7 +95,7 @@
- Calling Basic macros from Python + Calling Basic macros from Python -- cgit