Skip to content

Commit

Permalink
fixup! refactor: remove six and pkg_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Agrendalath committed May 8, 2024
1 parent 5732162 commit 200ffa4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions poll/poll.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ def i18n_service(self):

def get_translation_content(self):
try:
return self.runtime.local_resource_url('public/js/translations/{lang}/textjs.js'.format(
return self.runtime.local_resource_url(self, 'public/js/translations/{lang}/textjs.js'.format(
lang=utils.translation.to_locale(utils.translation.get_language()),
))
except IOError:
return self.runtime.local_resource_url('public/js/translations/en/textjs.js')
return self.runtime.local_resource_url(self, 'public/js/translations/en/textjs.js')

def create_fragment(self, context, template, css, js, js_init):
frag = Fragment()
Expand All @@ -93,11 +93,11 @@ def create_fragment(self, context, template, css, js, js_init):
self.runtime.local_resource_url(self, 'public/js/vendor/handlebars.js')
)

frag.add_css(self.runtime.local_resource_url(css))
frag.add_css(self.runtime.local_resource_url(self, css))

frag.add_javascript(self.get_translation_content())
frag.add_javascript(self.runtime.local_resource_url('public/js/poll_common.js'))
frag.add_javascript(self.runtime.local_resource_url(js))
frag.add_javascript(self.runtime.local_resource_url(self, 'public/js/poll_common.js'))
frag.add_javascript(self.runtime.local_resource_url(self, js))
frag.initialize_js(js_init)
self.include_theme_files(frag)
return frag
Expand Down Expand Up @@ -551,7 +551,7 @@ def student_view(self, context=None):
"""
if not context:
context = {}
js_template = self.runtime.local_resource_url('public/handlebars/poll_results.handlebars')
js_template = self.runtime.local_resource_url(self, 'public/handlebars/poll_results.handlebars')

choice = self.get_choice()

Expand Down Expand Up @@ -619,7 +619,7 @@ def studio_view(self, context=None):
if not context:
context = {}

js_template = self.runtime.local_resource_url('public/handlebars/poll_studio.handlebars')
js_template = self.runtime.local_resource_url(self, 'public/handlebars/poll_studio.handlebars')
context.update({
'question': self.question,
'display_name': self.display_name,
Expand Down Expand Up @@ -926,7 +926,7 @@ def student_view(self, context=None):
if not context:
context = {}

js_template = self.runtime.local_resource_url('public/handlebars/survey_results.handlebars')
js_template = self.runtime.local_resource_url(self, 'public/handlebars/survey_results.handlebars')

choices = self.get_choices()

Expand Down Expand Up @@ -1003,7 +1003,7 @@ def studio_view(self, context=None):
if not context:
context = {}

js_template = self.runtime.local_resource_url('public/handlebars/poll_studio.handlebars')
js_template = self.runtime.local_resource_url(self, 'public/handlebars/poll_studio.handlebars')
context.update({
'feedback': self.feedback,
'display_name': self.block_name,
Expand Down

0 comments on commit 200ffa4

Please sign in to comment.