Commit 1042945a authored by Martin Matějek's avatar Martin Matějek

fixup! fixup! Refactoring of gettext translations

parent c441d370
......@@ -5,16 +5,16 @@ import yaml
class NotificationSkeleton:
ATTRS = ['name', 'plugin_name', 'version', 'template', 'actions', 'template_dir', 'timeout', 'severity', 'persistent', 'explicit_dismiss']
ATTRS = ['name', 'plugin_name', 'version', 'template', 'actions', 'template_dirs', 'timeout', 'severity', 'persistent', 'explicit_dismiss']
DEFAULT_ATTRS = ['timeout', 'severity', 'persistent', 'explicit_dismiss']
def __init__(self, name, plugin_name, version, template, actions, template_dir, timeout=None, severity='info', persistent=False, explicit_dismiss=True):
def __init__(self, name, plugin_name, version, template, actions, template_dirs, timeout=None, severity='info', persistent=False, explicit_dismiss=True):
self.name = name
self.plugin_name = plugin_name
self.version = version
self.template = template
self.actions = actions
self.template_dir = template_dir
self.template_dirs = template_dirs
self.timeout = timeout
self.severity = severity
......@@ -64,7 +64,7 @@ class NotificationSkeleton:
Prepare template for later use
For now it will be initiated when creating new skeleton instance
"""
template_loader = jinja2.FileSystemLoader(self.template_dir)
template_loader = jinja2.FileSystemLoader(self.template_dirs)
self.jinja_env = jinja2.Environment(
loader=template_loader,
autoescape=True,
......
......@@ -104,7 +104,7 @@ class PluginStorage:
if attr in skeleton:
notification_args[attr] = skeleton[attr]
notification_args['template_dir'] = [
notification_args['template_dirs'] = [
os.path.join(self.templates_dir, plugin_name),
os.path.join(os.getcwd(), self.plugin_dir),
]
......
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