Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit ea08dcf

Browse files
author
Olivier Gambier
committed
Make the new "hacking" version happy
Docker-DCO-1.1-Signed-off-by: Olivier Gambier <[email protected]> (github: dmp42)
1 parent a1d0f92 commit ea08dcf

File tree

9 files changed

+26
-83
lines changed

9 files changed

+26
-83
lines changed

depends/docker-registry-core/docker_registry/core/boto.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
from . import driver
3939
from . import lru
40-
4140
from .exceptions import FileNotFoundError
4241

4342
logger = logging.getLogger(__name__)

depends/docker-registry-core/docker_registry/core/driver.py

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@
4141

4242
class Base(object):
4343

44-
"""Storage is a convenience class that describes methods that must be
45-
implemented by any backend.
44+
"""Storage is a convenience class...
45+
46+
... that describes methods that must be implemented by any backend.
4647
You should inherit (or duck type) this if you are implementing your own.
4748
4849
:param host: host name
@@ -157,60 +158,52 @@ def put_bytes(self, path, content):
157158
return self.put_content(path, content)
158159

159160
def get_content(self, path):
160-
"""Method to get content
161-
"""
161+
"""Method to get content."""
162162
raise NotImplementedError(
163163
"You must implement get_content(self, path) on your storage %s" %
164164
self.__class__.__name__)
165165

166166
def put_content(self, path, content):
167-
"""Method to put content
168-
"""
167+
"""Method to put content."""
169168
raise NotImplementedError(
170169
"You must implement put_content(self, path, content) on %s" %
171170
self.__class__.__name__)
172171

173172
def stream_read(self, path, bytes_range=None):
174-
"""Method to stream read
175-
"""
173+
"""Method to stream read."""
176174
raise NotImplementedError(
177175
"You must implement stream_read(self, path, , bytes_range=None) " +
178176
"on your storage %s" %
179177
self.__class__.__name__)
180178

181179
def stream_write(self, path, fp):
182-
"""Method to stream write
183-
"""
180+
"""Method to stream write."""
184181
raise NotImplementedError(
185182
"You must implement stream_write(self, path, fp) " +
186183
"on your storage %s" %
187184
self.__class__.__name__)
188185

189186
def list_directory(self, path=None):
190-
"""Method to list directory
191-
"""
187+
"""Method to list directory."""
192188
raise NotImplementedError(
193189
"You must implement list_directory(self, path=None) " +
194190
"on your storage %s" %
195191
self.__class__.__name__)
196192

197193
def exists(self, path):
198-
"""Method to test exists
199-
"""
194+
"""Method to test exists."""
200195
raise NotImplementedError(
201196
"You must implement exists(self, path) on your storage %s" %
202197
self.__class__.__name__)
203198

204199
def remove(self, path):
205-
"""Method to remove
206-
"""
200+
"""Method to remove."""
207201
raise NotImplementedError(
208202
"You must implement remove(self, path) on your storage %s" %
209203
self.__class__.__name__)
210204

211205
def get_size(self, path):
212-
"""Method to get the size
213-
"""
206+
"""Method to get the size."""
214207
raise NotImplementedError(
215208
"You must implement get_size(self, path) on your storage %s" %
216209
self.__class__.__name__)

depends/docker-registry-core/docker_registry/core/exceptions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434

3535
class UnspecifiedError(Exception):
3636

37-
"""Base class for all exceptions in docker_registry
38-
"""
37+
"""Base class for all exceptions in docker_registry."""
3938

4039
def __init__(self, *args, **kwargs):
4140
self.message = kwargs.pop('message', 'No details')
@@ -44,8 +43,9 @@ def __init__(self, *args, **kwargs):
4443

4544
class UsageError(UnspecifiedError):
4645

47-
"""Exceptions related to use of the library, like missing files,
48-
wrong argument type, etc.
46+
"""Exceptions related to use of the library.
47+
48+
Missing files, wrong argument type, etc.
4949
"""
5050

5151

depends/docker-registry-core/docker_registry/core/lru.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
import functools
2828
import logging
29-
import redis
3029

30+
import redis
3131
logger = logging.getLogger(__name__)
3232

3333
redis_conn = None

depends/docker-registry-core/docker_registry/testing/driver.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
import random
2020
import string
2121

22-
from nose import tools
23-
2422
from ..core import compat
2523
from ..core import driver
2624
from ..core import exceptions
25+
from nose import tools
2726

2827
logger = logging.getLogger(__name__)
2928

depends/docker-registry-core/docker_registry/testing/mock_boto.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
XXX this mock is crass and break gcs.
1919
Look into moto instead.'''
2020

21+
from . import mock_dict
22+
from . import utils
2123
import boto.s3.bucket
2224
import boto.s3.connection
2325
import boto.s3.key
24-
25-
from . import mock_dict
26-
from . import utils
26+
import six.add_metaclass
2727

2828
Bucket__init__ = boto.s3.bucket.Bucket.__init__
2929

3030

31+
@six.add_metaclass(utils.monkeypatch_class)
3132
class MultiPartUpload(boto.s3.multipart.MultiPartUpload):
32-
__metaclass__ = utils.monkeypatch_class
3333

3434
def upload_part_from_file(self, io, num_part):
3535
if num_part == 1:
@@ -41,8 +41,8 @@ def complete_upload(self):
4141
return None
4242

4343

44+
@six.add_metaclass(utils.monkeypatch_class)
4445
class S3Connection(boto.s3.connection.S3Connection):
45-
__metaclass__ = utils.monkeypatch_class
4646

4747
def __init__(self, *args, **kwargs):
4848
return None
@@ -56,8 +56,8 @@ def make_request(self, *args, **kwargs):
5656
return 'request result'
5757

5858

59+
@six.add_metaclass(utils.monkeypatch_class)
5960
class Bucket(boto.s3.bucket.Bucket):
60-
__metaclass__ = utils.monkeypatch_class
6161

6262
_bucket = mock_dict.MockDict()
6363
_bucket.add_dict_methods()
@@ -96,8 +96,8 @@ def initiate_multipart_upload(self, key_name, **kwargs):
9696
return mp
9797

9898

99+
@six.add_metaclass(utils.monkeypatch_class)
99100
class Key(boto.s3.key.Key):
100-
__metaclass__ = utils.monkeypatch_class
101101

102102
def exists(self):
103103
bucket_dict = self.bucket._bucket_dict

depends/docker-registry-core/docker_registry/testing/query.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
from nose import tools
18-
1917
from ..core import driver
2018
from ..core import exceptions
19+
from nose import tools
2120

2221

2322
class Query(object):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
hacking==0.8.1
1+
hacking>=0.8,<1.0

depends/docker-registry-core/tests/__init__.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)