From 7e42394ecbf921ee53160b495aa12c1cba158604 Mon Sep 17 00:00:00 2001 From: Ilmari Lauhakangas Date: Tue, 6 Dec 2022 14:05:20 +0200 Subject: tdf#152323 drop name attribute from elements Replacement done with find . -name \*.xhp -print0 |xargs -0 -P 0 perl -CS -pi -e \ 's#(]*?) +name *="[^"]*" *( [^>]+|) *>#$1$2>#g' (note some inconsistencies with space between name and = and also having empty value, and some more complicated expression to also clear up double space before/after the attribute) translation files will be prepped with: find */helpcontent2 -name \*.po -print0 |xargs -0 -P 0 perl -CS -pi -e \ $'s#(]*?) +name=(?:\\\\"[^"]*\\\\"|\'[^\']*\') *( [^>]+|) *(/?>)#$1$2$3#g unless /^#/' (note that not all languages use the " as quote character for the attributes, but that also single quotes appera in the po file. Hence the use of the shell $'string' syntax to be able to quote ' as \' It also requires to quote the backslash, so that it needs to be escaped once for the shell, then another time for perl. Also don't work on obsolete strings (those are prefixed with #~ in the po files) Also note that gets turned into during translation extraction (along with removal of the space between the attribute name and the value), so the pattern needs to be slightly different here) Change-Id: I95e53a08e6b0095cd894109ea0de154cc4859d8f Reviewed-on: https://gerrit.libreoffice.org/c/help/+/143713 Tested-by: Jenkins Reviewed-by: Christian Lohmaier --- source/text/sbasic/python/main0000.xhp | 12 ++++++------ source/text/sbasic/python/python_2_basic.xhp | 12 ++++++------ source/text/sbasic/python/python_dialogs.xhp | 4 ++-- source/text/sbasic/python/python_document_events.xhp | 8 ++++---- source/text/sbasic/python/python_examples.xhp | 2 +- source/text/sbasic/python/python_handler.xhp | 12 ++++++------ source/text/sbasic/python/python_ide.xhp | 6 +++--- source/text/sbasic/python/python_import.xhp | 2 +- source/text/sbasic/python/python_listener.xhp | 10 +++++----- source/text/sbasic/python/python_locations.xhp | 4 ++-- source/text/sbasic/python/python_platform.xhp | 2 +- source/text/sbasic/python/python_programming.xhp | 18 +++++++++--------- source/text/sbasic/python/python_screen.xhp | 12 ++++++------ source/text/sbasic/python/python_session.xhp | 2 +- source/text/sbasic/python/python_shell.xhp | 6 +++--- 15 files changed, 56 insertions(+), 56 deletions(-) (limited to 'source/text/sbasic/python') 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 @@ Python;macros scripts;Python -

%PRODUCTNAME Python Scripts Help

+

%PRODUCTNAME Python Scripts Help

- %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 https://api.libreoffice.org - This help section explains the most common Python script functions for %PRODUCTNAME. For more in-depth information please refer to the Designing & Developing Python Applications on the Wiki. + %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 https://api.libreoffice.org + This help section explains the most common Python script functions for %PRODUCTNAME. For more in-depth information please refer to the Designing & Developing Python Applications on the Wiki.

Working with Python Scripts in %PRODUCTNAME

You can execute Python scripts choosing Tools - Macros - Run Macro. 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. @@ -46,9 +46,9 @@

%PRODUCTNAME Python Modules

- msgbox module - scriptforge module - uno module + msgbox module + scriptforge module + uno module
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 @@ Python;Calling Basic ParamArray -

Calling Basic Macros from Python

+

Calling Basic Macros from Python

You can call %PRODUCTNAME Basic macros from Python scripts, and notable features can be obtained in return such as: Simple logging facilities out of Access2Base library Trace console, @@ -31,9 +31,9 @@ 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. - 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 Setting Up an Integrated IDE for Python for more information. + 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 Setting Up an Integrated IDE for Python for more information.

Retrieving %PRODUCTNAME Basic Scripts

- %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 com.sun.star.script.provider.XScriptProvider interface allows the retrieval of executable scripts: + %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 com.sun.star.script.provider.XScriptProvider interface allows the retrieval of executable scripts:
API;script.provider.MasterScriptProviderFactory: Retrieving Basic scripts @@ -69,7 +69,7 @@ API;script.provider.XScript : Executing Basic scripts - The %PRODUCTNAME Software Development Kit (SDK) documentation for com.sun.star.script.provider.XScript interface details the calling convention for inter-language calls. Invocation of functions requires three arrays: + The %PRODUCTNAME Software Development Kit (SDK) documentation for com.sun.star.script.provider.XScript interface details the calling convention for inter-language calls. Invocation of functions requires three arrays: the first lists the arguments of the called routine the second identifies modified arguments @@ -81,8 +81,8 @@ script.invoke((message,), tuple, ()) script.invoke((args), (), results)

Examples of Personal or Shared Scripts

- Examples in Input/Output to Screen detail Python to Basic invocation calls. Monitoring Document Events illustrates the usage of *args Python idiom to print a variable number of parameters to Access2Base logging console dialog. - At time of development you can interrupt Python script execution using Xray extension in order to inspect properties and methods of UNO objects. The APSO extension debugger allows object introspection using either Xray either MRI extensions. + Examples in Input/Output to Screen detail Python to Basic invocation calls. Monitoring Document Events illustrates the usage of *args Python idiom to print a variable number of parameters to Access2Base logging console dialog. + At time of development you can interrupt Python script execution using Xray extension in order to inspect properties and methods of UNO objects. The APSO extension debugger allows object introspection using either Xray either MRI extensions. def xray(myObject): script = getBasicScript(library="XrayTool", module="_Main", macro="Xray") 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 @@ dialogs;Python
-

Opening a Dialog with Python

+

Opening a Dialog with Python

- %PRODUCTNAME static dialogs are created with the Dialog editor 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 %PRODUCTNAME supported language for that matter. Opening static dialogs with Python is illustrated herewith. Exception handling and internationalization are omitted for clarity. + %PRODUCTNAME static dialogs are created with the Dialog editor 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 %PRODUCTNAME supported language for that matter. Opening static dialogs with Python is illustrated herewith. Exception handling and internationalization are omitted for clarity.

My Macros or Application Macros dialogs

The examples below open Access2Base Trace console or the imported TutorialsDialog dialog with Tools - Macros - Run Macro menu: 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 @@ API;lang.EventObject: Monitoring Document Event
-

Listening to Document Events

+

Listening to Document Events

Listening to document events can help in the following situations: @@ -42,7 +42,7 @@ Import math Python packages before opening a Calc document. Release these packages when the document closes. - Next to assigning macros to events, 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. + Next to assigning macros to events, 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.

Monitoring Document Events

Monitoring is illustrated herewith for Basic and Python languages using object-oriented programming. Assigning OnLoad script, to the Open Document event, suffices to initiate and terminate document event monitoring. Tools - Customize menu Events tab is used to assign either scripts. @@ -163,7 +163,7 @@ return xScript
Mind the misspelled documentEventOccured method that inherits a typo from %PRODUCTNAME Application Programming Interface (API). - Start application and Close application 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 Open document and Document closed events. Refer to Importing Python Modules for more information. + Start application and Close application 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 Open document and Document closed events. Refer to Importing Python Modules for more information.

With %PRODUCTNAME Basic

API;GlobalScope.BasicLibraries @@ -269,7 +269,7 @@ g_exportedScripts = (displayAvailableEvents,) - The Alternative Python Script Organizer (APSO) extension is used to render events information on screen. + The Alternative Python Script Organizer (APSO) extension is used to render events information on screen.

With %PRODUCTNAME Basic

Sub DisplayAvailableEvents 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 @@ Python;session Python;screen input/output
-

Python programming examples

+

Python programming examples

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 @@ API;XDialogEventHandler -

Creating a Dialog Handler

- Next to assigning macros to events or creating event listeners, 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 vnd.sun.star.UNO:<method_name> 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. +

Creating a Dialog Handler

+ Next to assigning macros to events or creating event listeners, 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 vnd.sun.star.UNO:<method_name> 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. The advantages of this approach are: It packs the code that handles event-driven macros, @@ -34,7 +34,7 @@ This mechanism is illustrated herewith for Basic and Python languages using an imported copy of Access2Base dlgTrace dialog. Exception handling and localisation are omitted for clarity.

Assigning Dialog methods

Export Access2Base dlgTrace dialog and import it into MyLib application library. - Inside the control properties pane of the Dialog Editor, use the Events tab to replace macro assignments by component assignments, and type in the intended method names: + Inside the control properties pane of the Dialog Editor, use the Events tab to replace macro assignments by component assignments, and type in the intended method names: Set Dump to file dialog button component method name to _dump2File Optionally define txtTracelog key pressed and mouse button pressed events component method names as _openHelp @@ -42,7 +42,7 @@ Events assigned actions should mention the vnd.sun.star.UNO: protocol.

Creating the handler

- createDialogWithHandler method of com.sun.star.awt.DialogProvider2 service is used to set the dialog and its handler. The handler is responsible for implementing com.sun.star.awt.XDialogEventHandler interface. + createDialogWithHandler method of com.sun.star.awt.DialogProvider2 service is used to set the dialog and its handler. The handler is responsible for implementing com.sun.star.awt.XDialogEventHandler interface. All component method names must be explicitly declared when using a dialog handler.

With Python

In this example the dialog is located on the computer. @@ -110,7 +110,7 @@ As expected, onOkHasFocus missing method throws an exception. - Refer to Python calls to %PRODUCTNAME Basic page for getBasicScript routine description and for details about cross-language scripting execution. + Refer to Python calls to %PRODUCTNAME Basic page for getBasicScript routine description and for details about cross-language scripting execution.

With %PRODUCTNAME Basic

In this example the dialog is embedded in a document, and can equally be located on the computer. @@ -158,7 +158,7 @@
- CreateUnoListener Function + CreateUnoListener Function 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 @@ python;IDE - integrated development environment python;editor -

Setting up an Integrated Development Environment (IDE) for Python

+

Setting up an Integrated Development Environment (IDE) for Python

Writing Python macros requires extra configuration steps to set an IDE of choice.
- 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 Designing & Developing Python Applications on the Wiki for more in-depth information about the setup of a bridge between your IDE and a running instance %PRODUCTNAME. + 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 Designing & Developing Python Applications on the Wiki for more in-depth information about the setup of a bridge between your IDE and a running instance %PRODUCTNAME.

The APSO Extension

- The Alternative Python Script Organizer (APSO) 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 Designing & Developing Python Applications for additional details on such extensions. + The Alternative Python Script Organizer (APSO) 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 Designing & Developing Python Applications for additional details on such extensions.
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 @@ Python;pythonpath PythonLibraries
-

Importing Python Modules

+

Importing Python Modules

%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 Python Scripts Organization and Location. In order to import Python modules, their locations must be known from Python at run time. 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. Note that <User Profile>/Scripts/python/pythonpath local directory is always explored when running a Python macro from <User Profile>/Scripts/python. 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 @@ API;XActionListener
-

Creating Event Listeners

+

Creating Event Listeners

- 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 Events tab in Tools – Customize menu and the Dialog Editor Control properties pane from Tools - Macros – Organise Dialogs... menu. + 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 Events tab in Tools – Customize menu and the Dialog Editor Control properties pane from Tools - Macros – Organise Dialogs... menu. 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.

Creating an event listener

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. @@ -152,13 +152,13 @@ End Sub ' awt_disposing

Other Event Listeners

- Listeners are usually coded along with dialog opening. Numerous listener approaches are possible such as event handlers for dialogs or event monitors for documents or forms. + Listeners are usually coded along with dialog opening. Numerous listener approaches are possible such as event handlers for dialogs or event monitors for documents or forms.
- Events mapping to objects - See also Document events, Form events. + Events mapping to objects + See also Document events, Form events. 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 @@
- Python Scripts Organization and Location + Python Scripts Organization and Location %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. 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. Library Container diagram @@ -37,7 +37,7 @@

Python Script Locations

- Refer to Getting Session Information in order to get programmatic access to Python script locations. + Refer to Getting Session Information in order to get programmatic access to Python script locations.

Application Macros

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. The %PRODUCTNAME Macros container location in the file system depends on the operating system: 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 @@ API;ConfigurationAccess Tools;GetRegistryContent -

Identifying the operating system

+

Identifying the operating system

Identifying the operating system can be performed with Python or Basic language. ComputerName property is solely available for Windows. Basic calls to Python macros help overcome %PRODUCTNAME Basic limitations.

Using a Python class:

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 @@ uno.py;getDocument
-

Programming with Python Scripts

+

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: @@ -82,10 +82,10 @@

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. uno.py uno.py;absolutize @@ -221,7 +221,7 @@ - See Opening a Dialog + See Opening a Dialog CreateUnoDialog() @@ -229,7 +229,7 @@ - See Creating a Listener + See Creating a Listener CreateUnoListener() @@ -303,7 +303,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 @@ -329,7 +329,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 a40c6bc793..2cfc4c23cf 100644 --- a/source/text/sbasic/python/python_screen.xhp +++ b/source/text/sbasic/python/python_screen.xhp @@ -22,9 +22,9 @@ API;script.provider.MasterScriptProvider: Screen Input/Output API;script.provider.XScript: Screen Input/Output -

Input/Output to Screen

+

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. - %PRODUCTNAME msgbox Python module proposes a msgbox() method that is illustrated in Creating Event Listeners and Creating a dialog handler example pages. + %PRODUCTNAME msgbox Python module proposes a msgbox() method that is illustrated in Creating Event Listeners and Creating a dialog handler example pages. %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)
@@ -39,10 +39,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. @@ -80,7 +80,7 @@ xScript = scriptPro.getScript(scriptName) return xScript - MsgBox and InputBox methods from the Basic service included in the ScriptForge libraries call directly their native Basic counterparts. + MsgBox and InputBox methods from the Basic service included in the ScriptForge libraries call directly their native Basic counterparts.

uiScripts Basic module

Option Explicit @@ -96,7 +96,7 @@ Print msg End Sub - The Alternative Python Script Organizer (APSO) extension offers a msgbox() function out of its apso_utils module. + The Alternative Python Script Organizer (APSO) extension offers a msgbox() function out of its apso_utils module.
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 @@ Session;UserPythonScripts API;PathSubstitution -

Getting Session Information

+

Getting Session Information

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.

Examples:

With Python shell. 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 @@ Python;Shell
-

Running Python Interactive Console

+

Running Python Interactive Console

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. @@ -68,14 +68,14 @@

Alternative console

- Use APSO extension console as an alternative: + Use APSO extension console as an alternative: APSO console
- PythonShell function in ScriptForge.Exception service + PythonShell function in ScriptForge.Exception service
-- cgit