Artem Egorkine avatar Artem Egorkine committed 75b745b

Reverted commit a2da213e5370 reenabling the plugin guard and exposing it on the plugin page.

Comments (0)

Files changed (3)

         u'it.')),
 
     # plugin settings
-    'plugin_guard':             BooleanField(default=not _dev_mode),
+    'plugin_guard':             BooleanField(default=True),
     'plugins':                  CommaSeparated(TextField(), default=list),
     'plugin_searchpath':        CommaSeparated(TextField(), default=list,
         help_text=l_(u'It\'s possible to put one or more comma '
         if initial is None:
             initial = dict(
                 active_plugins=[x.name for x in app.plugins.itervalues()
-                                if x.active]
+                                if x.active],
+                disable_guard=not app.cfg['plugin_guard']
             )
         forms.Form.__init__(self, initial)
 
         """Apply the changes."""
         t = self.app.cfg.edit()
         t['plugins'] = u', '.join(sorted(self.data['active_plugins']))
+        t['plugin_guard'] = not self.data['disable_guard']
         t.commit()
 
 

zine/templates/admin/plugins.html

       <span class="bundlemarker">*</span> marked plugins are bundled with Zine
       and upgraded as part of it.
     {% endtrans %}</p>
+    <h2>{{ _("Plugin Guard") }}</h2>
+    <p>{% trans %}
+      Normally the plugin guard is enabled and catches exceptions during
+      plugin setup.  In some situations however this is not wanted, for
+      example if you want to debug a broken plugin.
+    {% endtrans %}
+    <dl>{{ form.disable_guard.as_dd() }}</dl>
     <h2>{{ _("Add New Plugin") }}</h2>
     <p>{% trans %}
       If you have a plugin as Zine <tt>.plugin</tt> file you can upload it
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.