After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 146454 - [feature request] python scripting for the plugin API
[feature request] python scripting for the plugin API
Status: RESOLVED FIXED
Product: gedit-plugins
Classification: Other
Component: General
unspecified
Other Linux
: Low enhancement
: ---
Assigned To: Gedit maintainers
gedit QA volunteers
Depends on:
Blocks:
 
 
Reported: 2004-07-09 05:15 UTC by Tom von Schwerdtner
Modified: 2019-03-23 20:32 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
gedit-python.diff (32.31 KB, patch)
2005-09-09 19:28 UTC, Raphael Slinckx
none Details | Review
gedit-python.diff (28.99 KB, patch)
2005-09-09 19:34 UTC, Raphael Slinckx
none Details | Review
gedit-python.tar.gz (11.04 KB, application/x-compressed-tar)
2005-09-09 19:36 UTC, Raphael Slinckx
  Details
gedit-python.diff (30.22 KB, patch)
2005-09-09 22:10 UTC, Raphael Slinckx
none Details | Review
gedit-python.tar.gz (4.55 KB, application/x-compressed-tar)
2005-09-09 22:11 UTC, Raphael Slinckx
  Details
console.gedit-plugin (231 bytes, text/plain)
2005-09-10 11:41 UTC, Raphael Slinckx
  Details
console.py (10.72 KB, text/plain)
2005-09-10 11:44 UTC, Raphael Slinckx
  Details
gedit-python.diff (29.57 KB, patch)
2005-09-10 12:22 UTC, Raphael Slinckx
none Details | Review
gedit-python.tar.gz (4.58 KB, application/x-compressed-tar)
2005-09-10 12:23 UTC, Raphael Slinckx
  Details
gedit-python.diff (28.69 KB, patch)
2005-09-10 13:43 UTC, Raphael Slinckx
none Details | Review
gedit-python.diff (28.81 KB, patch)
2005-09-13 14:35 UTC, Raphael Slinckx
none Details | Review
gedit-python.tar.gz (4.58 KB, application/x-compressed-tar)
2005-09-13 14:35 UTC, Raphael Slinckx
  Details
gedit-python.diff (65.53 KB, patch)
2005-09-26 15:38 UTC, Raphael Slinckx
none Details | Review

Description Tom von Schwerdtner 2004-07-09 05:15:29 UTC
I realize a request like thsi carries more weight when a patch is included, but
I figured I'd put it out there anyways.
Comment 1 Paolo Maggi 2004-07-12 15:28:32 UTC
Could you please try to explain this RFE in a more detailed way?
Comment 2 Tom von Schwerdtner 2004-07-12 15:57:55 UTC
From looking at the source there seems to be a specific API for creating plugins
for gEdit (defined in gedit-plugin.h I believe, and perhaps gedit-menus.h), I
think it would be beneficial to provide Python bindings for this API so that
plugins could be written entirely in Python.
Comment 3 Hal Canary 2004-08-12 14:56:49 UTC
I would like to see scripting as simple as it is in emacs.  With 
emacs, you can write a function in your .emacs and call it with
'alt-x function-name'.

Perhaps the gedit plugin api is that simple to use.  I wouldn't
know, because I didn't find much good documentation on the
subject.  If it requires programming in c, it probably isn't 
going to be the easiest thing to use.  I would be comfortable
with scheme/lisp or perl, but not c.
Comment 4 Tom von Schwerdtner 2004-09-29 18:27:31 UTC
Note that given recent discussions on desktop-devel it looks like Python is
going to make it into GNOME 2.10 which would make this feature much more appealing.

I'm swamped for the next two months but I might try my hand at this after that
if nobody else takes up the cause.
Comment 5 Raphael Slinckx 2005-09-09 18:08:45 UTC
Patch coming in the next hours
Comment 6 Raphael Slinckx 2005-09-09 19:28:46 UTC
Created attachment 52024 [details] [review]
gedit-python.diff

First patch for python support in new_mdi
Comment 7 Raphael Slinckx 2005-09-09 19:34:18 UTC
Created attachment 52025 [details] [review]
gedit-python.diff

Cleanup unwanted modification
Comment 8 Raphael Slinckx 2005-09-09 19:36:32 UTC
Created attachment 52026 [details]
gedit-python.tar.gz

The added files
Comment 9 Tom von Schwerdtner 2005-09-09 19:53:51 UTC
Is the patch for CVS HEAD?  I'm getting some failures when trying to apply.

(Thanks much for doing this work btw)
Comment 10 Paolo Maggi 2005-09-09 19:57:53 UTC
No it is against the new_mdi branch.

http://live.gnome.org/Gedit_2fNewMdi for more info.
Comment 11 Raphael Slinckx 2005-09-09 20:38:58 UTC
And there is some cruft in the tarball too, please remove the m4/intltool.m4 and
gedit/pygedit/gedit.c files
Comment 12 Raphael Slinckx 2005-09-09 22:10:40 UTC
Created attachment 52034 [details] [review]
gedit-python.diff

Fixes list return types, and the get_search_text method.
Use boxed types for GeditEncoding
Comment 13 Raphael Slinckx 2005-09-09 22:11:57 UTC
Created attachment 52035 [details]
gedit-python.tar.gz

Updated and cleaned tarball
Comment 14 Raphael Slinckx 2005-09-10 11:41:37 UTC
Created attachment 52049 [details]
console.gedit-plugin

The plugin file for console extension
Comment 15 Raphael Slinckx 2005-09-10 11:44:17 UTC
Created attachment 52050 [details]
console.py

The actual python extension, put the two above files in ~/.gnome2/gedit/plugins
and watch the magic happen
Comment 16 Raphael Slinckx 2005-09-10 12:22:26 UTC
Created attachment 52051 [details] [review]
gedit-python.diff

Updated with more goodness inside.
Update configure check for g-p-e instead of gnome-python (gtksourceview is
needed)
Sparkle some ifdefs to not compile in python support when disabled
Update boxed type to use release-func/copy-func
Comment 17 Raphael Slinckx 2005-09-10 12:23:22 UTC
Created attachment 52052 [details]
gedit-python.tar.gz

Updated, see above
Comment 18 Raphael Slinckx 2005-09-10 13:43:19 UTC
Created attachment 52058 [details] [review]
gedit-python.diff

Cleanup C-style
Pass the python module path to the loader
Comment 19 Paolo Maggi 2005-09-12 15:57:58 UTC
I'd prefer to see the pygedit files in another directory.
I think we should create a "bindings" sub-directory in the root directory
and then put the pygedit file in the "bindings/python" directory.

Rapheal: if you think your patch is ready for being committed, I will make a
detailed review as soon as you will attach the patch with the required changes.
Comment 20 Raphael Slinckx 2005-09-12 23:31:14 UTC
So it would look like 
gedit/
 bindings/
  python/
   gedit.defs & co
 gedit/
  gedit-python-*.[ch]

Is that right ?

I'll do that tomorrow i suppose we can confirm this on IRC
Comment 21 Paolo Maggi 2005-09-13 08:31:32 UTC
If with gedit-python-*.[ch] you mean the python loader, it is right.
Comment 22 Raphael Slinckx 2005-09-13 14:35:11 UTC
Created attachment 52174 [details] [review]
gedit-python.diff

Updated patch, with the new directory structure, nothing else changed
Comment 23 Raphael Slinckx 2005-09-13 14:35:33 UTC
Created attachment 52175 [details]
gedit-python.tar.gz

The new tarball with new structure
Comment 24 Raphael Slinckx 2005-09-26 15:38:23 UTC
Created attachment 52682 [details] [review]
gedit-python.diff

Final version of the patch, as included in CVS.
Comment 25 Paolo Borelli 2005-12-15 20:37:44 UTC
2.13.0 is out with all its python goodness. Go wild writing plugins!