Fwd: Error: '__main__.NautilusVFSFile' object is not iterable





---------- Forwarded message ----------
From: Giuseppe Tondi <avernalvigil gmail com>
Date: Fri, Apr 13, 2012 at 8:53 AM
Subject: Re: Error: '__main__.NautilusVFSFile' object is not iterable
To: Cosimo Cecchi <cosimoc gnome org>


Well...it worked!

Seems like I have to study a little more extensively the nautilus-python API  :-}

However, from the deepness of my noobness, thank you!


On Wed, Mar 28, 2012 at 11:06 PM, Cosimo Cecchi <cosimoc gnome org> wrote:
On Sun, 2012-03-04 at 18:02 +0100, Giuseppe Tondi wrote:

> Unfortunately, Nautilus does not like these lines and spits out an
> error:
>
> Traceback (most recent call last):
>   File
> "/home/vigil/.local/share/nautilus-python/extensions/root-menu.py",
> line 63, in get_background_items
>     sub_menuitem.connect('activate', self.root_terminal,
> re.escape(current_directory))
>   File "/usr/lib/python2.7/re.py", line 208, in escape
>     s = list(pattern)
> TypeError: '__main__.NautilusVFSFile' object is not iterable
>
> I'm sure I'm missing something obvious, but I supposed that
> 'current_directory' in get_background_items was simply... the current
> directory. It turns out that it is a mysterious iterable object I
> wasn't aware of.

Hi Giuseppe,

I'm no python expert, but it looks to me like what you need to pass to
escape() is a string, right? current_directory is probably an object
implementing NautilusFileInfo, so can you try calling get_uri() on it
and pass that in the callback?

Bye,
Cosimo





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