gcmd-devel
[Top][All Lists]
Advanced

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

Re: [gcmd-dev] Python plugins (was: archive browser plugin)


From: Piotr Eljasiak
Subject: Re: [gcmd-dev] Python plugins (was: archive browser plugin)
Date: Fri, 24 Mar 2006 01:43:17 +0100

On Wed, 2006-03-22 at 11:33 +0100, Magnus Stålnacke wrote:
> As another sidenote.
> 
> I have started to develop a shellscript for managing
> mime types, attached is what i have done so far...
> 
> The script takes a filename (works fine in gcmd rightclick
> menu), investigates its mime type, asks for app. name
> and command and then writes/modifies the files in
> ~/.local/share/applications and updates the mimeinfo.chache
> 
> Many possible features are missing, now it just does the
> very basics.

I know it is very likely that I'm opening a box with Pandora now... ;o)

The more I think on plugins the more crucial IMHO they become to gcmd.
My idea for python plugins is that every plugin will get from gcmd
selected files of active and inactive panes - in the form of list of
GnomeVFS entries. Each list entry will be an object of gnomevfs (as
defined at http://www.pygtk.org/pygnomevfs/) 


        gnomevfs.DirectoryHandle - iterator object for reading
        directories
        gnomevfs.Drive - Object representing a device which can mount a
        volume
        gnomevfs.FileInfo - Object which stores information about a file
        gnomevfs.Handle - Object representing an open file
        gnomevfs.URI - Object encapsulating a URI
        gnomevfs.Volume - Abstraction for a mounted file system or
        network location
        
        gnomevfs Functions - Additional functions which are not part of
        a class.
        
                        ...
                        def gnomevfs.get_mime_type(uri)
                    def gnomevfs.get_mime_type_for_data(data)
                        ...
                        
                        
        gnomevfs Constants - the built-in constants of the gnomevfs
        module
        
        ________________________________________________________________

This way plugin may:
- do any kind of batch file processing
- do some processing of file and send its output to an app (eg.
converting pdf2txt and displaying in int-viewer)
- provide any GUI it requires (eg. file content comparing)
- ...

Plugins could be accessible via context menu, toolbar buttons, key
shortcuts (user configurable), ...

I'd like to hear your comments on it - especially in aspects of your
scripts you work on at the moment (is it possible to implement them
using proposed python plugin model?)


Piotr





reply via email to

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