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
adb36353
Kaydet (Commit)
adb36353
authored
Kas 30, 2015
tarafından
dlorenc
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Allow utils.tar to take an existing file object.
Signed-off-by:
dlorenc
<
lorenc.d@gmail.com
>
üst
d51d06d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
utils.py
docker/utils/utils.py
+6
-5
No files found.
docker/utils/utils.py
Dosyayı görüntüle @
adb36353
...
...
@@ -74,9 +74,10 @@ def decode_json_header(header):
return
json
.
loads
(
data
)
def
tar
(
path
,
exclude
=
None
,
dockerfile
=
None
):
f
=
tempfile
.
NamedTemporaryFile
()
t
=
tarfile
.
open
(
mode
=
'w'
,
fileobj
=
f
)
def
tar
(
path
,
exclude
=
None
,
dockerfile
=
None
,
fileobj
=
None
):
if
not
fileobj
:
fileobj
=
tempfile
.
NamedTemporaryFile
()
t
=
tarfile
.
open
(
mode
=
'w'
,
fileobj
=
fileobj
)
root
=
os
.
path
.
abspath
(
path
)
exclude
=
exclude
or
[]
...
...
@@ -85,8 +86,8 @@ def tar(path, exclude=None, dockerfile=None):
t
.
add
(
os
.
path
.
join
(
root
,
path
),
arcname
=
path
,
recursive
=
False
)
t
.
close
()
f
.
seek
(
0
)
return
f
f
ileobj
.
seek
(
0
)
return
f
ileobj
def
exclude_paths
(
root
,
patterns
,
dockerfile
=
None
):
...
...
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