mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
Module is a directory instead of file
- Move enabled module symlinks to 'modules/enabled' directory. - Make all modules properly importable - Import modules instead of their symlinks
This commit is contained in:
parent
8d5e976b84
commit
912c5022ca
@ -1 +0,0 @@
|
||||
installed/apps/apps.py
|
||||
@ -1 +0,0 @@
|
||||
installed/lib/auth.py
|
||||
@ -1 +0,0 @@
|
||||
installed/lib/auth_page.py
|
||||
@ -1 +0,0 @@
|
||||
installed/config/config.py
|
||||
@ -1 +0,0 @@
|
||||
installed/diagnostics/diagnostics.py
|
||||
1
modules/enabled/apps
Symbolic link
1
modules/enabled/apps
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/apps/
|
||||
1
modules/enabled/config
Symbolic link
1
modules/enabled/config
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/config/
|
||||
1
modules/enabled/diagnostics
Symbolic link
1
modules/enabled/diagnostics
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/diagnostics/
|
||||
1
modules/enabled/expert_mode
Symbolic link
1
modules/enabled/expert_mode
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/expert_mode/
|
||||
1
modules/enabled/firewall
Symbolic link
1
modules/enabled/firewall
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/firewall/
|
||||
1
modules/enabled/first_boot
Symbolic link
1
modules/enabled/first_boot
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/first_boot/
|
||||
1
modules/enabled/help
Symbolic link
1
modules/enabled/help
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/help/
|
||||
1
modules/enabled/lib
Symbolic link
1
modules/enabled/lib
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/lib/
|
||||
1
modules/enabled/owncloud
Symbolic link
1
modules/enabled/owncloud
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/owncloud/
|
||||
1
modules/enabled/packages
Symbolic link
1
modules/enabled/packages
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/packages/
|
||||
1
modules/enabled/pagekite
Symbolic link
1
modules/enabled/pagekite
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/pagekite/
|
||||
1
modules/enabled/system
Symbolic link
1
modules/enabled/system
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/system/
|
||||
1
modules/enabled/tor
Symbolic link
1
modules/enabled/tor
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/tor/
|
||||
1
modules/enabled/users
Symbolic link
1
modules/enabled/users
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/users/
|
||||
1
modules/enabled/xmpp
Symbolic link
1
modules/enabled/xmpp
Symbolic link
@ -0,0 +1 @@
|
||||
../installed/xmpp/
|
||||
@ -1 +0,0 @@
|
||||
installed/expert_mode/expert_mode.py
|
||||
@ -1 +0,0 @@
|
||||
installed/firewall/firewall.py
|
||||
@ -1 +0,0 @@
|
||||
installed/first_boot/first_boot.py
|
||||
@ -1 +0,0 @@
|
||||
installed/help/help.py
|
||||
0
modules/installed/__init__.py
Normal file
0
modules/installed/__init__.py
Normal file
25
modules/installed/apps/__init__.py
Normal file
25
modules/installed/apps/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module for apps section page
|
||||
"""
|
||||
|
||||
from . import apps
|
||||
|
||||
|
||||
__all__ = ['apps']
|
||||
@ -1,6 +1,5 @@
|
||||
import cherrypy
|
||||
from gettext import gettext as _
|
||||
from modules.auth import require
|
||||
from plugin_mount import PagePlugin
|
||||
import cfg
|
||||
import util
|
||||
|
||||
25
modules/installed/config/__init__.py
Normal file
25
modules/installed/config/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module for basic system configuration
|
||||
"""
|
||||
|
||||
from . import config
|
||||
|
||||
|
||||
__all__ = ['config']
|
||||
@ -28,7 +28,7 @@ import socket
|
||||
|
||||
import actions
|
||||
import cfg
|
||||
from modules.auth import require
|
||||
from ..lib.auth import require
|
||||
from plugin_mount import PagePlugin
|
||||
import util
|
||||
|
||||
|
||||
25
modules/installed/diagnostics/__init__.py
Normal file
25
modules/installed/diagnostics/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module to system diagnostics
|
||||
"""
|
||||
|
||||
from . import diagnostics
|
||||
|
||||
|
||||
__all__ = ['diagnostics']
|
||||
@ -21,7 +21,7 @@ Plinth module for running diagnostics
|
||||
|
||||
import cherrypy
|
||||
from gettext import gettext as _
|
||||
from auth import require
|
||||
from ..lib.auth import require
|
||||
from plugin_mount import PagePlugin
|
||||
import actions
|
||||
import cfg
|
||||
|
||||
25
modules/installed/expert_mode/__init__.py
Normal file
25
modules/installed/expert_mode/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module for expert mode configuration
|
||||
"""
|
||||
|
||||
from . import expert_mode
|
||||
|
||||
|
||||
__all__ = ['expert_mode']
|
||||
@ -1,7 +1,7 @@
|
||||
import cherrypy
|
||||
from django import forms
|
||||
from gettext import gettext as _
|
||||
from modules.auth import require
|
||||
from ..lib.auth import require
|
||||
from plugin_mount import PagePlugin
|
||||
import cfg
|
||||
import util
|
||||
|
||||
25
modules/installed/firewall/__init__.py
Normal file
25
modules/installed/firewall/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module to configure a firewall
|
||||
"""
|
||||
|
||||
from . import firewall
|
||||
|
||||
|
||||
__all__ = ['firewall']
|
||||
@ -24,7 +24,7 @@ from gettext import gettext as _
|
||||
|
||||
import actions
|
||||
import cfg
|
||||
from modules.auth import require
|
||||
from ..lib.auth import require
|
||||
from plugin_mount import PagePlugin
|
||||
import service as service_module
|
||||
import util
|
||||
|
||||
25
modules/installed/first_boot/__init__.py
Normal file
25
modules/installed/first_boot/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module for first boot wizard
|
||||
"""
|
||||
|
||||
from . import first_boot
|
||||
|
||||
|
||||
__all__ = ['first_boot']
|
||||
@ -23,10 +23,10 @@ from django import forms
|
||||
from django.core import validators
|
||||
from gettext import gettext as _
|
||||
from plugin_mount import PagePlugin
|
||||
from modules.auth import add_user
|
||||
from ..lib.auth import add_user
|
||||
from ..config import config
|
||||
from withsqlite.withsqlite import sqlite_db
|
||||
import cfg
|
||||
import config
|
||||
import util
|
||||
|
||||
|
||||
|
||||
25
modules/installed/help/__init__.py
Normal file
25
modules/installed/help/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module for help pages
|
||||
"""
|
||||
|
||||
from . import help # pylint: disable-msg=W0622
|
||||
|
||||
|
||||
__all__ = ['help']
|
||||
29
modules/installed/lib/__init__.py
Normal file
29
modules/installed/lib/__init__.py
Normal file
@ -0,0 +1,29 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth library modules
|
||||
"""
|
||||
|
||||
from . import auth
|
||||
from . import auth_page
|
||||
from . import user_store
|
||||
|
||||
|
||||
__all__ = ['auth',
|
||||
'auth_page',
|
||||
'user_store']
|
||||
25
modules/installed/owncloud/__init__.py
Normal file
25
modules/installed/owncloud/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module to configure ownCloud
|
||||
"""
|
||||
|
||||
from . import owncloud
|
||||
|
||||
|
||||
__all__ = ['owncloud']
|
||||
@ -1,7 +1,7 @@
|
||||
import cherrypy
|
||||
from django import forms
|
||||
from gettext import gettext as _
|
||||
from modules.auth import require
|
||||
from ..lib.auth import require
|
||||
from plugin_mount import PagePlugin
|
||||
import actions
|
||||
import cfg
|
||||
|
||||
25
modules/installed/packages/__init__.py
Normal file
25
modules/installed/packages/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module to manage packages
|
||||
"""
|
||||
|
||||
from . import packages
|
||||
|
||||
|
||||
__all__ = ['packages']
|
||||
@ -1,7 +1,7 @@
|
||||
import cherrypy
|
||||
from django import forms
|
||||
from gettext import gettext as _
|
||||
from auth import require
|
||||
from ..lib.auth import require
|
||||
from plugin_mount import PagePlugin
|
||||
import actions
|
||||
import cfg
|
||||
|
||||
25
modules/installed/pagekite/__init__.py
Normal file
25
modules/installed/pagekite/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module to configure PageKite
|
||||
"""
|
||||
|
||||
from . import pagekite
|
||||
|
||||
|
||||
__all__ = ['pagekite']
|
||||
@ -26,7 +26,7 @@ from gettext import gettext as _
|
||||
|
||||
import actions
|
||||
import cfg
|
||||
from modules.auth import require
|
||||
from ..lib.auth import require
|
||||
from plugin_mount import PagePlugin
|
||||
import util
|
||||
|
||||
|
||||
25
modules/installed/santiago/__init__.py
Normal file
25
modules/installed/santiago/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module to configure santiago port
|
||||
"""
|
||||
|
||||
from . import santiago
|
||||
|
||||
|
||||
__all__ = ['santiago']
|
||||
25
modules/installed/system/__init__.py
Normal file
25
modules/installed/system/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module for system section page
|
||||
"""
|
||||
|
||||
from . import system
|
||||
|
||||
|
||||
__all__ = ['system']
|
||||
25
modules/installed/tor/__init__.py
Normal file
25
modules/installed/tor/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module to configure Tor
|
||||
"""
|
||||
|
||||
from . import tor
|
||||
|
||||
|
||||
__all__ = ['tor']
|
||||
@ -22,7 +22,7 @@ Plinth module for configuring Tor
|
||||
import cherrypy
|
||||
from gettext import gettext as _
|
||||
from plugin_mount import PagePlugin
|
||||
from modules.auth import require
|
||||
from ..lib.auth import require
|
||||
import actions
|
||||
import cfg
|
||||
import util
|
||||
|
||||
25
modules/installed/users/__init__.py
Normal file
25
modules/installed/users/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module to manage users
|
||||
"""
|
||||
|
||||
from . import users
|
||||
|
||||
|
||||
__all__ = ['users']
|
||||
@ -2,8 +2,7 @@ import cherrypy
|
||||
from django import forms
|
||||
from django.core import validators
|
||||
from gettext import gettext as _
|
||||
import auth
|
||||
from auth import require
|
||||
from ..lib.auth import require, add_user
|
||||
from plugin_mount import PagePlugin
|
||||
import cfg
|
||||
from model import User
|
||||
@ -86,8 +85,8 @@ class UserAdd(PagePlugin):
|
||||
username=data['username'])))
|
||||
return
|
||||
|
||||
auth.add_user(data['username'], data['password'], data['full_name'],
|
||||
data['email'], False)
|
||||
add_user(data['username'], data['password'], data['full_name'],
|
||||
data['email'], False)
|
||||
messages.append(
|
||||
('success', _('User "{username}" added').format(
|
||||
username=data['username'])))
|
||||
|
||||
25
modules/installed/xmpp/__init__.py
Normal file
25
modules/installed/xmpp/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Plinth module to configure XMPP server
|
||||
"""
|
||||
|
||||
from . import xmpp
|
||||
|
||||
|
||||
__all__ = ['xmpp']
|
||||
@ -1,7 +1,7 @@
|
||||
import cherrypy
|
||||
from django import forms
|
||||
from gettext import gettext as _
|
||||
from modules.auth import require
|
||||
from ..lib.auth import require
|
||||
from plugin_mount import PagePlugin
|
||||
import cfg
|
||||
import actions
|
||||
|
||||
@ -1 +0,0 @@
|
||||
installed/owncloud/owncloud.py
|
||||
@ -1 +0,0 @@
|
||||
installed/packages/packages.py
|
||||
@ -1 +0,0 @@
|
||||
installed/pagekite/pagekite.py
|
||||
@ -1 +0,0 @@
|
||||
installed/system/system.py
|
||||
@ -1 +0,0 @@
|
||||
installed/tor/tor.py
|
||||
@ -1 +0,0 @@
|
||||
installed/lib/user_store.py
|
||||
@ -1 +0,0 @@
|
||||
installed/users/users.py
|
||||
@ -1 +0,0 @@
|
||||
installed/xmpp/xmpp.py
|
||||
39
plinth.py
39
plinth.py
@ -4,8 +4,10 @@ import os, stat, sys, argparse
|
||||
from gettext import gettext as _
|
||||
import cfg
|
||||
import django.conf
|
||||
import importlib
|
||||
if not os.path.join(cfg.file_root, "vendor") in sys.path:
|
||||
sys.path.append(os.path.join(cfg.file_root, "vendor"))
|
||||
import re
|
||||
|
||||
import cherrypy
|
||||
from cherrypy import _cpserver
|
||||
@ -74,20 +76,21 @@ class Root(plugin_mount.PagePlugin):
|
||||
else:
|
||||
raise cherrypy.InternalRedirect('help/about')
|
||||
|
||||
|
||||
def load_modules():
|
||||
"""Import all the symlinked .py files in the modules directory and
|
||||
all the .py files in directories linked in the modules directory
|
||||
(but don't dive deeper than that). Also, ignore the installed
|
||||
directory."""
|
||||
for name in os.listdir("modules"):
|
||||
if name.endswith(".py") and not name.startswith('.'):
|
||||
cfg.log.info("importing modules/%s" % name)
|
||||
try:
|
||||
__import__("modules.%s" % (name[:-3]))
|
||||
except ImportError, e:
|
||||
cfg.log.error(_("Couldn't import modules/%s: %s") % (name, e))
|
||||
else:
|
||||
cfg.log("skipping %s" % name)
|
||||
"""
|
||||
Read names of enabled modules in modules/enabled directory and
|
||||
import them from modules/installed directory.
|
||||
"""
|
||||
for name in os.listdir('modules/enabled'):
|
||||
cfg.log.info('Importing modules/installed/%s' % name)
|
||||
try:
|
||||
importlib.import_module(
|
||||
'modules.installed.{module}'.format(module=name))
|
||||
except ImportError as exception:
|
||||
cfg.log.error(
|
||||
'Could not import modules/installed/{module}: {exception}'
|
||||
.format(module=name, exception=exception))
|
||||
|
||||
|
||||
def get_template_directories():
|
||||
@ -96,13 +99,9 @@ def get_template_directories():
|
||||
core_directory = os.path.join(directory, 'templates')
|
||||
|
||||
directories = set((core_directory,))
|
||||
for name in os.listdir('modules'):
|
||||
if not name.endswith(".py") or name.startswith('.'):
|
||||
continue
|
||||
|
||||
real_name = os.path.realpath(os.path.join('modules', name))
|
||||
directory = os.path.dirname(real_name)
|
||||
directories.add(os.path.join(directory, 'templates'))
|
||||
for name in os.listdir('modules/enabled'):
|
||||
directories.add(os.path.join('modules', 'installed', name,
|
||||
'templates'))
|
||||
|
||||
cfg.log.info('Template directories - %s' % directories)
|
||||
|
||||
|
||||
@ -1,7 +1,4 @@
|
||||
import cherrypy
|
||||
from modules.auth import require
|
||||
import cfg
|
||||
import util
|
||||
|
||||
|
||||
class PluginMount(type):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user