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

Giuseppe Tondi <[email protected]>
Newsgroups gmane.comp.gnome.nautilus
Message-ID <CAHi0fH+r-N2kGcPiGp+yxp1Tga6J=uozzhVnZ3kHBdacziJCSw@mail.gmail.com>
---------- Forwarded message ----------
From: Giuseppe Tondi <[email protected]>
Date: Fri, Apr 13, 2012 at 8:53 AM
Subject: Re: Error: '__main__.NautilusVFSFile' object is not iterable
To: Cosimo Cecchi <[email protected]>


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 <[email protected]> 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
>
>

-- 
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.