Finding a file icon using the MIME type using GTK

Is there a way to find out which icon to use for a given MIME type using GTK / pygtk?

I know about gio.File(filename).query_info("standard::icon").get_icon(), but I need to find the icon without having to read the file.

+3
source share
1 answer

Give it a try gio.content_type_get_icon(). For instance:.

>>> gio.content_type_get_icon ('text/python')
<gio.ThemedIcon at 0xb7d0f734: text-python, gnome-mime-text-python, text-x-generic>
+5
source

Source: https://habr.com/ru/post/1745081/


All Articles