Make app names as module identifiers

- The last part of the module import path is the module name.  This also
  becomes the Django app name.  Apps names have to be unique.  Hence,
  there is no scope for two different modules with same name but
  different load path to exist in the project.

- Most uses of list of loaded modules are dealing with app names instead
  of full module load path.  This is due to the fact that Django deals
  with app names and not module paths.

- It is also somewhat clumsy to access a loaded module as we are
  re-importing every time to get access module.

- Simplify all of the above by using app names are module identifiers
  and maintaing an ordered dictionary of app names to loadded modules.

- Remove unused imports.

- Minor styling fixes.
This commit is contained in:
Sunil Mohan Adapa committed 2016-02-13 13:49:23 +05:30
1 parent 3e2c84dba2
commit 7f4c5f7410
32 files changed
+61 -91

No files matched your search

+1 -7
View File
@@ -20,19 +20,13 @@ Plinth module for using Let's Encrypt.
"""
from django.utils.translation import ugettext_lazy as _
import json
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import service as service_module
from plinth.modules import names
depends = [
'plinth.modules.apps',
'plinth.modules.names'
]
depends = ['apps', 'names']
service = None