Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docker_registry_client/DockerRegistryClient.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import absolute_import

from docker_registry_client._BaseClient import BaseClient
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recently took over the maintenance of this project for my company and I'm a bit rusty on my python knowledge. What are the ramifications of these import statements? Will they break backward compatibility with older python versions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkaldon the import won't break backwards compatibility, but it does provide forward compatibility.

from docker_registry_client.Repository import Repository
from ._BaseClient import BaseClient
from .Repository import Repository


class DockerRegistryClient(object):
Expand Down
7 changes: 5 additions & 2 deletions docker_registry_client/Repository.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import absolute_import

from docker_registry_client.Image import Image
from .Image import Image


class BaseRepository(object):
Expand Down Expand Up @@ -36,7 +36,10 @@ def tags(self):
if self._images is None:
self.refresh()

return list(self._images.keys())
if type(self._images) is list:
return list(taginfo['name'] for taginfo in self._images)
else:
return list(self._images.keys())

def data(self, tag):
return self._client.get_tag_json(self.namespace, self.repository, tag)
Expand Down
2 changes: 1 addition & 1 deletion docker_registry_client/_BaseClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from requests import get, put, delete
from requests.exceptions import HTTPError
import json
from docker_registry_client.AuthorizationService import AuthorizationService
from .AuthorizationService import AuthorizationService
from .manifest import sign as sign_manifest

# urllib3 throws some ssl warnings with older versions of python
Expand Down
4 changes: 1 addition & 3 deletions docker_registry_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

from __future__ import absolute_import

from docker_registry_client.DockerRegistryClient import (DockerRegistryClient,
BaseClient,
Repository)
from .DockerRegistryClient import (DockerRegistryClient, BaseClient, Repository)