21 Commits

Author SHA1 Message Date
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
afb00f98ab
upgrades: Make manual upgrade a background process
- Closes #366 and closes #304 (all sub-tasks).

- Start new process group with setsid() by sending
  start_new_session=True

- Detach from parent process fds by closing all FDs and attaching stdin,
  stdou and stderr to /dev/null.

- Don't wait for the process to complete.

- This allows for upgrading Plinth while upgrades are trigged from
  Plinth itself.

- Show log of upgrade exection instead of output and error log of the
  process which can no longer be collected.  This has the advantage of
  showing automatic executions also.

- Rewrite the mechanism to detect whether upgrades can be run.  It is
  now based on whether the package manager is busy.  This has the
  advantage of working properly if other apt processes are running,
  automatic upgrades are running, etc.

- Busy status works even if Plinth is restarted while upgrades are in
  progress.

- More descriptive messages showing that upgrades don't have to be
  triggered manually.

- Warn that other packages can't be installed while upgrades are
  running, which may take a long time.

- Warn the users of potential temporary unavailability of
  Plinth/Apache2.
2016-01-20 21:13:18 -05:00
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
0220cff57c upgrades: Minor fixes
- Show error message based on return code rather than messages in
  stderr.

- Don't decorate the message paragraph with alert color, we are already
  doing that by showing a message at the top.

- Untabify.

- Improve message showing that upgrades are running, gramatically.

- Show errors messages decorated as errors.

- Minor cleanups.
2015-11-26 11:10:59 +05:30
James Valleroy
24cd095c6e upgrades: Run as background task (Closes: #285). 2015-11-26 07:53:01 +05:30
Sunil Mohan Adapa
3df1a88824 Switch to Django i18n for code strings
Django i18n layer is on top of gettext and provide may crucial features
such as per-request locales, lazy translations etc.
2015-11-13 22:08:43 +05:30
Sunil Mohan Adapa
02cd89b60d Internationalize strings in template files 2015-11-13 22:02:17 +05:30
Sunil Mohan Adapa
114370c2e0 upgrades: Finish the reorganisation of views 2015-09-02 19:23:05 +05:30
James Valleroy
c539dc6db3 upgrades: Move auto upgrades configure form to first tab.
Split forms and views into separate files.
2015-09-02 19:23:05 +05:30
James Valleroy
76cdc69099 upgrades: Enable automatic upgrades after install 2015-09-02 19:23:05 +05:30
fonfon
824a9091c1 use django-stronghold for authentication handling (instead of @login_required) 2015-07-01 00:01:02 +05:30
Bob Girard
d64ce6cc01 Bundle tests with applications
- For each application, add ./tests directory and __init__.py file
  within it.

- Modify test controllers (coverage.py, runtests.py) to find the new
  test directories for testing and coverage analysis.

- Move existing application-specific test modules (test_pagekite.py) to
  the newly created directories.
2015-06-26 12:05:48 +05:30
Sunil Mohan Adapa
be838a30c1 package: Add ability to receive notification on install
- Fix issue with Mumble firewall enabling after a fresh install.
2015-03-28 16:02:39 -04:00
Sunil Mohan Adapa
c3ac49e676 upgrades: Change menu item to 'Software Upgrades'
- This will be more familiar to the user due to similar messages on the
  desktops and mobiles.
2015-02-22 17:48:35 -05:00
Sunil Mohan Adapa
1f43be95a0 upgrades: Handle action errors using error codes
- This is more reliable than string parsing in the output.

- We will be using pythonic try/catches instead of if conditions.
2015-02-22 17:48:35 -05:00
Sunil Mohan Adapa
d33e60c74a upgrades: Minor styling fixes
- Remove emacs mode line as emacs automatically detect Python files
  based on the #! line.

- End comments with a '.'.

- Use single quotes instead of double quotes for string for consistensy.

- Update message to say that it take more than a minute to finish
  upgrades.  Some times it takes a lot more than that.
2015-02-22 17:48:34 -05:00
Sunil Mohan Adapa
a5473ae7f2 upgrades: Require CSRF token for starting upgrade process 2015-02-22 17:48:34 -05:00
fonfon
836ddd4a59 More user-friendly output of an upgrade run 2015-01-28 21:23:25 +00:00
James Valleroy
5939292c86 fix typo 2015-01-28 19:50:27 +00:00
James Valleroy
304e2aea62 Add form for enabling automatic upgrades. 2015-01-28 19:50:26 +00:00
James Valleroy
80eff7fd6e Add upgrades module that can run unattended-upgrades. 2015-01-28 19:50:26 +00:00