mldonkey: Update description and minor updates

- Update description to simply and talk about multiple protocols supported.

- Don't diagnose on IPv6 as mldonkey does not listen there.

- Run yapf and isort.

- Minor styling fixes.

- Update functional tests to check for service running.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Sunil Mohan Adapa committed 2019-01-25 14:39:31 -08:00
1 parent 548c6b98f3
commit 260dcd4d32
6 files changed
+35 -28

No files matched your search

+19 -15
View File
@@ -20,28 +20,31 @@ FreedomBox app for mldonkey.
from django.utils.translation import ugettext_lazy as _
from plinth import service as service_module
from plinth import action_utils, actions, cfg, frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.modules.users import register_group
from plinth.utils import format_lazy
from .manifest import clients
version = 1
service = None
managed_services = ['mldonkey-server']
managed_packages = ['mldonkey-server']
name = _('MLDonkey')
short_description = _('Door to the eDonkey network')
short_description = _('Peer-to-peer File Sharing')
description = [
_('MLDonkey is a door to the eDonkey network, a decentralized network '
'used to exchange big files on the Internet.'),
_('MLDonkey is a peer-to-peer file sharing application used to exchange '
'large files. It can participate in multiple peer-to-peer networks '
'including eDonkey, Kademlia, Overnet, BitTorrent and DirectConnect.'),
format_lazy(
_('On {box_name}, downloaded files can be found in /var/lib/mldonkey/ '
'directory.'), box_name=cfg.box_name)
]
clients = clients
@@ -50,13 +53,15 @@ reserved_usernames = ['mldonkey']
group = ('ed2k', _('Download files using eDonkey applications'))
service = None
manual_page = 'MLDonkey'
def init():
"""Intialize the MLDonkey module."""
"""Initialize the MLDonkey module."""
menu = main_menu.get('apps')
menu.add_urlname(name, 'mldonkey', 'mldonkey:index',
short_description)
menu.add_urlname(name, 'mldonkey', 'mldonkey:index', short_description)
register_group(group)
global service
@@ -90,9 +95,9 @@ def setup(helper, old_version=None):
def add_shortcut():
"""Helper method to add a shortcut to the frontpage."""
frontpage.add_shortcut('mldonkey', name, short_description=short_description,
url='/mldonkey', login_required=True,
allowed_groups=[group[0]])
frontpage.add_shortcut(
'mldonkey', name, short_description=short_description,
url='/mldonkey/', login_required=True, allowed_groups=[group[0]])
def is_running():
@@ -102,8 +107,8 @@ def is_running():
def is_enabled():
"""Return whether the module is enabled."""
return (action_utils.service_is_enabled('mldonkey-server') and
action_utils.webserver_is_enabled('mldonkey-freedombox'))
return (action_utils.service_is_enabled('mldonkey-server')
and action_utils.webserver_is_enabled('mldonkey-freedombox'))
def enable():
@@ -123,7 +128,6 @@ def diagnose():
results = []
results.append(action_utils.diagnose_port_listening(4080, 'tcp4'))
results.append(action_utils.diagnose_port_listening(4080, 'tcp6'))
results.extend(
action_utils.diagnose_url_on_all('https://{host}/mldonkey/',
check_certificate=False))
+3
View File
@@ -14,6 +14,9 @@
# 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/>.
#
"""
Application manifest for mldonkey.
"""
from django.utils.translation import ugettext_lazy as _
+7 -8
View File
@@ -20,16 +20,15 @@ URLs for the mldonkey module.
from django.conf.urls import url
from plinth.views import ServiceView
from plinth.modules import mldonkey
from plinth.views import ServiceView
urlpatterns = [
url(r'^apps/mldonkey/$',
ServiceView.as_view(
service_id=mldonkey.managed_services[0],
diagnostics_module_name='mldonkey',
description=mldonkey.description,
clients=mldonkey.clients,
show_status_block=True),
url(
r'^apps/mldonkey/$',
ServiceView.as_view(service_id=mldonkey.managed_services[0],
diagnostics_module_name='mldonkey',
description=mldonkey.description,
clients=mldonkey.clients, show_status_block=True),
name='index'),
]