There was an error while loading. Please reload this page.
1 parent 4534f84 commit 03d26f0Copy full SHA for 03d26f0
2 files changed
doc/source/quickstart.rst
@@ -175,35 +175,29 @@ Recurse through the Tree
175
:start-after: # [15-test_cloned_repo_object]
176
:end-before: # ![15-test_cloned_repo_object]
177
178
-.. code-block:: python
+.. literalinclude:: ../../test/test_quick_doc.py
179
+ :language: python
180
+ :dedent: 8
181
+ :start-after: # [16-test_cloned_repo_object]
182
+ :end-before: # ![16-test_cloned_repo_object]
183
- print_files_from_git(tree)
184
185
- # Output
- | Downloads, tree
186
- ----| Downloads/file3.txt, blob
187
- | dir1, tree
188
- ----| dir1/file1.txt, blob
189
- ----| dir1/file2.txt, blob
190
- | file4.txt, blob
191
+Printing text files
+####################
192
193
-Print file version
194
-##################
+ :start-after: # [17-test_cloned_repo_object]
+ :end-before: # ![17-test_cloned_repo_object]
195
196
.. literalinclude:: ../../test/test_quick_doc.py
197
:language: python
198
:dedent: 8
199
- :start-after: # [16-test_cloned_repo_object]
200
- :end-before: # ![16-test_cloned_repo_object]
+ :start-after: # [18-test_cloned_repo_object]
+ :end-before: # ![18-test_cloned_repo_object]
201
202
203
204
- blob = tree[print_file]
205
- print(blob.data_stream.read().decode())
206
207
208
- # file 2 version 1
209
- # Update version 2
test/test_quick_doc.py
@@ -156,19 +156,34 @@ def print_files_from_git(tree, delim='-', i=0):
156
157
# ![15-test_cloned_repo_object]
158
159
- # Printing text files
160
# [16-test_cloned_repo_object]
161
- print_file = 'dir1/file2.txt'
162
- tree[print_file]
+ print_files_from_git(tree)
163
164
- # Output <git.Blob "3fab4a2e97ee374d0eccd854f298eee0b06a62fb">
165
- # ![16-test_cloned_repo_object]
+ # Output
+ # | Downloads, tree
+ # ---- | Downloads / file3.txt, blob
+ # | dir1, tree
166
+ # ---- | dir1 / file1.txt, blob
167
+ # ---- | dir1 / file2.txt, blob
168
+ # | file4.txt, blob
169
+ # # ![16-test_cloned_repo_object]
170
171
+ # Printing text files
172
# [17-test_cloned_repo_object]
173
+ print_file = 'dir1/file2.txt'
174
+ tree[print_file]
+ # Output <git.Blob "3fab4a2e97ee374d0eccd854f298eee0b06a62fb">
# ![17-test_cloned_repo_object]
+ # [18-test_cloned_repo_object]
+ blob = tree[print_file]
+ print(blob.data_stream.read().decode())
+ # file 2 version 1
+ # Update version 2
+ # ![18-test_cloned_repo_object]
0 commit comments