[PYTHON] DialogBox class for Python

Joost Eekhoorn joost.eekhoorn at gmail.com
Thu May 31 10:15:58 PDT 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120531/6ee1f75f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dialogbox.py
Type: application/octet-stream
Size: 8740 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120531/6ee1f75f/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example-import-to-calc.py
Type: application/octet-stream
Size: 7581 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120531/6ee1f75f/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example-using-dialogbox.py
Type: application/octet-stream
Size: 4410 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120531/6ee1f75f/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inputdata.csv
Type: text/csv
Size: 72 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120531/6ee1f75f/attachment-0001.csv>


More information about the LibreOffice mailing list