gcmd-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gcmd-dev] Python plugins


From: Piotr Eljasiak
Subject: [gcmd-dev] Python plugins
Date: Wed, 29 Nov 2006 02:43:04 +0100

Hi folks,

I'm happy to announce that some initial work for python plugins has been
committed to DEVEL branch. 

There is no GUI for python plugins at the moment and the only access to
them is via F12 (temporary key shortcut). F12 always executes script
'sample-plugin.py' located in the same dir where binary resides. 

I'm attaching the exemplary sample-plugin.py script as a reference. The
script prints out selected files to console only (you have to start gcmd
from console to see the output), but it's very easy to extend it to do
something more useful ;o)

The entry (start) point to plugin is always main function:

        def main(main_wnd_xid, active_cwd, inactive_cwd, selected_files)

where parameters are
        main_wnd_xid - XID of gcmd main toplevel window
        active_cwd - full path of current dir of active pane
        active_cwd - full path of current dir of inactive pane
        selected_files - list of selected file uri in active pane
        
It is possible to use GUI in plugins (uncomment pygtk and gtk import
lines), though I haven't tested it yet.

Requirements:
        python>=2.3
        python-devel>=2.3
        gnome-python2-gnomevfs
        
and additionally for python GUI: 
        pygtk


Some handy HOWTOs:

* Python Documentation http://www.python.org/doc/
* Creating a GUI using PyGTK and Glade
http://www.learningpython.com/2006/05/07/creating-a-gui-using-pygtk-and-glade/


Enjoy,
Piotr

reply via email to

[Prev in Thread] Current Thread [Next in Thread]