diff options
author | Calum Lind <calumlind+deluge@gmail.com> | 2016-11-03 21:26:46 +0000 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2016-11-03 21:45:45 +0000 |
commit | 3a2ff0c188b0e8da893b733cccb1e164b54f2471 (patch) | |
tree | 2997d64b20e6e280016792cd4a04bfd20ff89992 /deluge/ui/console/cmdline/commands/rm.py | |
parent | d4a8a38586251575a17c50735a10ddfba30fdc31 (diff) | |
download | deluge-3a2ff0c188b0e8da893b733cccb1e164b54f2471.tar.gz deluge-3a2ff0c188b0e8da893b733cccb1e164b54f2471.tar.bz2 deluge-3a2ff0c188b0e8da893b733cccb1e164b54f2471.zip |
[Lint] Convert all python double quotes to single quotes
* A rather disruptive change but for a few reasons such as easier to read,
easier type, keep consistent and javascript code uses single quotes.
* There are a few exceptions for the automated process:
* Any double quotes in comments
* Triple double quotes for docstrings
* Strings containing single quotes are left e.g. "they're"
* To deal with merge conflicts from feature branches it is best to follow
these steps for each commit:
* Create a patch: `git format-patch -1 <sha1>`
* Edit the patch and replace double quotes with single except those in
comments or strings containing an unescaped apostrophe.
* Check the patch `git apply --check <patchfile>` and fix any remaining
issues if it outputs an error.
* Apply the patch `git am < <patchfile>`
Diffstat (limited to 'deluge/ui/console/cmdline/commands/rm.py')
-rw-r--r-- | deluge/ui/console/cmdline/commands/rm.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/deluge/ui/console/cmdline/commands/rm.py b/deluge/ui/console/cmdline/commands/rm.py index 62acb51bf..0cbda3b19 100644 --- a/deluge/ui/console/cmdline/commands/rm.py +++ b/deluge/ui/console/cmdline/commands/rm.py @@ -20,38 +20,38 @@ log = logging.getLogger(__name__) class Command(BaseCommand): """Remove a torrent""" - aliases = ["del"] + aliases = ['del'] def add_arguments(self, parser): - parser.add_argument("--remove_data", action="store_true", default=False, help=_("remove the torrent's data")) - parser.add_argument("-c", "--confirm", action="store_true", default=False, - help=_("List the matching torrents without removing.")) - parser.add_argument("torrent_ids", metavar="<torrent-id>", nargs="+", help=_("One or more torrent ids")) + parser.add_argument('--remove_data', action='store_true', default=False, help=_("remove the torrent's data")) + parser.add_argument('-c', '--confirm', action='store_true', default=False, + help=_('List the matching torrents without removing.')) + parser.add_argument('torrent_ids', metavar='<torrent-id>', nargs='+', help=_('One or more torrent ids')) def handle(self, options): - self.console = component.get("ConsoleUI") + self.console = component.get('ConsoleUI') torrent_ids = self.console.match_torrents(options.torrent_ids) if not options.confirm: - self.console.write("{!info!}%d %s %s{!info!}" % (len(torrent_ids), - _n("torrent", "torrents", len(torrent_ids)), - _n("match", "matches", len(torrent_ids)))) + self.console.write('{!info!}%d %s %s{!info!}' % (len(torrent_ids), + _n('torrent', 'torrents', len(torrent_ids)), + _n('match', 'matches', len(torrent_ids)))) for t_id in torrent_ids: name = self.console.get_torrent_name(t_id) - self.console.write("* %-50s (%s)" % (name, t_id)) - self.console.write(_("Confirm with -c to remove the listed torrents (Count: %d)") % len(torrent_ids)) + self.console.write('* %-50s (%s)' % (name, t_id)) + self.console.write(_('Confirm with -c to remove the listed torrents (Count: %d)') % len(torrent_ids)) return def on_removed_finished(errors): if errors: - self.console.write("Error(s) occured when trying to delete torrent(s).") + self.console.write('Error(s) occured when trying to delete torrent(s).') for t_id, e_msg in errors: - self.console.write("Error removing torrent %s : %s" % (t_id, e_msg)) + self.console.write('Error removing torrent %s : %s' % (t_id, e_msg)) - log.info("Removing %d torrents", len(torrent_ids)) + log.info('Removing %d torrents', len(torrent_ids)) d = client.core.remove_torrents(torrent_ids, options.remove_data) d.addCallback(on_removed_finished) def complete(self, line): # We use the ConsoleUI torrent tab complete method - return component.get("ConsoleUI").tab_complete_torrent(line) + return component.get('ConsoleUI').tab_complete_torrent(line) |