Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
9987c1bc
Kaydet (Commit)
9987c1bc
authored
Kas 08, 2018
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix docs examples to work with Python 3
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
5467658b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
12 deletions
+69
-12
daemon.py
docker/api/daemon.py
+3
-3
image.py
docker/api/image.py
+8
-8
mixin.py
docker/api/mixin.py
+57
-0
daemon.py
docker/types/daemon.py
+1
-1
No files found.
docker/api/daemon.py
Dosyayı görüntüle @
9987c1bc
...
...
@@ -42,8 +42,8 @@ class DaemonApiMixin(object):
Example:
>>> for event in client.events()
... print
event
>>> for event in client.events(
decode=True
)
... print
(event)
{u'from': u'image/with:tag',
u'id': u'container-id',
u'status': u'start',
...
...
@@ -54,7 +54,7 @@ class DaemonApiMixin(object):
>>> events = client.events()
>>> for event in events:
... print
event
... print
(event)
>>> # and cancel from another thread
>>> events.close()
"""
...
...
docker/api/image.py
Dosyayı görüntüle @
9987c1bc
...
...
@@ -352,8 +352,8 @@ class ImageApiMixin(object):
Example:
>>> for line in cli.pull('busybox', stream=True):
... print(json.dumps(
json.loads(line)
, indent=4))
>>> for line in cli.pull('busybox', stream=True
, decode=True
):
... print(json.dumps(
line
, indent=4))
{
"status": "Pulling image (latest) from busybox",
"progressDetail": {},
...
...
@@ -428,12 +428,12 @@ class ImageApiMixin(object):
If the server returns an error.
Example:
>>> for line in cli.push('yourname/app', stream=True):
... print
line
{
"status":"Pushing repository yourname/app (1 tags)"
}
{
"status":"Pushing","progressDetail":{},"id":"511136ea3c5a"
}
{
"status":"Image already pushed, skipping","progressDetail"
:{},
"id":"511136ea3c5a"
}
>>> for line in cli.push('yourname/app', stream=True
, decode=True
):
... print
(line)
{
'status': 'Pushing repository yourname/app (1 tags)'
}
{
'status': 'Pushing','progressDetail': {}, 'id': '511136ea3c5a'
}
{
'status': 'Image already pushed, skipping', 'progressDetail'
:{},
'id': '511136ea3c5a'
}
...
"""
...
...
docker/api/mixin.py
0 → 100644
Dosyayı görüntüle @
9987c1bc
from
typing
import
Any
,
Dict
,
Iterable
,
List
,
Optional
,
Union
import
requests
from
..constants
import
DEFAULT_DOCKER_API_VERSION
,
DEFAULT_TIMEOUT_SECONDS
class
BaseMixin
(
object
):
base_url
:
str
=
''
credstore_env
:
Optional
[
Dict
[
str
,
str
]]
=
None
timeout
:
int
=
DEFAULT_TIMEOUT_SECONDS
_auth_configs
:
Dict
[
str
,
Dict
]
_general_configs
:
Dict
[
str
,
Dict
]
_version
:
str
=
DEFAULT_DOCKER_API_VERSION
def
_url
(
self
,
pathfmt
:
str
,
*
args
,
**
kwargs
)
->
str
:
raise
NotImplemented
def
_post
(
self
,
url
:
str
,
**
kwargs
)
->
requests
.
Response
:
raise
NotImplemented
def
_get
(
self
,
url
:
str
,
**
kwargs
)
->
requests
.
Response
:
raise
NotImplemented
def
_put
(
self
,
url
:
str
,
**
kwargs
)
->
requests
.
Response
:
raise
NotImplemented
def
_delete
(
self
,
url
:
str
,
**
kwargs
)
->
requests
.
Response
:
raise
NotImplemented
def
_post_json
(
self
,
url
:
str
,
data
:
Optional
[
Union
[
Dict
[
str
,
Any
],
List
[
Any
]]],
**
kwargs
)
->
requests
.
Response
:
raise
NotImplemented
def
_raise_for_status
(
self
,
response
:
requests
.
Response
)
->
None
:
raise
NotImplemented
def
_result
(
self
,
response
:
requests
.
Response
,
json
:
bool
=
False
,
binary
:
bool
=
False
)
->
Any
:
raise
NotImplemented
def
_stream_helper
(
self
,
response
:
requests
.
Response
,
decode
:
bool
=
False
)
->
Iterable
:
raise
NotImplemented
def
_get_raw_response_socket
(
self
,
response
:
requests
.
Response
)
->
Iterable
:
raise
NotImplemented
def
_read_from_socket
(
self
,
response
:
requests
.
Response
,
stream
:
bool
,
tty
:
bool
=
False
)
->
Union
[
Iterable
[
bytes
],
bytes
]:
raise
NotImplemented
def
_stream_raw_result
(
self
,
response
:
requests
.
Response
,
chunk_size
:
int
=
1
,
decode
:
bool
=
True
)
->
Iterable
[
bytes
]:
raise
NotImplemented
docker/types/daemon.py
Dosyayı görüntüle @
9987c1bc
...
...
@@ -15,7 +15,7 @@ class CancellableStream(object):
Example:
>>> events = client.events()
>>> for event in events:
... print
event
... print
(event)
>>> # and cancel from another thread
>>> events.close()
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment