I could not found a dialogbox class, thus I build one: class DialogBox in
dialogbox.py.
Also made 2 examples using this DialogBox:
- example-using-dialog.py: showing a simple dialog and printing the
results to the shell.
- example-import-to-calc.py: importing data from a csv-file to a
calc-sheet and making a graph.
This is how I run these examples on my Ubuntu:
- Open a xterm and export URE_BOOTSTRAP end PYTHONPATH (note: this is not
good practice, but it works)
-- For testing on my core:
cd /home/joost/work/git/libo/install/program
export
URE_BOOTSTRAP="file:///home/joost/git/libo/install/program/fundamentalrc"
export PYTHONPATH=/home/joost/git/libo/install/program
-- For testing on my installed LibreOffice:
cd /usr/lib/libreoffice/program
export
URE_BOOTSTRAP="file:///usr/lib/libreoffice/program/fundamentalrc"
export PYTHONPATH=/usr/lib/libreoffice/basis-link/program
- Run LibreOffice in listening mode:
./soffice --nodefault --minimized --norestore
"--accept=socket,host=localhost,port=2002;urp;" &
- Run the python examples:
/home/joost/python/example-using-dialogbox.py
/home/joost/python/example-import-to-calc.py
inputdata.csv is the data-file you can use for example-import-to-calc.py
My questions:
- Is this DialogBox a usefull class?
- Is the code correct?
- What is missing?
- Is it an idea to place dialogbox.py in /core/scripting/source/pyprov/ ?
Joost
Attachment:
dialogbox.py
Description: Binary data
Attachment:
example-import-to-calc.py
Description: Binary data
Attachment:
example-using-dialogbox.py
Description: Binary data
34.49 45.17 65.00 67.42 45.54 67.29 89.87 82.91 23.54 53.16 86.85 97.53