infinoted: Move views to a separate views module

Tests performed:

- Visit infinoted app view.

- Enable/disable infinoted.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2020-02-29 19:52:30 -05:00 committed by Veiko Aasa
parent fe5bdf290b
commit ea1e7e953f
No known key found for this signature in database
GPG Key ID: 478539CAE680674E
3 changed files with 13 additions and 7 deletions

View File

@ -12,7 +12,6 @@ from plinth import cfg, frontpage, menu
from plinth.daemon import Daemon
from plinth.modules.firewall.components import Firewall
from plinth.utils import format_lazy
from plinth.views import AppView
from .manifest import backup, clients # noqa, pylint: disable=unused-import
@ -83,11 +82,6 @@ def init():
app.set_enabled(True)
class InfinotedAppView(AppView):
app_id = 'infinoted'
port_forwarding_info = port_forwarding_info
def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)

View File

@ -5,7 +5,7 @@ URLs for the infinoted module.
from django.conf.urls import url
from plinth.modules.infinoted import InfinotedAppView
from .views import InfinotedAppView
urlpatterns = [
url(r'^apps/infinoted/$', InfinotedAppView.as_view(), name='index'),

View File

@ -0,0 +1,12 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Views for the infinoted app.
"""
from plinth.modules import infinoted
from plinth.views import AppView
class InfinotedAppView(AppView):
"""Main app view for Infinoted."""
app_id = 'infinoted'
port_forwarding_info = infinoted.port_forwarding_info