[Geany] Query regarding plugin creation
Jeff Pohlmeyer
yetanothergeek at xxxxx
Thu Mar 20 20:17:15 UTC 2008
Nick Treleaven <nick.treleaven at btinternet.com> wrote:
> I just changed the TODO wishlist item for Python scripting
> to 'Python plugin interface' - IMO there's no need for a
> ...
> It would be more useful to have Python bindings for the
> plugin API, so plugins could be written in Python instead
> of C.
> ...
> Of course this is only a wishlist item, don't anyone expect
> it to get done ;-)
hehe, maybe this could be a start...
It generates 100k+ lines of C code and about 5300 lines of python,
along with a shared lib - but I have no clue what to do with it!
###################################
#!/bin/bash
OUT_DIR=$HOME/geanypy
GEANY_INC=/usr/local/include/geany
swig -version > /dev/null || exit
gawk --version > /dev/null || exit
gcc --version > /dev/null || exit
python-config --libs > /dev/null || exit
pkg-config --print-errors geany || exit
mkdir -p $OUT_DIR || exit
cd $OUT_DIR || exit
for H in $(find $GEANY_INC -type f -name '*.h')
do
M="$(basename $H .h)"
C="./$M.c"
I="./$M.i"
echo "%module $M
%{
#include \"Scintilla.h\"
#include \"geany.h\"
#include \"$H\"
%}
" > $I
gawk '{
gsub(/\<G_GNUC_NULL_TERMINATED.*;/,";");
gsub(/\<G_GNUC_PRINTF.*;/,";");
print
}' $H >> $I
echo "Generating module \"$M\""
swig -python $(pkg-config --cflags geany) -o $C $I
echo "Compiling \"$M\""
gcc -c $(pkg-config --cflags geany) \
$(python-config --includes) $C
done
echo
echo "Lines per module:"
wc -l *.py
echo
echo "Creating shared lib:"
gcc -shared *.o -o libgeanypy.so
ls -lh $PWD/libgeanypy.so
echo
echo "done."
###################################
- Jeff
More information about the Users
mailing list