Skip to content
Snippets Groups Projects
Verified Commit 0caf7369 authored by Jan Beinke's avatar Jan Beinke
Browse files

Update python version

parent 8c4634c5
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -4,17 +4,15 @@
before_script:
- python -V # Print out python version for debugging
script:
- python2 setup.py bdist_egg
- python setup.py bdist_egg
after_script:
- cp dist/* ./
artifacts:
paths:
- IRBLAN-*-py*.egg
build-2.6-2.7:
image: python:2.7-alpine
build-3.10:
image: python:3.10-alpine
<<: *build
after_script:
- for i in dist/*; do cp "$i" "${i/2.7/2.6}" ;done
- cp dist/* ./
\ No newline at end of file
......@@ -41,18 +41,18 @@ from deluge.plugins.init import PluginInitBase
class CorePlugin(PluginInitBase):
def __init__(self, plugin_name):
from core import Core as _plugin_cls
from .core import Core as _plugin_cls
self._plugin_cls = _plugin_cls
super(CorePlugin, self).__init__(plugin_name)
class GtkUIPlugin(PluginInitBase):
def __init__(self, plugin_name):
from gtkui import GtkUI as _plugin_cls
from .gtkui import GtkUI as _plugin_cls
self._plugin_cls = _plugin_cls
super(GtkUIPlugin, self).__init__(plugin_name)
class WebUIPlugin(PluginInitBase):
def __init__(self, plugin_name):
from webui import WebUI as _plugin_cls
from .webui import WebUI as _plugin_cls
self._plugin_cls = _plugin_cls
super(WebUIPlugin, self).__init__(plugin_name)
......@@ -37,19 +37,27 @@
# statement from all source files in the program, then also delete it here.
#
import logging
import gi # isort:skip (Required before Gtk import).
gi.require_version('Gtk', '3.0')
import gtk
from gobject import TYPE_UINT64
from deluge.log import LOG as log
from deluge.ui.client import client
from deluge.plugins.pluginbase import GtkPluginBase
from deluge.plugins.pluginbase import Gtk3PluginBase
from deluge.configmanager import ConfigManager
import deluge.component as component
from deluge import component
import deluge.common
import deluge.ui.gtkui.createtorrentdialog as createtorrentdialog
from common import get_resource
log = logging.getLogger(__name__)
class CTD(createtorrentdialog.CreateTorrentDialog, object):
def find_obj(self, name, search_obj=None):
......@@ -87,29 +95,32 @@ class CTD(createtorrentdialog.CreateTorrentDialog, object):
self.dialog.set_sensitive(True)
class GtkUI(GtkPluginBase):
class GtkUI(Gtk3PluginBase):
def enable(self):
log.debug('IRBLAN GtkUI enable..')
self.plugin = component.get('PluginManager')
self.glade = gtk.glade.XML(get_resource("config.glade"))
component.get("Preferences").add_page(
"IRBLAN", self.glade.get_widget("prefs_box"))
component.get("PluginManager").register_hook(
"on_apply_prefs", self.on_apply_prefs)
component.get("PluginManager").register_hook(
"on_show_prefs", self.on_show_prefs)
self.plugin.add_preferences_page(_("IRBLAN"), self.glade.get_widget("prefs_box"))
self.plugin.register_hook("on_apply_prefs", self.on_apply_prefs)
self.plugin.register_hook("on_show_prefs", self.on_show_prefs)
self.old_ctd = createtorrentdialog.CreateTorrentDialog
createtorrentdialog.CreateTorrentDialog = CTD
def disable(self):
log.debug('IRBLAN GtkUI disable..')
createtorrentdialog.CreateTorrentDialog = self.old_ctd
component.get("Preferences").remove_page("IRBLAN")
self.plugin.remove_preferences_page(_("IRBLAN"))
component.get("PluginManager").deregister_hook(
"on_apply_prefs", self.on_apply_prefs)
component.get("PluginManager").deregister_hook(
"on_show_prefs", self.on_show_prefs)
del self.glade
def on_apply_prefs(self):
log.debug("applying prefs for IRBLAN")
config = {
......
......@@ -42,7 +42,7 @@ from setuptools import setup
__plugin_name__ = "IRBLAN"
__author__ = "Anon"
__author_email__ = "anon@example.com"
__version__ = "0.3"
__version__ = "0.4"
__url__ = ""
__license__ = "GPLv3"
__description__ = ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment