diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2012-07-31 12:52:12 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2012-08-01 13:12:03 +0000 |
commit | 0032ccbd60f202ec76d9b738cddc8bdbf9f54133 (patch) | |
tree | cd398ab063be0bdab20b91cbd2420ad4981de813 /morphlib/remoteartifactcache.py | |
parent | 93a3d28ee51cc301cd79ff8bfabb2010defda09b (diff) | |
download | morph-0032ccbd60f202ec76d9b738cddc8bdbf9f54133.tar.gz |
python scripts: pep8ize codebase
This was done with the aid of the pep8 script, available by running
`easy_install pep8`.
It may be worth making this part of ./check, but that will require
putting pep8 into the development tools stratum.
This should be easy, given pep8 has no external dependencies.
Diffstat (limited to 'morphlib/remoteartifactcache.py')
-rw-r--r-- | morphlib/remoteartifactcache.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/morphlib/remoteartifactcache.py b/morphlib/remoteartifactcache.py index aaab4a3c..c0c0f723 100644 --- a/morphlib/remoteartifactcache.py +++ b/morphlib/remoteartifactcache.py @@ -1,14 +1,14 @@ # Copyright (C) 2012 Codethink Limited -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -20,7 +20,7 @@ import urllib2 import urlparse -class HeadRequest(urllib2.Request): # pragma: no cover +class HeadRequest(urllib2.Request): # pragma: no cover def get_method(self): return 'HEAD' @@ -30,26 +30,26 @@ class GetError(cliapp.AppException): def __init__(self, cache, artifact): cliapp.AppException.__init__( - self, 'Failed to get the artifact %s with cache key %s ' - 'from the artifact cache %s' % - (artifact, artifact.cache_key, cache)) + self, 'Failed to get the artifact %s with cache key %s ' + 'from the artifact cache %s' % + (artifact, artifact.cache_key, cache)) class GetArtifactMetadataError(cliapp.AppException): def __init__(self, cache, artifact, name): cliapp.AppException.__init__( - self, 'Failed to get metadata %s for the artifact %s ' - 'from the artifact cache %s' % (name, artifact, cache)) + self, 'Failed to get metadata %s for the artifact %s ' + 'from the artifact cache %s' % (name, artifact, cache)) class GetSourceMetadataError(cliapp.AppException): def __init__(self, cache, source, cache_key, name): cliapp.AppException.__init__( - self, 'Failed to get metadata %s for source %s ' - 'and cache key %s from the artifact cache %s' % - (name, source, cache_key, cache)) + self, 'Failed to get metadata %s for source %s ' + 'and cache key %s from the artifact cache %s' % + (name, source, cache_key, cache)) class RemoteArtifactCache(object): @@ -88,7 +88,7 @@ class RemoteArtifactCache(object): except urllib2.URLError: raise GetSourceMetadataError(self, source, cachekey, name) - def _has_file(self, filename): # pragma: no cover + def _has_file(self, filename): # pragma: no cover url = self._request_url(filename) logging.debug('RemoteArtifactCache._has_file: url=%s' % url) request = HeadRequest(url) @@ -98,17 +98,17 @@ class RemoteArtifactCache(object): except urllib2.HTTPError: return False - def _get_file(self, filename): # pragma: no cover + def _get_file(self, filename): # pragma: no cover url = self._request_url(filename) logging.debug('RemoteArtifactCache._get_file: url=%s' % url) return urllib2.urlopen(url) - def _request_url(self, filename): # pragma: no cover + def _request_url(self, filename): # pragma: no cover server_url = self.server_url if not server_url.endswith('/'): server_url += '/' return urlparse.urljoin( - server_url, '/1.0/artifacts?filename=%s' % filename) - - def __str__(self): # pragma: no cover + server_url, '/1.0/artifacts?filename=%s' % filename) + + def __str__(self): # pragma: no cover return self.server_url |