Portable: Create empty plugins directory.

Fixed file permissions.
This commit is contained in:
Emanuel Schütze 2014-05-05 20:27:48 +02:00
parent 09757f4f0d
commit 7add4c5691
3 changed files with 8 additions and 4 deletions

0
extras/openslides_gui/gui.py Executable file → Normal file
View File

View File

@ -510,6 +510,10 @@ def main():
os.path.join(odir, "packages-info"))
write_package_info_content(os.path.join(odir, 'packages-info', 'PACKAGES.txt'))
# Create empty plugins directory
plugindir = os.path.join(odir, "openslides", "plugins")
os.makedirs(plugindir)
# AUTHORS, LICENSE, README
write_metadatafile('AUTHORS', os.path.join(odir, 'AUTHORS.txt'))
write_metadatafile('LICENSE', os.path.join(odir, 'LICENSE.txt'))

8
openslides/utils/plugins.py Executable file → Normal file
View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import pkgutil
import os
import pkgutil
import sys
from django.utils.importlib import import_module
@ -35,9 +35,10 @@ def get_plugins_from_path(path):
def collect_plugins():
"""Collect all plugins that can be automatically discovered."""
"""
Collect all plugins that can be automatically discovered.
"""
plugins = get_plugins_from_entry_points()
# add all modules in plugins/ dir of portable automatically
if detect_openslides_type() == WINDOWS_PORTABLE_VERSION:
plugins_path = os.path.join(
@ -45,7 +46,6 @@ def collect_plugins():
if plugins_path not in sys.path:
sys.path.append(plugins_path)
plugins += get_plugins_from_path(plugins_path)
return plugins