Re: Error: '__main__.NautilusVFSFile' object is not iterable
- From: Cosimo Cecchi <cosimoc gnome org>
- To: Giuseppe Tondi <avernalvigil gmail com>
- Cc: nautilus-list gnome org
- Subject: Re: Error: '__main__.NautilusVFSFile' object is not iterable
- Date: Wed, 28 Mar 2012 17:06:28 -0400
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]