Changeset 512:c54bfe545bf7
- Timestamp:
- 10/25/08 15:48:39 (3 months ago)
- Author:
- EnTeQuAk
- Branch:
- default
- Message:
-
hopefully fixed some plugin issues
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r510
|
r512
|
|
| 39 | 39 | touch_upload_folder, upload_file, create_thumbnail, file_exists, \ |
| 40 | 40 | get_filename |
| 41 | | from zine.utils.http import redirect_back, redirect_to |
| | 41 | from zine.utils.http import redirect_back, redirect_to, redirect |
| 42 | 42 | from zine.i18n import parse_datetime, format_system_datetime, \ |
| 43 | 43 | list_timezones, has_timezone, list_languages, has_language |
| … |
… |
|
| 155 | 155 | # check for broken plugins if we have the plugin guard enabled |
| 156 | 156 | if request.app.cfg['plugin_guard']: |
| | 157 | plugins_to_deactivate = [] |
| 157 | 158 | for plugin in request.app.plugins.itervalues(): |
| 158 | 159 | if plugin.active and plugin.setup_error is not None: |
| 159 | | plugin.deactivate() |
| | 160 | plugins_to_deactivate.append(plugin.name) |
| 160 | 161 | exc_type, exc_value, tb = plugin.setup_error |
| 161 | 162 | if exc_type is SetupError: |
| … |
… |
|
| 177 | 178 | } |
| 178 | 179 | flash(msg, 'error') |
| | 180 | |
| | 181 | if plugins_to_deactivate: |
| | 182 | #TODO: it's quite tricky – it needs at least two reloads to |
| | 183 | # deactivate the plugin (which is in fact a application reload) |
| | 184 | cfg = request.app.cfg.edit() |
| | 185 | cfg['plugins'] = u', '.join(sorted(set(request.app.cfg['plugins']) - \ |
| | 186 | set(plugins_to_deactivate))) |
| | 187 | cfg.commit() |
| | 188 | # we change the plugins inline so that the user get somewhat more |
| | 189 | # informations |
| | 190 | request.app.cfg.touch() |
| | 191 | |
| 179 | 192 | |
| 180 | 193 | #! used to flash messages, add links to stylesheets, modify the admin |