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:
Sunil Mohan Adapa 2019-09-06 17:12:55 -07:00 committed by James Valleroy
parent 4842b81515
commit 78961d6b99
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -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 = [