#!/bin/bash
# adapted from Mitch Frazier :  
# http://www.linuxjournal.com/content/python-pyuno-hello-world-addon-openoffice
unopkg_bin=/usr/bin/unopkg
oocalc_bin=/usr/bin/oocalc

addons=Addons_transferdemo.xcu
python_file=transferdemo_oocalc.py
zip_file=transferdemo.zip

rm $zip_file
zip $zip_file $addons $python_file
$unopkg_bin remove org.openoffice.legacy.$zip_file
$unopkg_bin add $zip_file

#export PYUNO_LOGLEVEL=CALL  -these don't seem to do anything
export PYUNO_LOGLEVEL=ARGS
export PYUNO_LOGTARGET=stdout

#uncomment the following to open a spreadsheet
#but opening a terminal an entering the command oocalc will achieve the same thing
#and then you can see any printed lines from python (using print command)
#$oocalc_bin

