diff --git a/deluge/config.py b/deluge/config.py index 159ab7535..013a7a337 100644 --- a/deluge/config.py +++ b/deluge/config.py @@ -197,7 +197,7 @@ what is currently in the config and it could not convert the value if isinstance(value, basestring): value = utf8_encoded(value) - if not self.__config.has_key(key): + if key not in self.__config: self.__config[key] = value log.debug("Setting '%s' to %s of %s", key, value, type(value)) return diff --git a/deluge/plugins/Notifications/deluge/plugins/notifications/core.py b/deluge/plugins/Notifications/deluge/plugins/notifications/core.py index b57cc1dcb..19a1d1dc2 100644 --- a/deluge/plugins/Notifications/deluge/plugins/notifications/core.py +++ b/deluge/plugins/Notifications/deluge/plugins/notifications/core.py @@ -151,7 +151,7 @@ Date: %(date)s if security_enabled: server.ehlo() - if not server.esmtp_features.has_key('starttls'): + if 'starttls' not in server.esmtp_features: log.warning("TLS/SSL enabled but server does not support it") else: server.starttls() diff --git a/deluge/ui/common.py b/deluge/ui/common.py index 9ad208e28..ed65e988a 100644 --- a/deluge/ui/common.py +++ b/deluge/ui/common.py @@ -115,7 +115,7 @@ class TorrentInfo(object): # Get list of files from torrent info paths = {} dirs = {} - if self.__m_metadata["info"].has_key("files"): + if "files" in self.__m_metadata["info"]: prefix = "" if len(self.__m_metadata["info"]["files"]) > 1: prefix = self.__m_name @@ -176,7 +176,7 @@ class TorrentInfo(object): } self.__m_files = [] - if self.__m_metadata["info"].has_key("files"): + if "files" in self.__m_metadata["info"]: prefix = "" if len(self.__m_metadata["info"]["files"]) > 1: prefix = self.__m_name diff --git a/deluge/ui/gtkui/peers_tab.py b/deluge/ui/gtkui/peers_tab.py index f3ffd8a15..b4ad5cc45 100644 --- a/deluge/ui/gtkui/peers_tab.py +++ b/deluge/ui/gtkui/peers_tab.py @@ -202,7 +202,7 @@ class PeersTab(Tab): for (index, column) in enumerate(self.listview.get_columns()): cname = column.get_title() - if state["columns"].has_key(cname): + if cname in state["columns"]: cstate = state["columns"][cname] column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) column.set_fixed_width(cstate["width"] if cstate["width"] > 0 else 10) @@ -240,7 +240,7 @@ class PeersTab(Tab): if country == " ": return None - if not self.cached_flag_pixbufs.has_key(country): + if country not in self.cached_flag_pixbufs: # We haven't created a pixbuf for this country yet try: self.cached_flag_pixbufs[country] = gtk.gdk.pixbuf_new_from_file( @@ -257,7 +257,7 @@ class PeersTab(Tab): new_ips = set() for peer in status["peers"]: new_ips.add(peer["ip"]) - if self.peers.has_key(peer["ip"]): + if peer["ip"] in self.peers: # We already have this peer in our list, so lets just update it row = self.peers[peer["ip"]] if not self.liststore.iter_is_valid(row):