To facilitate the debugging of the
ScriptForge Basic code called by the
python scripts, 2 methods have been
added to the ScriptForge() class:
- initializeRoot(force = False)
Initialize the global scriptforge
data structure.
- When force = False, only when
not yet done.
- When force = True, reinitialize it
whatever its status.
- errorHandling(standard = True)
Determine how errors in the ScriptForge
Basic code are handled. Either
- the standard mode, i.e. display a "crash" message
to the user
- the debugging mode, i.e. the execution stops
on the line causing the error
Example (cfr. tdf#162962)
from scriptforge import CreateScriptService, ScriptForge
sf = ScriptForge()
sf.errorHandling(False)
def testSF():
srv = CreateScriptService("Calc")
g_exportedScripts = (testSF,)
Change-Id: I25d7d8e36e71d95ff8a04191bb8344794886d69e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173458
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins