()
| 26 | sys.path.append(settings.MEDIA_ROOT) |
| 27 | |
| 28 | def init_plugins(): |
| 29 | # Make sure app/media/plugins exists |
| 30 | if not os.path.exists(get_plugins_persistent_path()): |
| 31 | os.mkdir(get_plugins_persistent_path()) |
| 32 | |
| 33 | # Make sure app/media/plugins is importable as a module |
| 34 | if not os.path.isfile(os.path.join(get_plugins_persistent_path(), "__init__.py")): |
| 35 | try: |
| 36 | with open(os.path.join(get_plugins_persistent_path(), "__init__.py"), 'w') as f: |
| 37 | f.write("\n") |
| 38 | except Exception as e: |
| 39 | logger.warning("Cannot create __init__.py: %s" % str(e)) |
| 40 | |
| 41 | build_plugins() |
| 42 | sync_plugin_db() |
| 43 | register_plugins() |
| 44 | |
| 45 | def sync_plugin_db(): |
| 46 | """ |
no test coverage detected