FileInfo method get_string_attribute (Python bindings)

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown FileInfo method get_string_attribute (Python bindings)

by Nicholas Jeffries :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm on a steep learning curve, trying to get my head round Python & gtk, so I can write my own Nautilus extension using the Python bindings.

There is documentation, of a kind here which is helping me:

http://svn.gnome.org/viewvc/nautilus-python/trunk/examples/documentation.py?view=markup&pathrev=26

My goal is simple - to get and set a directory's custom icon depending on a number of conditions. I assume I need to do this through the InfoProvider class.

I can't see any explicit FileInfo method dealing with the custom icon. Is it done through (1) a string attribute via set/get_string_attribute, or (2) do I need to do it outside the Nautilus API through ~/.nautilus/xml files or gio?

If the former, is there a list of the possible "default" attributes which can be got (aside from custom ones you can set yourself).

If the latter, what is the best way of detecting which method nautilus is using to store custom icon info?


Any help much appreciated.

Nick


--
nautilus-list mailing list
nautilus-list@...
http://mail.gnome.org/mailman/listinfo/nautilus-list

Re: FileInfo method get_string_attribute (Python bindings)

by Alexander Larsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2009-10-06 at 21:11 +0100, Nicholas Jeffries wrote:

> Hi,
>
> I'm on a steep learning curve, trying to get my head round Python &
> gtk, so I can write my own Nautilus extension using the Python
> bindings.
>
> There is documentation, of a kind here which is helping me:
>
> http://svn.gnome.org/viewvc/nautilus-python/trunk/examples/documentation.py?view=markup&pathrev=26
>
> My goal is simple - to get and set a directory's custom icon depending
> on a number of conditions. I assume I need to do this through the
> InfoProvider class.
>
> I can't see any explicit FileInfo method dealing with the custom icon.
> Is it done through (1) a string attribute via
> set/get_string_attribute, or (2) do I need to do it outside the
> Nautilus API through ~/.nautilus/xml files or gio?
>
> If the former, is there a list of the possible "default" attributes
> which can be got (aside from custom ones you can set yourself).
>
> If the latter, what is the best way of detecting which method nautilus
> is using to store custom icon info?

There is really no "standard" way for an extension to set the custom
icon of a file. With recent versions of nautilus (2.28) you can use the
gio metadata to set one, but this will be a persistant metadata change
for the file in question, not just something visible when the plugin is
active.


--
nautilus-list mailing list
nautilus-list@...
http://mail.gnome.org/mailman/listinfo/nautilus-list

Re: FileInfo method get_string_attribute (Python bindings)

by Nicholas Jeffries :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That is really useful - thanks. So I can continue coding the way I am at present, rather than worrying that there is a much easier way of doing it through the FileInfo object!

Thanks for your help.

2009/10/7 Alexander Larsson <alexl@...>
On Tue, 2009-10-06 at 21:11 +0100, Nicholas Jeffries wrote:
> Hi,
>
> I'm on a steep learning curve, trying to get my head round Python &
> gtk, so I can write my own Nautilus extension using the Python
> bindings.
>
> There is documentation, of a kind here which is helping me:
>
> http://svn.gnome.org/viewvc/nautilus-python/trunk/examples/documentation.py?view=markup&pathrev=26
>
> My goal is simple - to get and set a directory's custom icon depending
> on a number of conditions. I assume I need to do this through the
> InfoProvider class.
>
> I can't see any explicit FileInfo method dealing with the custom icon.
> Is it done through (1) a string attribute via
> set/get_string_attribute, or (2) do I need to do it outside the
> Nautilus API through ~/.nautilus/xml files or gio?
>
> If the former, is there a list of the possible "default" attributes
> which can be got (aside from custom ones you can set yourself).
>
> If the latter, what is the best way of detecting which method nautilus
> is using to store custom icon info?

There is really no "standard" way for an extension to set the custom
icon of a file. With recent versions of nautilus (2.28) you can use the
gio metadata to set one, but this will be a persistant metadata change
for the file in question, not just something visible when the plugin is
active.





--
Nick Jeffries

mobile: +44 7787 137 880
email: nick@...
skype: nick_jeffries

http://www.linkedin.com/in/njeffries

--
nautilus-list mailing list
nautilus-list@...
http://mail.gnome.org/mailman/listinfo/nautilus-list