2 # -*- coding: utf-8 -*-
6 from xdg
import IconTheme
8 # TODO - cache icons for faster lookup
11 def __init__(self
, *args
):
12 self
.extra_themes
= []
14 def addIconPath(self
, path
):
15 IconTheme
.icondirs
.append(path
)
17 def addThemeName(self
, theme_name
):
18 for i
in range(len(IconTheme
.icondirs
)):
19 theme_path
= path
.join(IconTheme
.icondirs
[i
], theme_name
)
20 if (path
.exists(theme_path
)):
21 self
.extra_themes
.append(theme_name
)
23 def getIconPath(self
, name
, size
=48):
24 for i
in range(len(self
.extra_themes
)):
25 icon
= IconTheme
.getIconPath(name
, size
, self
.extra_themes
[i
])
29 icon
= IconTheme
.getIconPath(name
, size
)
33 print "No icon found for", name