25 Commits

Author SHA1 Message Date
Joseph Nuthalapati
d92ca09e19
framework: Remove module init() functions
Fixes #1906

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-08-03 18:06:48 -04:00
Sunil Mohan Adapa
9368504da5
*.py: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:38:55 +02:00
Sunil Mohan Adapa
c4ab81252c
module_loader: Remove log message when app is imported
It is no longer very useful and floods the log window, taking our attention away
from more import things. It is only useful during new module development. Module
load order message helps anyway.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-09-08 09:49:21 -04:00
Sunil Mohan Adapa
78961d6b99
module_loader: Cosmetic changes by yapf
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-09-08 09:49:12 -04:00
Nikolas Nyby
ace339eabf
Introduce flake8 checking - #58
This introduces flake8 and fixes a bunch of flake8 errors.

flake8 is run with: ./venv/bin/flake8 plinth
if you're using a python3 venv.

We can eventually further integrate this with gitlab ci.

https://salsa.debian.org/freedombox-team/plinth/issues/58

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-07-24 14:01:54 -07:00
Sunil Mohan Adapa
3bedce47fd
module_loader: Specially load modules in development mode
Instead of the need to run './setup install' to install the module-enabled files
into /etc/plinth/modules-enabled, pickup module configuration from app/data
directories in development mode.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-03-17 16:20:51 -04:00
Michael Pimmer
00ac068133
Merge ./run --debug into --develop option
Signed-off-by: Michael Pimmer <info@fonfon.at>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-06-18 19:27:38 -04:00
Sunil Mohan Adapa
8f4811b350
Rename Plinth to FreedomBox in more module doc strings
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:31 -05:00
Sunil Mohan Adapa
dea4af17fb
Rename Plinth to FreedomBox in license headers
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:09 -05:00
Joseph Nuthalpati
62f26433e8
Add django-simple-captcha in the login page
User will be shown captcha in the second attempt to login if login
fails in the first attempt.

Signed-off-by: Joseph Nuthalpati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-10-17 22:07:12 -04:00
Sunil Mohan Adapa
b8adb19e8b
Fix some Django deprecations
- Use simple_tag() instead of assignment_tag().  Assignments with simple_tag()
  works just like before.

- When loading urls for application, specify application name during inclusion.

- Use the reverse() method from django.urls which as moved from
  django.core.urlresolvers.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-10-04 18:32:41 -04:00
Sunil Mohan Adapa
dd196c504d
module_loader: Split the URLs inclusion step
This is useful if we need to perform URL reversing operations before loading
modules.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-05-05 22:31:32 -04:00
Sunil Mohan Adapa
8ce6312190
Tune log message verbosity
It is no longer very important to show Django configured applications
and module import messages because in practice we have rarely ever seen
being useful anywhere but for development.  Just print the module load
order just once.
2016-09-17 13:48:42 -04:00
Sunil Mohan Adapa
80d9f0d41e
module_loader: Add setup helper to every module
- During initialization add a setup helper to every module.  For use
  later.
2016-02-13 13:50:06 +05:30
Sunil Mohan Adapa
7f4c5f7410
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.
2016-02-13 13:49:23 +05:30
Sunil Mohan Adapa
a69f419c3c Make Django urlpatterns list of url()s
- Support for legacy pattern() mechanism will be removed in Django
  1.10.  Currently we see a warning for each Plinth module.
2015-12-05 09:33:23 -05:00
Sunil Mohan Adapa
eae507d456 Minor pylint fixes 2015-07-28 20:01:39 +05:30
Sunil Mohan Adapa
da9faa5e02 Don't load Debian backup files as module configuration
When modules were removed, Debian packaging also had to remove them to
avoid errors.  When Debian guidelines are following and correspoding deb
helper is used, it creates .dpkg-* files in the module configuration
directory.  Plinth tries to load these which causes problems.  We should
consider loading files with a known extension in future.
2015-01-25 01:50:31 +05:30
Sunil Mohan Adapa
0bb2dd51d8 Minor styling changes in first boot module 2014-10-20 00:22:47 +05:30
fonfon
699a3ac0dc fixed static_dir of modules; omit hidden files in modules_enabled directory 2014-10-20 00:14:09 +05:30
Sunil Mohan Adapa
fc2fdc4d27 Turn modules into proper Django applications 2014-10-04 13:43:22 +05:30
Sunil Mohan Adapa
cc549fff61 Load modules using explict paths instead of config file name 2014-10-04 13:41:27 +05:30
Sunil Mohan Adapa
9e0d08e49d Move enabled modules list to configuration directory 2014-10-04 13:41:26 +05:30
fonfon
53adac652b introduced signals for pre/post-module-loading 2014-09-12 22:26:35 +02:00
Sunil Mohan Adapa
65fa648d9f Reorganize python sources into 'plinth' package 2014-08-29 12:57:27 +05:30