mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
module_loader: Cosmetic changes by yapf
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
4842b81515
commit
78961d6b99
@ -19,15 +19,15 @@ Discover, load and manage FreedomBox applications.
|
||||
"""
|
||||
|
||||
import collections
|
||||
import django
|
||||
import importlib
|
||||
import logging
|
||||
import pathlib
|
||||
import re
|
||||
|
||||
from plinth import cfg
|
||||
from plinth import setup
|
||||
from plinth.signals import pre_module_loading, post_module_loading
|
||||
import django
|
||||
|
||||
from plinth import cfg, setup
|
||||
from plinth.signals import post_module_loading, pre_module_loading
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -71,8 +71,7 @@ def load_modules():
|
||||
_insert_modules(module_name, module, remaining_modules,
|
||||
ordered_modules)
|
||||
except KeyError:
|
||||
logger.error('Unsatified dependency for module - %s',
|
||||
module_name)
|
||||
logger.error('Unsatified dependency for module - %s', module_name)
|
||||
|
||||
logger.info('Module load order - %s', ordered_modules)
|
||||
|
||||
@ -117,7 +116,8 @@ def _include_module_urls(module_import_path, module_name):
|
||||
try:
|
||||
urls.urlpatterns += [
|
||||
django.conf.urls.url(
|
||||
r'', django.conf.urls.include((url_module, module_name)))]
|
||||
r'', django.conf.urls.include((url_module, module_name)))
|
||||
]
|
||||
except ImportError:
|
||||
logger.debug('No URLs for %s', module_name)
|
||||
if cfg.develop:
|
||||
@ -138,8 +138,8 @@ def _initialize_module(module_name, module):
|
||||
try:
|
||||
init()
|
||||
except Exception as exception:
|
||||
logger.exception('Exception while running init for %s: %s',
|
||||
module, exception)
|
||||
logger.exception('Exception while running init for %s: %s', module,
|
||||
exception)
|
||||
if cfg.develop:
|
||||
raise
|
||||
|
||||
@ -156,8 +156,8 @@ def get_modules_to_load():
|
||||
# './setup.py install' has not been executed yet. Pickup files to load
|
||||
# from local module directories.
|
||||
directory = pathlib.Path(__file__).parent
|
||||
files = list(directory.glob(
|
||||
'modules/*/data/etc/plinth/modules-enabled/*'))
|
||||
files = list(
|
||||
directory.glob('modules/*/data/etc/plinth/modules-enabled/*'))
|
||||
|
||||
# Omit hidden files
|
||||
files = [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user