gcmd-devel
[Top][All Lists]
Advanced

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

Re: [gcmd-dev] Ruby plugins


From: Piotr Eljasiak
Subject: Re: [gcmd-dev] Ruby plugins
Date: Wed, 20 Jun 2007 23:11:53 +0200

> > I'd be very glad to have support for ruby plugins too, but
> > unfortunately
> > I don't know this language at all... I think we may start work on ruby
> > support for gcmd if there is some community interest in ruby - to
> > donate
> > some ruby plugins. So - community - please do some 'pressure' on gcmd
> > coders... ;o) 
> 
> Ok. I'll try to make some 'pressure' :) I've looked at your Python
> plugins and they are pretty clear. But there are some chunks of code
> where i need your help. Let's look at md5sum.py from svn..
> 
> at line 32:
> 
> def main(main_wnd_xid, active_cwd, inactive_cwd, selected_files):
> 
> I wonder what means every parameter. who pass them to the main
> method/function? Can they be predefined? Is there any standard on naming
> of the main method? Please say some words about information which can be
> taken from gcmd to feed my plugin. 

main() is a function, and it has no special meaning in python - for gcmd
it serves as an entry point for every python plugin (so for gcmd main()
is predefined). When gcmd launches pyplugin, in fact it calls main()
function in it. The parameters have predefined (for gcmd) names and
contain values passed from gcmd:

        main_wnd_xid    XID of GNOME Commander main toplevel window
        active_cwd      full path of current dir of active pane
        inactive_cwd    full path of current dir of inactive pane
        selected_files  list of selected file uris in active pane
        
You can see the values passed to pyplugin when starting gcmd in console
with -d=p parameter. Here goes my log for md5sum:

        [PP] Calling md5sum.main()
        [PP] Selected files: 2
        [PP] Main window XID: 56623336 (0x36000e8)
        [PP] Active directory:   /home/piotr/download/Szkocja
        [PP] Inactive directory: /home/piotr/devel/EAL
        [PP] Result of call md5sum.main(): 1
        
There is some information on python plugins at gcmd help file
(accessible with F1).


Hope it'll be of aby help,
Piotr





reply via email to

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