diff options
Diffstat (limited to 'service/pixelated/resources/inbox_resource.py')
-rw-r--r-- | service/pixelated/resources/inbox_resource.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/service/pixelated/resources/inbox_resource.py b/service/pixelated/resources/inbox_resource.py index 13d1f298..d0096efe 100644 --- a/service/pixelated/resources/inbox_resource.py +++ b/service/pixelated/resources/inbox_resource.py @@ -35,8 +35,8 @@ class InboxResource(BaseResource): def __init__(self, services_factory): BaseResource.__init__(self, services_factory) - self._not_quite_the_templates_folder = self._get_not_quite_the_templates_folder() - self._html_template = open(os.path.join(self._not_quite_the_templates_folder, 'index.html')).read() + with open(pkg_resources.resource_filename('templates', 'index.html')) as f: + self._html_template = f.read() with open(pkg_resources.resource_filename('templates', 'Interstitial.html')) as f: self.interstitial = f.read() self._mode = MODE_STARTUP @@ -44,10 +44,6 @@ class InboxResource(BaseResource): def initialize(self): self._mode = MODE_RUNNING - def _get_not_quite_the_templates_folder(self): - path = os.path.dirname(os.path.abspath(pixelated.__file__)) - return os.path.join(path, '..', '..', 'web-ui', 'public') - def _is_starting(self): return self._mode == MODE_STARTUP |