Re: A nautilus script to enqueue folders and files to rhythmbox



On Wed, Apr 28, 2010 at 10:11 AM, Seemanta Dutta <seemanta gmail com> wrote:
> Actually I did not use update_file_info. I used get_file_list() because I
> derived my class from MenuProvider. Isn't the way I am supposed to do it? Is
> there a better way to do what I have done? Can you please take a look at my
> code and let me know if that is the case? My script is hosted at:
> http://seemanta.net/code/Nautilus_plugin/add-to-rhythmbox_V02.py
>
> In any case, I shall get the latest stuff from git and let you know how it
> goes.
>
> regards,
> Seemanta

You have done it correctly.  Looking at your code, I don't see much
you can do to improvie things with just sub-classing MenuProvider.

One thing you can do is subclass nautilus.InfoProvider and use the
update_file_info (or in the case of git master,
update_file_info_async) to collect file information asynchronously
when the directory is loaded, and then when the user right-clicks on
the file and get_file_items() is called, the information is already
there.  That may add more complexity than you want to deal with though
(for maybe not much benefit).

Adam

>
> On Wed, Apr 28, 2010 at 7:31 PM, Adam Plumb <adamplumb gmail com> wrote:
>>
>> On Wed, Apr 28, 2010 at 9:18 AM, Seemanta Dutta <seemanta gmail com>
>> wrote:
>> > Hi Nautilus hackers/users,
>> >
>> > First of all hats off to all Nautilus hackers. This is such a fine piece
>> > of
>> > software. I have been using Linux for more than 10 years now and more
>> > particularly Gnome where I find Nautilus extremely well integrated. You
>> > guys
>> > have done a damn fine job of creating/maintaining Nautilus !
>> >
>> > I recently wrote a small python plugin to enqueue files or folders
>> > recursively into the rhythmbox play queue. Please find it here:
>> > http://seemanta.net/myblog/?p=634. I am not sure if this is the right
>> > place
>> > to post this. If there is a dedicated mailing list for python extensions
>> > for
>> > Nautilus, please let me know.
>> >
>> > I am however, facing one issue in my script and need your inputs
>> > regarding
>> > it. Whenever a big folder with several levels of sub-folders and files
>> > is
>> > selected, there is a high latency in Nautilus during which it seems to
>> > become unresponsive. This is because my plugin is creating a list of
>> > files
>> > that need to be enqueued and this is done recursively. Is there a way to
>> > overcome this? I agree, that for huge folders, if I right click the
>> > delay
>> > might be acceptable. But I think if I simply select a folder, the python
>> > plugin should not get invoked.
>> >
>> > Any ideas how to make my script run only in case of a right-click and
>> > not on
>> > normal left click selects ?
>> >
>> > regards,
>> > Seemanta
>> >
>> >
>>
>> I'm the maintainer for the nautilus-python bindings, and I've been
>> doing some work recently to allow for asynchronous IO work in the
>> update_file_info method, which I assume is what you are using for your
>> IO.  It is still somewhat experimental, but I would appreciate it if
>> you could clone git master at
>> http://git.gnome.org/browse/nautilus-python and test your extension
>> using the new code.  If you do that, let me know whether it alleviates
>> the problems you're seeing with your extension.  FYI, you should read
>> the new documentation in examples/documentation.py to see how to use
>> the new features.
>>
>> Adam
>> --
>> nautilus-list mailing list
>> nautilus-list gnome org
>> http://mail.gnome.org/mailman/listinfo/nautilus-list
>
>


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