Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit12a40cc

Browse files
authored
Merge pull request#1092 from aparcar/aparcar-patch-1
Update pipelines_and_jobs.rst
2 parents424a8cb +9a068e0 commit12a40cc

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

‎docs/gl_objects/pipelines_and_jobs.rst

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,8 @@ Get the artifacts of a job::
301301
You can download artifacts as a stream. Provide a callable to handle the
302302
stream::
303303

304-
class Foo(object):
305-
def __init__(self):
306-
self._fd = open('artifacts.zip', 'wb')
307-
308-
def __call__(self, chunk):
309-
self._fd.write(chunk)
310-
311-
target = Foo()
312-
build_or_job.artifacts(streamed=True, action=target)
313-
del(target) # flushes data on disk
304+
with open("archive.zip", "wb") as f:
305+
build_or_job.artifacts(streamed=True, action=f.write)
314306

315307
You can also directly stream the output into a file, and unzip it afterwards::
316308

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp