7119d655886d6e1a847dc11ec3eabc9822675eb7
[watersofshiloah] / src / imagestore.py
1 import os
2
3 import cairo
4 import gtk
5
6
7 class ImageStore(object):
8
9         def __init__(self, storePath, cachePath):
10                 self._storePath = storePath
11                 self._cachePath = cachePath
12
13         def get_surface_from_store(self, image):
14                 path = os.path.join(self._storePath, image)
15                 image = cairo.ImageSurface.create_from_png(path)
16                 return image
17
18         def get_image_from_store(self, image):
19                 path = os.path.join(self._storePath, image)
20                 image = gtk.Image()
21                 image.set_from_file(path)
22                 return image