Commit 01a829f5 authored by Jonathan Matthew's avatar Jonathan Matthew 🥗
Browse files

context: remove the module_context parameter (bug #678661)

Caching the template modules doesn't really buy us anything, and
there is the possibility that it could be used to load hostile code
into another user's process (since the module directory was under /tmp).
If it turns out we need the cache, we should put it somewhere
under the XDG cache dir.
parent 750336ee
......@@ -125,10 +125,8 @@ class AlbumView (GObject.GObject):
def load_tmpl (self):
self.path = rb.find_plugin_file (self.plugin, 'tmpl/album-tmpl.html')
self.loading_path = rb.find_plugin_file (self.plugin, 'tmpl/loading.html')
self.album_template = Template (filename = self.path,
module_directory = '/tmp/context')
self.loading_template = Template (filename = self.loading_path,
module_directory = '/tmp/context')
self.album_template = Template (filename = self.path)
self.loading_template = Template (filename = self.loading_path)
self.styles = self.basepath + '/tmpl/main.css'
def album_list_ready (self, ds):
......
......@@ -123,8 +123,8 @@ class ArtistView (GObject.GObject):
def load_tmpl (self):
self.path = rb.find_plugin_file(self.plugin, 'tmpl/artist-tmpl.html')
self.loading_path = rb.find_plugin_file (self.plugin, 'tmpl/loading.html')
self.template = Template (filename = self.path, module_directory = '/tmp/context/')
self.loading_template = Template (filename = self.loading_path, module_directory = '/tmp/context')
self.template = Template (filename = self.path)
self.loading_template = Template (filename = self.loading_path)
self.styles = self.basepath + '/tmpl/main.css'
def connect_signals (self):
......
......@@ -106,8 +106,7 @@ class LinksView (GObject.GObject):
self.path = rb.find_plugin_file(self.plugin, 'tmpl/links-tmpl.html')
self.images = self.basepath + '/img/links/'
self.styles = self.basepath + '/tmpl/main.css'
self.template = Template (filename = self.path,
module_directory = '/tmp/context/')
self.template = Template (filename = self.path)
self.file = self.template.render (error = ds.get_error (),
artist = ds.get_artist(),
......
......@@ -110,10 +110,8 @@ class LyricsView (GObject.GObject):
def load_tmpl (self):
self.path = rb.find_plugin_file(self.plugin, 'tmpl/lyrics-tmpl.html')
self.loading_path = rb.find_plugin_file (self.plugin, 'tmpl/loading.html')
self.template = Template (filename = self.path,
module_directory = '/tmp/context/')
self.loading_template = Template (filename = self.loading_path,
module_directory = '/tmp/context')
self.template = Template (filename = self.path)
self.loading_template = Template (filename = self.loading_path)
self.styles = self.basepath + '/tmpl/main.css'
def lyrics_ready (self, ds, entry, lyrics):
......
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