Skip to content

Commit edfe44b

Browse files
committed
Drop support for Python 2. Remove six dependency.
1 parent 0e9a102 commit edfe44b

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ supposed to reach public trackers.
1010

1111
Besides manually creating the default tracker list, you can also load it (periodically) from a URL.
1212

13-
This plugin is compatible with Deluge 1.3 and 2.0, Python2 2.7 and Python3 3.5+.
13+
This plugin is compatible with Deluge 2.0 and Python 3.6+.
1414

1515
## Installation
1616

@@ -22,8 +22,6 @@ This plugin is compatible with Deluge 1.3 and 2.0, Python2 2.7 and Python3 3.5+.
2222

2323
* you need to use the same version of Python as the one that Deluge is running under.
2424

25-
* if you're using it with Deluge-1.3, you might not have [six](https://pypi.org/project/six/) installed. Install it.
26-
2725
* add it to Deluge from Preferences -> Plugins -> Install Plugin
2826

2927
## Troubleshooting

defaulttrackers/core.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
import ssl
4646
import time
4747
import traceback
48-
import six
48+
import urllib
4949

5050
from deluge.common import is_url
5151
from deluge.core.rpcserver import export
@@ -95,13 +95,13 @@ def update_trackerlist_from_url(self):
9595
'Accept-Language': 'en-US,en;q=0.8',
9696
}
9797

98-
req = six.moves.urllib.request.Request(self.config["dynamic_trackerlist_url"], headers=headers)
98+
req = urllib.request.Request(self.config["dynamic_trackerlist_url"], headers=headers)
9999
try:
100-
page = six.moves.urllib.request.urlopen(req, context=ssl._create_unverified_context()).read()
100+
page = urllib.request.urlopen(req, context=ssl._create_unverified_context()).read()
101101
except:
102102
# maybe an older Python version without a "context" argument
103-
page = six.moves.urllib.request.urlopen(req).read()
104-
new_trackers = [six.ensure_str(url) for url in re.findall(b'\w+://[\w\-.:/]+', page) if is_url(six.ensure_text(url))]
103+
page = urllib.request.urlopen(req).read()
104+
new_trackers = [url for url in re.findall(b'\w+://[\w\-.:/]+', page) if is_url(url)]
105105
if new_trackers:
106106
# replace all existing trackers
107107
self.config["trackers"] = []

setup.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
__plugin_name__ = "DefaultTrackers"
4646
__author__ = u"Ștefan Talpalaru"
4747
__author_email__ = "[email protected]"
48-
__version__ = "0.2"
48+
__version__ = "0.3"
4949
__url__ = "https://github.com/stefantalpalaru/deluge-default-trackers"
5050
__license__ = "GPLv3"
5151
__description__ = "Add a list of default trackers to all the public torrents"
@@ -71,10 +71,8 @@
7171
long_description=__long_description__ if __long_description__ else __description__,
7272

7373
packages=[__plugin_name__.lower()],
74-
package_data = __pkg_data__,
75-
install_requires=[
76-
'six>=1.12',
77-
],
74+
package_data=__pkg_data__,
75+
install_requires=[],
7876

7977
entry_points="""
8078
[deluge.plugin.core]

0 commit comments

Comments
 (0)