LibreOffice Module wizards (master) 1
Classes | Functions | Variables
ScriptForgeHelper Namespace Reference

Classes

class  _Singleton
 
class  Platform
 

Functions

str _SF_Dictionary__ConvertToJson (propval, indent=None)
 
def _SF_Dictionary__ImportFromJson (str jsonstr)
 
bool _SF_Exception__PythonPrint (str string)
 
bool _SF_FileSystem__CompareFiles (str filename1, str filename2, comparecontents=True)
 
str _SF_FileSystem__GetFilelen (str systemfilepath)
 
str _SF_FileSystem__HashFile (str filename, str algorithm)
 
str _SF_FileSystem__Normalize (str systemfilepath)
 
def _SF_Platform (str propertyname)
 
def _SF_Session__OpenURLInBrowser (str url)
 
str _SF_String__HashStr (str string, str algorithm)
 

Variables

tuple g_exportedScripts = ()
 
string js
 
def arr = _SF_Dictionary__ImportFromJson(js)
 

Function Documentation

◆ _SF_Dictionary__ConvertToJson()

str ScriptForgeHelper._SF_Dictionary__ConvertToJson (   propval,
  indent = None 
)
private
Given an array of PropertyValues as argument, convert it to a JSON string

Definition at line 57 of file ScriptForgeHelper.py.

◆ _SF_Dictionary__ImportFromJson()

def ScriptForgeHelper._SF_Dictionary__ImportFromJson ( str  jsonstr)
private
Given a JSON string as argument, convert it to a list of tuples (name, value)
The value must not be a (sub)dict. This doesn't pass the python-basic bridge.

Definition at line 69 of file ScriptForgeHelper.py.

◆ _SF_Exception__PythonPrint()

bool ScriptForgeHelper._SF_Exception__PythonPrint ( str  string)
private
Write the argument to stdout.
If the APSO shell console is active, the argument will be displayed in the console window

Definition at line 93 of file ScriptForgeHelper.py.

◆ _SF_FileSystem__CompareFiles()

bool ScriptForgeHelper._SF_FileSystem__CompareFiles ( str  filename1,
str  filename2,
  comparecontents = True 
)
private
Compare the 2 files, returning True if they seem equal, False otherwise.
By default, only their signatures (modification time, ...) are compared.
When comparecontents == True, their contents are compared.

Definition at line 107 of file ScriptForgeHelper.py.

◆ _SF_FileSystem__GetFilelen()

str ScriptForgeHelper._SF_FileSystem__GetFilelen ( str  systemfilepath)
private

Definition at line 120 of file ScriptForgeHelper.py.

◆ _SF_FileSystem__HashFile()

str ScriptForgeHelper._SF_FileSystem__HashFile ( str  filename,
str  algorithm 
)
private
Hash a given file with the given hashing algorithm
cfr. https://www.pythoncentral.io/hashing-files-with-python/
Example
    hash = _SF_FileSystem__HashFile('myfile.txt','MD5')

Definition at line 124 of file ScriptForgeHelper.py.

References _SF_FileSystem__HashFile().

Referenced by _SF_FileSystem__HashFile().

◆ _SF_FileSystem__Normalize()

str ScriptForgeHelper._SF_FileSystem__Normalize ( str  systemfilepath)
private
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.

Definition at line 161 of file ScriptForgeHelper.py.

◆ _SF_Platform()

def ScriptForgeHelper._SF_Platform ( str  propertyname)
private
Switch between SF_Platform properties (read the documentation about the ScriptForge.Platform service)

Definition at line 175 of file ScriptForgeHelper.py.

◆ _SF_Session__OpenURLInBrowser()

def ScriptForgeHelper._SF_Session__OpenURLInBrowser ( str  url)
private
Display url using the default browser

Definition at line 249 of file ScriptForgeHelper.py.

◆ _SF_String__HashStr()

str ScriptForgeHelper._SF_String__HashStr ( str  string,
str  algorithm 
)
private
Hash a given UTF-8 string with the given hashing algorithm
Example
    hash = _SF_String__HashStr('This is a UTF-8 encoded string.','MD5')

Definition at line 263 of file ScriptForgeHelper.py.

References _SF_String__HashStr().

Referenced by _SF_String__HashStr().

Variable Documentation

◆ arr

def ScriptForgeHelper.arr = _SF_Dictionary__ImportFromJson(js)

Definition at line 329 of file ScriptForgeHelper.py.

◆ g_exportedScripts

tuple ScriptForgeHelper.g_exportedScripts = ()

Definition at line 299 of file ScriptForgeHelper.py.

◆ js

string ScriptForgeHelper.js
Initial value:
1= """
2 {"firstName": "John","lastName": "Smith","isAlive": true,"age": 27,
3 "address": {"streetAddress": "21 2nd Street","city": "New York","state": "NY","postalCode": "10021-3100"},
4 "phoneNumbers": [{"type": "home","number": "212 555-1234"},{"type": "office","number": "646 555-4567"}],
5 "children": ["Q", "M", "G", "T"],"spouse": null}
6 """

Definition at line 323 of file ScriptForgeHelper.py.