Commit Graph
7 Commits
Author SHA1 Message Date
Jean-Pierre Ledure 7c0f0afd58 ScriptForge - (SF_FileSystem) new Normalize() method
Normalize a pathname by collapsing redundant
separators and up-level references
so that A//B, A/B/, A/./B and A/foo/../B
all become A/B.

On Windows, it converts forward slashes
to backward slashes.

The Basic Normalize() method invokes the
_SF_FileSystem__Normalize() function located in
the ScriptForgeHelper.py module for execution
with the os.path builtin library

The os.path.normpath() function can easily be
executed directly from python user scripts.
However the FileSystem.Normalize() method is
proposed as well for Python scripts
- for compatibility Basic/Python reasons
- to manage the FileNaming notation

Change-Id: I1e089612432bd2c75b2e76ffa984289ef7f9d75c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136835
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
2022-07-06 12:27:09 +02:00
Jean-Pierre Ledure 1908717ff7 ScriptForge - Change copyright dates and names
Change-Id: Iac45dca972c294ed3772bcdcd0b3f05484ce912a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119418
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-07-23 18:36:58 +02:00
Jean-Pierre Ledure adc0c34bcf ScriptForge - (SF_Exception) new PythonPrint() method
Send from BASIC the arguments of the method to the
Python shell (APSO) console.
The same string is added to the ScriptForge debug console.

From PYTHON use simply the builtin print() statement instead.

Change-Id: Iac175b2f7c5773e0369361c3f26bbc33485848db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118225
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-07-02 10:50:09 +02:00
Jean-Pierre Ledure 28ee6bc8cf ScriptForge - Backdoor to alternate Python helper script
While developing a new version of
    ScriptForgeHelper.py
the dev should be sure to invoke the new version
instead of the standard version shipped with its
LO release.

This can be done now by setting
- in Python a specific ScriptForge class property
    ScriptForge.pythonhelpermodule2 = 'user#QA/ScriptForgeHelper.py'
- in Basic a specific property of the root class
    _SF_.PythonHelper2 = "QA/ScriptForgeHelper.py"
both in the test script

Testing a new version of scriptforge.py can be configured
entirely from the test script by inserting next statements
    import sys
    sys.path.reverse()
    sys.path.append('/home/jean-pierre/.config/libreoffice/4/user/Scripts/python/QA')
    sys.path.reverse()

Change-Id: Iab6db518932e9dde9030b7e5bbe00a50dee31840
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118171
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-07-01 11:05:09 +02:00
Jean-Pierre Ledure 4b448758a9 ScriptForge - (SF_Platform) new Locale and PythonVersion properties
- 'Locale' returns a la-CO (language-COUNTRY) string
   derived from com.sun.star.lang.Locale
- 'PythonVersion' returns Python major.minor.patchlevel
   supplied by ScriptForgeHelper.py platform class

Change-Id: I2b8495c03253b17c5e4ba14765b1f359eee67813
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111284
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-02-21 17:06:18 +01:00
Jean-Pierre Ledure 19e5606df7 ScriptForge - (ScriptForgeHelper.py) add empty list of visible routines
The g_exportedScripts  variable contains the list of the methods
in the script that may be made visible in LO IDE's
(APSO and alike)

Currently that list (in fact, a tuple) must be empty

Change-Id: I86abc0bb55be524a3f9d39da7c6bd248abec8668
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109435
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-01-16 14:35:47 +01:00
Jean-Pierre Ledure a0dedcb23c ScriptForge - python helper functions
Change-Id: Id12a40afcba8034ed85218d78cb832a87c0d6af7
2020-11-05 16:51:34 +01:00