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: Mon, 27 Mar 2006 23:05:20 +0200

On Mon, 2006-03-27 at 05:31 +0200, Micha wrote:
> |         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
> 
> 
> I still can't reallly imagine how such a list would look like.
> Could you post an example ?


1. The list will contain either all selected files or file currently
under cursor (if no selected files). Let's say our list list is held in
variable fl - the snippet code might be alike: 


from os import spawnl
from re import match


for f in fl:
    if match("\.pdf$",f.FileInfo.name):
        # convert f to text using pdf2text
        spawnl(os.P_NOWAIT,dir,’pdf2txt %s’ % f.FileInfo.name)


This is very ugly, but should give general idea how it can be used.
There are tons of python modules for literally everything: starting from
image processing and ending with database access.


> Can plugins 'query' gcmd about his status ?
> I think it would be nice if a plugin and gcmd could have communication
> (like in C++). But i don't know if python provides this feature.

2. IMHO it wouldn't be possible. All data will be passed as
procedure/function parameters to plugin. What kind of data data should
be available from gcmd ? Apart from 1) I can imagine only some option
data, but of course it is only my guess...


Piotr





reply via email to

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