diff options
Diffstat (limited to 'deluge/plugins/Extractor')
9 files changed, 13 insertions, 154 deletions
diff --git a/deluge/plugins/Extractor/deluge_extractor/__init__.py b/deluge/plugins/Extractor/deluge_extractor/__init__.py index 6db72b6..87d1584 100644 --- a/deluge/plugins/Extractor/deluge_extractor/__init__.py +++ b/deluge/plugins/Extractor/deluge_extractor/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2009 Andrew Resch <andrewresch@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/Extractor/deluge_extractor/common.py b/deluge/plugins/Extractor/deluge_extractor/common.py index 4c9db09..eb47f13 100644 --- a/deluge/plugins/Extractor/deluge_extractor/common.py +++ b/deluge/plugins/Extractor/deluge_extractor/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/Extractor/deluge_extractor/core.py b/deluge/plugins/Extractor/deluge_extractor/core.py index 8fa5bd3..23b2a00 100644 --- a/deluge/plugins/Extractor/deluge_extractor/core.py +++ b/deluge/plugins/Extractor/deluge_extractor/core.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com> # @@ -11,8 +10,6 @@ # See LICENSE for more details. # -from __future__ import unicode_literals - import errno import logging import os @@ -37,14 +34,11 @@ if windows_check(): 'C:\\Program Files (x86)\\7-Zip\\7z.exe', ] - try: - import winreg - except ImportError: - import _winreg as winreg # For Python 2. + import winreg try: hkey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, 'Software\\7-Zip') - except WindowsError: + except OSError: pass else: win_7z_path = os.path.join(winreg.QueryValueEx(hkey, 'Path')[0], '7z.exe') diff --git a/deluge/plugins/Extractor/deluge_extractor/data/extractor.js b/deluge/plugins/Extractor/deluge_extractor/data/extractor.js index b11cb30..952b645 100644 --- a/deluge/plugins/Extractor/deluge_extractor/data/extractor.js +++ b/deluge/plugins/Extractor/deluge_extractor/data/extractor.js @@ -21,7 +21,7 @@ Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, { layout: 'fit', border: false, - initComponent: function() { + initComponent: function () { Deluge.ux.preferences.ExtractorPage.superclass.initComponent.call(this); this.form = this.add({ @@ -59,7 +59,7 @@ Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, { this.on('show', this.updateConfig, this); }, - onApply: function() { + onApply: function () { // build settings object var config = {}; @@ -69,13 +69,13 @@ Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, { deluge.client.extractor.set_config(config); }, - onOk: function() { + onOk: function () { this.onApply(); }, - updateConfig: function() { + updateConfig: function () { deluge.client.extractor.get_config({ - success: function(config) { + success: function (config) { this.extract_path.setValue(config['extract_path']); this.use_name_folder.setValue(config['use_name_folder']); }, @@ -87,11 +87,11 @@ Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, { Deluge.plugins.ExtractorPlugin = Ext.extend(Deluge.Plugin, { name: 'Extractor', - onDisable: function() { + onDisable: function () { deluge.preferences.removePage(this.prefsPage); }, - onEnable: function() { + onEnable: function () { this.prefsPage = deluge.preferences.addPage( new Deluge.ux.preferences.ExtractorPage() ); diff --git a/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui b/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui index 6f34b44..9e8070b 100644 --- a/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui +++ b/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui @@ -62,8 +62,6 @@ <child> <object class="GtkEntry" id="entry_path"> <property name="can_focus">True</property> - <property name="primary_icon_activatable">False</property> - <property name="secondary_icon_activatable">False</property> </object> <packing> <property name="expand">True</property> diff --git a/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui~ b/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui~ deleted file mode 100644 index 040e3d0..0000000 --- a/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui~ +++ /dev/null @@ -1,120 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<interface> - <requires lib="gtk+" version="3.0"/> - <!-- interface-naming-policy toplevel-contextual --> - <object class="GtkWindow" id="window1"> - <property name="can_focus">False</property> - <child> - <object class="GtkVBox" id="extractor_prefs_box"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">5</property> - <child> - <object class="GtkFrame" id="frame1"> - <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="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="border_width">5</property> - <property name="spacing">5</property> - <child> - <object class="GtkHBox" id="hbox1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">5</property> - <child> - <object class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Extract to:</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="hbox2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkFileChooserButton" id="folderchooser_path"> - <property name="can_focus">False</property> - <property name="action">select-folder</property> - <property name="title" translatable="yes">Select A Folder</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="entry_path"> - <property name="can_focus">True</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> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </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">0</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="chk_use_name"> - <property name="label" translatable="yes">Create torrent name sub-folder</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">This option will create a sub-folder using the torrent's name within the selected extract folder and put the extracted files there.</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> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes"><b>General</b></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/Extractor/deluge_extractor/gtkui.py b/deluge/plugins/Extractor/deluge_extractor/gtkui.py index 113b33f..a754a5f 100644 --- a/deluge/plugins/Extractor/deluge_extractor/gtkui.py +++ b/deluge/plugins/Extractor/deluge_extractor/gtkui.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com> # @@ -11,13 +10,11 @@ # See LICENSE for more details. # -from __future__ import unicode_literals - import logging import gi # isort:skip (Required before Gtk import). -gi.require_version('Gtk', '3.0') # NOQA: E402 +gi.require_version('Gtk', '3.0') # isort:imports-thirdparty from gi.repository import Gtk diff --git a/deluge/plugins/Extractor/deluge_extractor/webui.py b/deluge/plugins/Extractor/deluge_extractor/webui.py index feb7b4a..715733c 100644 --- a/deluge/plugins/Extractor/deluge_extractor/webui.py +++ b/deluge/plugins/Extractor/deluge_extractor/webui.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com> # @@ -11,8 +10,6 @@ # See LICENSE for more details. # -from __future__ import unicode_literals - import logging from deluge.plugins.pluginbase import WebPluginBase diff --git a/deluge/plugins/Extractor/setup.py b/deluge/plugins/Extractor/setup.py index 25ab153..09385c6 100644 --- a/deluge/plugins/Extractor/setup.py +++ b/deluge/plugins/Extractor/setup.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com> # |