summaryrefslogtreecommitdiffstats
path: root/deluge/plugins/WebUi/deluge_webui
diff options
context:
space:
mode:
Diffstat (limited to 'deluge/plugins/WebUi/deluge_webui')
-rw-r--r--deluge/plugins/WebUi/deluge_webui/__init__.py9
-rw-r--r--deluge/plugins/WebUi/deluge_webui/common.py3
-rw-r--r--deluge/plugins/WebUi/deluge_webui/core.py3
-rw-r--r--deluge/plugins/WebUi/deluge_webui/data/config.ui2
-rw-r--r--deluge/plugins/WebUi/deluge_webui/data/config.ui~126
-rw-r--r--deluge/plugins/WebUi/deluge_webui/gtkui.py3
-rw-r--r--deluge/plugins/WebUi/deluge_webui/tests/test_plugin_webui.py27
7 files changed, 16 insertions, 157 deletions
diff --git a/deluge/plugins/WebUi/deluge_webui/__init__.py b/deluge/plugins/WebUi/deluge_webui/__init__.py
index a3d2980..ba978b2 100644
--- a/deluge/plugins/WebUi/deluge_webui/__init__.py
+++ b/deluge/plugins/WebUi/deluge_webui/__init__.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
@@ -11,8 +10,6 @@
# See LICENSE for more details.
#
-from __future__ import unicode_literals
-
from deluge.plugins.init import PluginInitBase
@@ -21,7 +18,7 @@ class CorePlugin(PluginInitBase):
from .core import Core as _pluginCls
self._plugin_cls = _pluginCls
- super(CorePlugin, self).__init__(plugin_name)
+ super().__init__(plugin_name)
class GtkUIPlugin(PluginInitBase):
@@ -29,7 +26,7 @@ class GtkUIPlugin(PluginInitBase):
from .gtkui import GtkUI as _pluginCls
self._plugin_cls = _pluginCls
- super(GtkUIPlugin, self).__init__(plugin_name)
+ super().__init__(plugin_name)
class WebUIPlugin(PluginInitBase):
@@ -37,4 +34,4 @@ class WebUIPlugin(PluginInitBase):
from webui import WebUI as _pluginCls
self._plugin_cls = _pluginCls
- super(WebUIPlugin, self).__init__(plugin_name)
+ super().__init__(plugin_name)
diff --git a/deluge/plugins/WebUi/deluge_webui/common.py b/deluge/plugins/WebUi/deluge_webui/common.py
index 4c9db09..eb47f13 100644
--- a/deluge/plugins/WebUi/deluge_webui/common.py
+++ b/deluge/plugins/WebUi/deluge_webui/common.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
@@ -12,8 +11,6 @@
# See LICENSE for more details.
#
-from __future__ import unicode_literals
-
import os.path
from pkg_resources import resource_filename
diff --git a/deluge/plugins/WebUi/deluge_webui/core.py b/deluge/plugins/WebUi/deluge_webui/core.py
index cc3330f..f18203e 100644
--- a/deluge/plugins/WebUi/deluge_webui/core.py
+++ b/deluge/plugins/WebUi/deluge_webui/core.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
@@ -11,8 +10,6 @@
# See LICENSE for more details.
#
-from __future__ import unicode_literals
-
import logging
from twisted.internet import defer
diff --git a/deluge/plugins/WebUi/deluge_webui/data/config.ui b/deluge/plugins/WebUi/deluge_webui/data/config.ui
index 18647a4..c58edd0 100644
--- a/deluge/plugins/WebUi/deluge_webui/data/config.ui
+++ b/deluge/plugins/WebUi/deluge_webui/data/config.ui
@@ -86,8 +86,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
<property name="adjustment">adjustment1</property>
<property name="numeric">True</property>
</object>
diff --git a/deluge/plugins/WebUi/deluge_webui/data/config.ui~ b/deluge/plugins/WebUi/deluge_webui/data/config.ui~
deleted file mode 100644
index 101f60d..0000000
--- a/deluge/plugins/WebUi/deluge_webui/data/config.ui~
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
- <requires lib="gtk+" version="3.0"/>
- <!-- interface-naming-policy toplevel-contextual -->
- <object class="GtkAdjustment" id="adjustment1">
- <property name="upper">99999</property>
- <property name="value">8112</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
- <object class="GtkWindow" id="window1">
- <property name="can_focus">False</property>
- <child>
- <object class="GtkVBox" id="prefs_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkFrame" id="settings_frame">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <object class="GtkAlignment" id="settings_alignment">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="top_padding">10</property>
- <property name="left_padding">12</property>
- <child>
- <object class="GtkVBox" id="settings_vbox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">5</property>
- <child>
- <object class="GtkCheckButton" id="enabled_checkbutton">
- <property name="label" translatable="yes">Enable web interface</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="ssl_checkbutton">
- <property name="label" translatable="yes">Enable SSL</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="port_hbox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">5</property>
- <child>
- <object class="GtkLabel" id="port_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Listening port:</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="port_spinbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">adjustment1</property>
- <property name="numeric">True</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="settings_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">&lt;b&gt;Settings&lt;/b&gt;</property>
- <property name="use_markup">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
-</interface>
diff --git a/deluge/plugins/WebUi/deluge_webui/gtkui.py b/deluge/plugins/WebUi/deluge_webui/gtkui.py
index ca3a16e..3d19417 100644
--- a/deluge/plugins/WebUi/deluge_webui/gtkui.py
+++ b/deluge/plugins/WebUi/deluge_webui/gtkui.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
@@ -11,8 +10,6 @@
# See LICENSE for more details.
#
-from __future__ import unicode_literals
-
import logging
from gi.repository import Gtk
diff --git a/deluge/plugins/WebUi/deluge_webui/tests/test_plugin_webui.py b/deluge/plugins/WebUi/deluge_webui/tests/test_plugin_webui.py
index 56e1cc0..1badedc 100644
--- a/deluge/plugins/WebUi/deluge_webui/tests/test_plugin_webui.py
+++ b/deluge/plugins/WebUi/deluge_webui/tests/test_plugin_webui.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 bendikro <bro.devel+deluge@gmail.com>
#
@@ -6,44 +5,44 @@
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
-
-from __future__ import unicode_literals
-
-from twisted.trial import unittest
+import pytest
+import pytest_twisted
import deluge.component as component
from deluge.core.core import Core
from deluge.core.rpcserver import RPCServer
from deluge.tests import common
-from deluge.tests.basetest import BaseTestCase
common.disable_new_release_check()
-class WebUIPluginTestCase(BaseTestCase):
- def set_up(self):
- common.set_tmp_config_dir()
+@pytest.mark.usefixtures('component')
+class TestWebUIPlugin:
+ @pytest_twisted.async_yield_fixture(autouse=True)
+ async def set_up(self, request):
+ self = request.instance
self.rpcserver = RPCServer(listen=False)
self.core = Core()
- return component.start()
+ await component.start()
+
+ yield
- def tear_down(self):
def on_shutdown(result):
del self.rpcserver
del self.core
- return component.shutdown().addCallback(on_shutdown)
+ await component.shutdown().addCallback(on_shutdown)
def test_enable_webui(self):
if 'WebUi' not in self.core.get_available_plugins():
- raise unittest.SkipTest('WebUi plugin not available for testing')
+ pytest.skip('WebUi plugin not available for testing')
d = self.core.enable_plugin('WebUi')
def result_cb(result):
if 'WebUi' not in self.core.get_enabled_plugins():
self.fail('Failed to enable WebUi plugin')
- self.assertTrue(result)
+ assert result
d.addBoth(result_cb)
return d