Changeset af6b27


Ignore:
Timestamp:
11/04/2016 12:10:23 AM (9 years ago)
Author:
Calum Lind <calumlind+deluge@gmail.com>
Branches:
2.0.x, develop, master
Children:
e37c81
Parents:
3a2ff0
git-author:
Calum Lind <calumlind+deluge@gmail.com> (11/03/2016 10:37:00 PM)
git-committer:
Calum Lind <calumlind+deluge@gmail.com> (11/04/2016 12:10:23 AM)
Message:

[Lint] Add flake8-quotes to tox and fix bad quotes

Files:
21 edited

Legend:

Unmodified
Added
Removed
  • deluge/core/core.py

    r3a2ff0 raf6b27  
    717717        """
    718718        if not self.authmanager.has_account(username):
    719             raise DelugeError("Username \"%s\" is not known." % username)
     719            raise DelugeError('Username "%s" is not known.' % username)
    720720        if isinstance(torrent_ids, basestring):
    721721            torrent_ids = [torrent_ids]
  • deluge/core/rpcserver.py

    r3a2ff0 raf6b27  
    519519        """
    520520        if not self.is_session_valid(session_id):
    521             log.debug("Session ID %s is not valid. Not sending event \"%s\".", session_id, event.name)
     521            log.debug('Session ID %s is not valid. Not sending event "%s".', session_id, event.name)
    522522            return
    523523        if session_id not in self.factory.interested_events:
    524             log.debug("Session ID %s is not interested in any events. Not sending event \"%s\".",
     524            log.debug('Session ID %s is not interested in any events. Not sending event "%s".',
    525525                      session_id, event.name)
    526526            return
    527527        if event.name not in self.factory.interested_events[session_id]:
    528             log.debug("Session ID %s is not interested in event \"%s\". Not sending it.", session_id, event.name)
    529             return
    530         log.debug("Sending event \"%s\" with args \"%s\" to session id \"%s\".",
     528            log.debug('Session ID %s is not interested in event "%s". Not sending it.', session_id, event.name)
     529            return
     530        log.debug('Sending event "%s" with args "%s" to session id "%s".',
    531531                  event.name, event.args, session_id)
    532532        self.factory.session_protocols[session_id].sendData((RPC_EVENT, event.name, event.args))
  • deluge/core/torrentmanager.py

    r3a2ff0 raf6b27  
    447447        if log.isEnabledFor(logging.INFO):
    448448            name_and_owner = torrent.get_status(['name', 'owner'])
    449             log.info("Torrent %s from user \"%s\" %s",
     449            log.info('Torrent %s from user "%s" %s',
    450450                     name_and_owner['name'],
    451451                     name_and_owner['owner'],
  • deluge/log.py

    r3a2ff0 raf6b27  
    223223                continue
    224224
    225             log.warn("Setting logger \"%s\" to logging level \"%s\"", name, level)
     225            log.warn('Setting logger "%s" to logging level "%s"', name, level)
    226226            set_logger_level(level, name)
    227227
  • deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py

    r3a2ff0 raf6b27  
    315315                    copy_torrent_path = watchdir['copy_torrent']
    316316                    copy_torrent_file = os.path.join(copy_torrent_path, filename)
    317                     log.debug("Moving added torrent file \"%s\" to \"%s\"",
     317                    log.debug('Moving added torrent file "%s" to "%s"',
    318318                              os.path.basename(filepath), copy_torrent_path)
    319319                    shutil.move(filepath, copy_torrent_file)
     
    325325        """Disables any watch folders with un-handled exceptions."""
    326326        self.disable_watchdir(watchdir_id)
    327         log.error("Disabling '%s', error during update: %s",
     327        log.error('Disabling "%s", error during update: %s',
    328328                  self.watchdirs[watchdir_id]['path'], failure)
    329329
     
    460460                try:
    461461                    os.remove(torrent_fname_path)
    462                     log.info("Removed torrent file \"%s\" from \"%s\"",
     462                    log.info('Removed torrent file "%s" from "%s"',
    463463                             torrent_fname, copy_torrent_path)
    464464                    break
    465465                except OSError as ex:
    466                     log.info("Failed to removed torrent file \"%s\" from "
    467                              "\"%s\": %s", torrent_fname, copy_torrent_path, ex)
     466                    log.info('Failed to removed torrent file "%s" from "%s": %s',
     467                             torrent_fname, copy_torrent_path, ex)
  • deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py

    r3a2ff0 raf6b27  
    342342
    343343        if options['copy_torrent_toggle'] and options['path'] == options['copy_torrent']:
    344             raise IncompatibleOption(_("\"Watch Folder\" directory and \"Copy of .torrent"
    345                                        " files to\" directory cannot be the same!"))
     344            raise IncompatibleOption(_('"Watch Folder" directory and "Copy of .torrent'
     345                                       ' files to" directory cannot be the same!'))
    346346        return options
    347347
  • deluge/plugins/Blocklist/deluge/plugins/blocklist/common.py

    r3a2ff0 raf6b27  
    101101            q1, q2, q3, q4 = [int(q) for q in ip.split('.')]
    102102        except ValueError:
    103             raise BadIP(_("The IP address \"%s\" is badly formed" % ip))
     103            raise BadIP(_('The IP address "%s" is badly formed' % ip))
    104104        if q1 < 0 or q2 < 0 or q3 < 0 or q4 < 0:
    105             raise BadIP(_("The IP address \"%s\" is badly formed" % ip))
     105            raise BadIP(_('The IP address "%s" is badly formed' % ip))
    106106        elif q1 > 255 or q2 > 255 or q3 > 255 or q4 > 255:
    107             raise BadIP(_("The IP address \"%s\" is badly formed" % ip))
     107            raise BadIP(_('The IP address "%s" is badly formed' % ip))
    108108        return cls(q1, q2, q3, q4)
    109109
  • deluge/plugins/Notifications/deluge/plugins/notifications/common.py

    r3a2ff0 raf6b27  
    100100    def _handled_eventtype(self, eventtype, handler):
    101101        if eventtype not in known_events:
    102             log.error("The event \"%s\" is not known", eventtype)
     102            log.error('The event "%s" is not known', eventtype)
    103103            return False
    104104        if known_events[eventtype].__module__.startswith('deluge.event'):
  • deluge/plugins/Notifications/deluge/plugins/notifications/core.py

    r3a2ff0 raf6b27  
    172172        torrent_status = torrent.get_status({})
    173173        # Email
    174         subject = _("Finished Torrent \"%(name)s\"") % torrent_status
     174        subject = _('Finished Torrent "%(name)s"') % torrent_status
    175175        message = _(
    176176            'This email is to inform you that Deluge has finished '
    177             "downloading \"%(name)s\", which includes %(num_files)i files."
     177            'downloading \"%(name)s\", which includes %(num_files)i files.'
    178178            '\nTo stop receiving these alerts, simply turn off email '
    179179            "notification in Deluge's preferences.\n\n"
  • deluge/plugins/Notifications/deluge/plugins/notifications/gtkui.py

    r3a2ff0 raf6b27  
    223223        title = _('Finished Torrent')
    224224        torrent_status['num_files'] = torrent_status['file_progress'].count(1.0)
    225         message = _("The torrent \"%(name)s\" including %(num_files)i file(s) "
     225        message = _('The torrent \"%(name)s\" including %(num_files)i file(s) '
    226226                    'has finished downloading.') % torrent_status
    227227        return title, message
     
    473473        custom_sounds = {}
    474474        for event_name, event_doc, filename, filepath in self.sounds_model:
    475             log.debug("Custom sound for event \"%s\": %s", event_name, filename)
     475            log.debug('Custom sound for event "%s": %s', event_name, filename)
    476476            if filepath == old_sound_file:
    477477                continue
  • deluge/ui/client.py

    r3a2ff0 raf6b27  
    194194
    195195    def startedConnecting(self, connector):  # NOQA
    196         log.debug("Connecting to daemon at \"%s:%s\"...",
     196        log.debug('Connecting to daemon at "%s:%s"...',
    197197                  connector.host, connector.port)
    198198
    199199    def clientConnectionFailed(self, connector, reason):  # NOQA
    200         log.debug("Connection to daemon at \"%s:%s\" failed: %s",
     200        log.debug('Connection to daemon at "%s:%s" failed: %s',
    201201                  connector.host, connector.port, reason.value)
    202202        self.daemon.connect_deferred.errback(reason)
    203203
    204204    def clientConnectionLost(self, connector, reason):  # NOQA
    205         log.debug("Connection lost to daemon at \"%s:%s\" reason: %s",
     205        log.debug('Connection lost to daemon at "%s:%s" reason: %s',
    206206                  connector.host, connector.port, reason.value)
    207207        self.daemon.host = None
  • deluge/ui/console/cmdline/commands/move.py

    r3a2ff0 raf6b27  
    4141
    4242        def on_move(res):
    43             msg = "Moved \"%s\" to %s" % (', '.join(names), options.path)
     43            msg = 'Moved "%s" to %s' % (', '.join(names), options.path)
    4444            self.console.write(msg)
    4545            log.info(msg)
  • deluge/ui/console/modes/torrentdetail.py

    r3a2ff0 raf6b27  
    455455        # Tracker
    456456        tracker_color = '{!green!}' if status['message'] == 'OK' else '{!red!}'
    457         s = "{!info!}%s: {!magenta!}%s{!input!} says \"%s%s{!input!}\"" % (
     457        s = '{!info!}%s: {!magenta!}%s{!input!} says "%s%s{!input!}"' % (
    458458            torrent_data_fields['tracker']['name'], status['tracker_host'], tracker_color, status['message'])
    459459        row = self.add_string(row, s)
  • deluge/ui/gtkui/aboutdialog.py

    r3a2ff0 raf6b27  
    169169            'Patryk13_03', 'Patryk Skorupa', 'PattogoTehen', 'Paul Lange',
    170170            'Pavcio', 'Paweł Wysocki', 'Pedro Brites Moita',
    171             'Pedro Clemente Pereira Neto', "Pekka \"PEXI\" Niemistö", 'Penegal',
     171            'Pedro Clemente Pereira Neto', 'Pekka \"PEXI\" Niemistö', 'Penegal',
    172172            'Penzo', 'perdido', 'Peter Kotrcka', 'Peter Skov',
    173173            'Peter Van den Bosch', 'Petter Eklund', 'Petter Viklund',
  • deluge/ui/gtkui/connectionmanager.py

    r3a2ff0 raf6b27  
    531531        if not self.builder.get_object('chk_autostart').get_active():
    532532            msg += '\n' + _('Auto-starting the daemon locally is not enabled. '
    533                             "See \"Options\" on the \"Connection Manager\".")
     533                            'See "Options" on the "Connection Manager".')
    534534        ErrorDialog(_('Failed To Connect'), msg).run()
    535535
  • deluge/ui/gtkui/listview.py

    r3a2ff0 raf6b27  
    666666            column = find_column(col_state.name)
    667667            if not column:
    668                 log.debug("Could not find column matching \"%s\" on state.", col_state.name)
     668                log.debug('Could not find column matching "%s" on state.', col_state.name)
    669669                # The cases where I've found that the column could not be found
    670670                # is when not using the english locale, ie, the default one, or
  • deluge/ui/gtkui/menubar.py

    r3a2ff0 raf6b27  
    553553
    554554        if update_torrents:
    555             log.debug("Setting torrent owner \"%s\" on %s", username, update_torrents)
     555            log.debug('Setting torrent owner "%s" on %s', username, update_torrents)
    556556
    557557            def failed_change_owner(failure):
  • deluge/ui/gtkui/preferences.py

    r3a2ff0 raf6b27  
    11061106        username = model[itr][0]
    11071107        header = _('Remove Account')
    1108         text = _("Are you sure you wan't do remove the account with the "
    1109                  "username \"%(username)s\"?" % dict(username=username))
     1108        text = _('Are you sure you want to remove the account with the '
     1109                 'username "%(username)s"?' % dict(username=username))
    11101110        dialog = YesNoDialog(header, text, parent=self.pref_dialog)
    11111111
  • deluge/ui/gtkui/statusbar.py

    r3a2ff0 raf6b27  
    329329            self.diskspace_item.set_markup('<small>%s</small>' % fsize(space, shortform=True))
    330330        else:
    331             self.diskspace_item.set_markup("<span foreground=\"red\">" + _('Error') + '</span>')
     331            self.diskspace_item.set_markup('<span foreground="red">' + _('Error') + '</span>')
    332332
    333333    def _on_max_download_speed(self, max_download_speed):
  • packaging/win32/deluge-bbfreeze.py

    r3a2ff0 raf6b27  
    185185# Copy version info to file for nsis script.
    186186with open('VERSION.tmp', 'w') as ver_file:
    187     ver_file.write("build_version = \"%s\"" % build_version)
     187    ver_file.write('build_version = "%s"' % build_version)
    188188
    189189# Create the install and uninstall file list for NSIS.
  • tox.ini

    r3a2ff0 raf6b27  
    109109    {[testenv]deps}
    110110    flake8
     111    flake8-quotes
    111112    pep8-naming
    112113commands =
Note: See TracChangeset for help on using the changeset viewer.