Commit Graph
6 Commits
Author SHA1 Message Date
Jean-Pierre Ledure 082d4741fe ScriptForge - (scriptforge.py) enhance property and method naming
To make the access to services more close to Python habits
and to better attract Basic users to Python, the convention
for attributes naming has been enhanced:

- property names may be ProperCased, camelCased or lowercased
- method names may be ProperCased, camelCased or lowercased
  Their arguments are always lowercased
In documentation examples, the camelCased notation will be privileged

Synonyms for properties are managed with generic functions.
The generic getter and setter has been reviewed accordingly.

Method synonyms are hardcoded.

The management of synonyms for servicenames have also been
reviewed to be defined in each class i.o. centrally and hardcoded
in CreateScriptService()

Change-Id: Id8d3181118b1e61937e2412109bd0d1eedd6f5e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112470
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-14 14:43:03 +01:00
Jean-Pierre Ledure 42f05d000a ScriptForge - (scriptforge.py) Platform class
Addition of SF_Platform class

Most properties are provided by a direct call to
ScriptForgeHelper.py

Others result from an interaction with the Basic-Python  machinery

Addition of STarDesktop() method in the SF_Basic class

Change-Id: If1c03fe8e0ad36b6a665c8c44b477eca7cbc24bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112393
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-13 13:12:00 +01:00
Jean-Pierre Ledure 1f842e3aa0 ScriptForge - (scriptforge.py) L10N class
Addition of SF_L10N class

Correction in Languages() property:
selection of file based on *.po filter i.o. ??-??.po

Change-Id: I5c57d1973265f2aeb7a3cfb4f507ffd50a28785a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112211
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-10 16:28:15 +01:00
Jean-Pierre Ledure 055ba70145 ScriptForge - (scriptforge.py) FileSystem and TextStream classes
Addition of SF_FileSystem and SF_TextStream classes

Machinery tuning:
- freeze a predefined list of standard modules
in the python persistent storage
- error management reviewed to mimic Basic behaviour on wrong
arguments

Standard modules are predefined in scriptforge.py as well

Both lists must be synchronized on a hardcoded entry number

Basic has minor revisions:
- complex boolean expressions return -1 and 0 to Python
i.o. True and False => Add a CBool() function
- [User]TemplatesFolder properties of FileSystem omitted the final "/"

Change-Id: Ice138de956f5f87269557cdb3db023849081b99d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112199
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-09 15:36:32 +01:00
Andrea Gelmini 476a37f76c Fix typos
Change-Id: I0a6b74356bd689b54883efc4608a06fb9446e828
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112024
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-07 12:26:46 +01:00
Jean-Pierre Ledure f66a479225 ScriptForge - (scriptforge.py) Python-Basic machinery
Python scripts can now invoke usual Basic builtin functions
Example:
    from ScriptForge import CreateScriptService
    bas = CreateScriptService('Basic')
    bas.MsgBox('This is the text to be displayed', bas.MB_ICONEXCLAMATION)

Python scripts can use most ScriptForge services written in Basic
Example:
    from scriptforge import CreateScriptService
    FSO = CreateScriptService('FileSystem')
    a = FSO.BuildPath('/tmp', 'xyz')
Syntax and semantic are as close as possible to the Basic syntax

Implemented are a SFServices class and its subclasses representing each
a ScriptForge service and where the interfaces are defined (properties,
methods and arguments)

Their execution goes through the "machinery", i.e. a set of python
and basic routines that manage the call from the python process to
the appropriate service in an as much agnostic and generic way

Only a limited set of services are implemented so far: SF_FileSystem
(partially) and SF_Timer: they served as prototypes and initial tests

Change-Id: I0b383b59359c12710e7165139e498cca5a7856bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111971
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-03-05 10:26:51 +01:00