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

Commit 4ff08ca

Browse files
author
Olivier Gambier
committed
Making new hacking happy
Docker-DCO-1.1-Signed-off-by: Olivier Gambier <[email protected]> (github: dmp42)
1 parent cc65b23 commit 4ff08ca

30 files changed

+70
-54
lines changed

docker_registry/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
except ImportError as e:
1111
_bugsnag_import_error = e
1212
bugsnag = None
13-
import flask
1413

1514
from . import toolkit
1615
from .lib import config
16+
from .server import __version__
17+
import flask
1718

1819
# configure logging prior to subsequent imports which assume
1920
# logging has been configured
@@ -22,8 +23,7 @@
2223
level=getattr(logging, cfg.loglevel.upper()),
2324
datefmt="%d/%b/%Y:%H:%M:%S %z")
2425

25-
from .lib import mirroring
26-
from .server import __version__
26+
from .lib import mirroring # noqa
2727

2828
app = flask.Flask('docker-registry')
2929

docker_registry/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .lib import mirroring
1313
from .lib import signals
1414

15-
from .app import app
15+
from .app import app # noqa
1616

1717

1818
store = storage.load()

docker_registry/lib/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
# -*- coding: utf-8 -*-

docker_registry/lib/cache.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
import logging
4+
45
import redis
56

67
from docker_registry.core import lru

docker_registry/lib/checksums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ def compute_simple(fp, json_data):
8282
json_data = file(sys.argv[1]).read()
8383
fp = open(sys.argv[2])
8484
print(compute_simple(fp, json_data))
85-
#print compute_tarsum(fp, json_data)
85+
# print compute_tarsum(fp, json_data)

docker_registry/lib/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
import os
4+
45
import rsa
56
import yaml
67

@@ -9,7 +10,8 @@
910

1011

1112
class Config(object):
12-
"""A simple config class that:
13+
"""A simple config class
14+
1315
* gives properties access through either items or attributes
1416
* enforce types (thanks to yaml)
1517
* interpolate from ENV

docker_registry/lib/index/db.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
"""An SQLAlchemy backend for the search endpoint
44
"""
55

6+
from ... import storage
7+
from .. import config
8+
from . import Index
69
import sqlalchemy
710
import sqlalchemy.exc
811
import sqlalchemy.ext.declarative
912
import sqlalchemy.orm
1013
import sqlalchemy.sql.functions
1114

12-
from ... import storage
13-
from .. import config
14-
from . import Index
15-
1615

1716
Base = sqlalchemy.ext.declarative.declarative_base()
1817

docker_registry/lib/layers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import tempfile
55

66
import backports.lzma as lzma
7+
78
from docker_registry.core import compat
89
json = compat.json
910

@@ -60,6 +61,7 @@ def generate_ancestry(image_id, parent_id=None):
6061

6162
class Archive(lzma.LZMAFile):
6263
"""file-object wrapper for decompressing xz compressed tar archives
64+
6365
This class wraps a file-object that contains tar archive data. The data
6466
will be optionally decompressed with lzma/xz if found to be a compressed
6567
archive.
@@ -120,6 +122,7 @@ def json(self):
120122

121123
def serialize_tar_info(tar_info):
122124
'''serialize a tarfile.TarInfo instance
125+
123126
Take a single tarfile.TarInfo instance and serialize it to a
124127
tuple. Consider union whiteouts by filename and mark them as
125128
deleted in the third element. Don't include union metadata
@@ -190,6 +193,7 @@ def get_image_files_from_fobj(layer_file):
190193

191194
def get_image_files_json(image_id):
192195
'''return json file listing for given image id
196+
193197
Download the specified layer and determine the file contents.
194198
Alternatively, process a passed in file-object containing the
195199
layer data.
@@ -212,6 +216,7 @@ def get_image_files_json(image_id):
212216

213217
def get_file_info_map(file_infos):
214218
'''convert a list of file info tuples to dictionaries
219+
215220
Convert a list of layer file info tuples to a dictionary using the
216221
first element (filename) as the key.
217222
'''
@@ -231,6 +236,7 @@ def set_image_diff_cache(image_id, diff_json):
231236

232237
def get_image_diff_json(image_id):
233238
'''get json describing file differences in layer
239+
234240
Calculate the diff information for the files contained within
235241
the layer. Return a dictionary of lists grouped by whether they
236242
were deleted, changed or created in this layer.

docker_registry/lib/mirroring.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# -*- coding: utf-8 -*-
22

3-
import flask
43
import functools
54
import logging
6-
import requests
75

86
from .. import storage
97
from .. import toolkit
108
from . import cache
119
from . import config
10+
import flask
11+
import requests
1212

1313
logger = logging.getLogger(__name__)
1414
cfg = config.load()

docker_registry/lib/rlock.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
# https://gist.github.com/adewes/6103220
44

5-
import redis
65
import time
76

7+
import redis
8+
89

910
class LockTimeout(BaseException):
1011
pass

0 commit comments

Comments
 (0)