Commit b2b50439 authored by Dan Pascu's avatar Dan Pascu

Added method to IconManager to retrieve the icon's content for a given id

parent a85d32e7
......@@ -95,6 +95,15 @@ class IconManager(object):
icon = None
return self.iconmap.setdefault(id, icon)
def get_image(self, id):
icon = self.get(id)
if icon is None:
return None
try:
return file(icon.filename).read()
except Exception:
return None
def store_data(self, id, data):
directory = ApplicationData.get('images')
filename = os.path.join(directory, id + '.png')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment