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

Cosimo Cecchi <[email protected]>
Newsgroups gmane.comp.gnome.nautilus
Message-ID <1332968788.12813.27.camel@x201>
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

-- 
nautilus-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/nautilus-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.