diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-08-20 16:25:10 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-08-20 16:25:10 +0000 |
commit | f1a69c16665c6c031c4723e5bc3e6d6f4118fa5e (patch) | |
tree | cf6ab6722fd4419721519ab7cf5f02d1d981a359 /Lib/plat-mac/pimp.py | |
parent | 0da7e03e12abd760085bd7e76df617d69fd94822 (diff) | |
download | cpython-git-f1a69c16665c6c031c4723e5bc3e6d6f4118fa5e.tar.gz |
Get rid of a bunch more has_key() uses. We *really* need a tool for this.
test_aepack now passes. IDLE still needs to be converted (among others).
Diffstat (limited to 'Lib/plat-mac/pimp.py')
-rw-r--r-- | Lib/plat-mac/pimp.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Lib/plat-mac/pimp.py b/Lib/plat-mac/pimp.py index 456427c1cd..454e4b1035 100644 --- a/Lib/plat-mac/pimp.py +++ b/Lib/plat-mac/pimp.py @@ -147,7 +147,7 @@ class PimpUrllibDownloader(PimpDownloader): self.update("Downloading %s: opening connection" % url) keepgoing = True download = urllib2.urlopen(url) - if download.headers.has_key("content-length"): + if "content-length" in download.headers: length = long(download.headers['content-length']) else: length = -1 @@ -415,7 +415,7 @@ class PimpDatabase: for p in packages: p = dict(p) - if p.has_key('Download-URL'): + if 'Download-URL' in p: p['Download-URL'] = urllib.basejoin(url, p['Download-URL']) flavor = p.get('Flavor') if flavor == 'source': @@ -547,9 +547,9 @@ class PimpPackage: installed through pimp, return the name in (parentheses).""" rv = self._dict['Name'] - if self._dict.has_key('Version'): + if 'Version' in self._dict: rv = rv + '-%s' % self._dict['Version'] - if self._dict.has_key('Flavor'): + if 'Flavor' in self._dict: rv = rv + '-%s' % self._dict['Flavor'] if self._dict.get('Flavor') == 'hidden': # Pseudo-package, show in parentheses @@ -642,9 +642,9 @@ class PimpPackage: descr = str(item) else: name = item['Name'] - if item.has_key('Version'): + if 'Version' in item: name = name + '-' + item['Version'] - if item.has_key('Flavor'): + if 'Flavor' in item: name = name + '-' + item['Flavor'] pkg = self._db.find(name) if not pkg: @@ -795,10 +795,10 @@ class PimpPackage_binary(PimpPackage): If output is given it should be a file-like object and it will receive a log of what happened.""" - if self._dict.has_key('Install-command'): + if 'Install-command' in self._dict: return "%s: Binary package cannot have Install-command" % self.fullname() - if self._dict.has_key('Pre-install-command'): + if 'Pre-install-command' in self._dict: if _cmd(output, '/tmp', self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command']) @@ -831,7 +831,7 @@ class PimpPackage_binary(PimpPackage): self.afterInstall() - if self._dict.has_key('Post-install-command'): + if 'Post-install-command' in self._dict: if _cmd(output, '/tmp', self._dict['Post-install-command']): return "%s: post-install: running \"%s\" failed" % \ (self.fullname(), self._dict['Post-install-command']) @@ -856,7 +856,7 @@ class PimpPackage_source(PimpPackage): If output is given it should be a file-like object and it will receive a log of what happened.""" - if self._dict.has_key('Pre-install-command'): + if 'Pre-install-command' in self._dict: if _cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command']) @@ -893,7 +893,7 @@ class PimpPackage_source(PimpPackage): self.afterInstall() - if self._dict.has_key('Post-install-command'): + if 'Post-install-command' in self._dict: if _cmd(output, self._buildDirname, self._dict['Post-install-command']): return "post-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Post-install-command']) @@ -911,10 +911,10 @@ class PimpPackage_installer(PimpPackage): If output is given it should be a file-like object and it will receive a log of what happened.""" - if self._dict.has_key('Post-install-command'): + if 'Post-install-command' in self._dict: return "%s: Installer package cannot have Post-install-command" % self.fullname() - if self._dict.has_key('Pre-install-command'): + if 'Pre-install-command' in self._dict: if _cmd(output, '/tmp', self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command']) |