summaryrefslogtreecommitdiffstats
path: root/deluge/ui/console/cmdline/commands/add.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 15:05:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 16:15:47 +0000
commitb686174b07bd56af4e5ffaa23c24f27f417fc305 (patch)
tree1ce335620d99341d94e88c159c0b9b0f6f0de5a0 /deluge/ui/console/cmdline/commands/add.py
parentAdding debian version 2.0.3-4. (diff)
downloaddeluge-b686174b07bd56af4e5ffaa23c24f27f417fc305.tar.xz
deluge-b686174b07bd56af4e5ffaa23c24f27f417fc305.zip
Merging upstream version 2.1.1 (Closes: #1026291).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/ui/console/cmdline/commands/add.py')
-rw-r--r--deluge/ui/console/cmdline/commands/add.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/deluge/ui/console/cmdline/commands/add.py b/deluge/ui/console/cmdline/commands/add.py
index 34881d8..706ae16 100644
--- a/deluge/ui/console/cmdline/commands/add.py
+++ b/deluge/ui/console/cmdline/commands/add.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
@@ -8,10 +7,10 @@
# See LICENSE for more details.
#
-from __future__ import unicode_literals
-
import os
from base64 import b64encode
+from urllib.parse import urlparse
+from urllib.request import url2pathname
from twisted.internet import defer
@@ -21,14 +20,6 @@ from deluge.ui.client import client
from . import BaseCommand
-try:
- from urllib.parse import urlparse
- from urllib.request import url2pathname
-except ImportError:
- # PY2 fallback
- from urlparse import urlparse # pylint: disable=ungrouped-imports
- from urllib import url2pathname # pylint: disable=ungrouped-imports
-
class Command(BaseCommand):
"""Add torrents"""
@@ -81,7 +72,7 @@ class Command(BaseCommand):
continue
if deluge.common.is_url(torrent):
self.console.write(
- '{!info!}Attempting to add torrent from url: %s' % torrent
+ '{!info!}Attempting to add torrent from URL: %s' % torrent
)
deferreds.append(
client.core.add_torrent_url(torrent, t_options)
@@ -90,7 +81,7 @@ class Command(BaseCommand):
)
elif deluge.common.is_magnet(torrent):
self.console.write(
- '{!info!}Attempting to add torrent from magnet uri: %s' % torrent
+ '{!info!}Attempting to add torrent from magnet URI: %s' % torrent
)
deferreds.append(
client.core.add_torrent_magnet(torrent, t_options)