| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -175,35 +175,29 @@ Recurse through the Tree | |||
| 175 | 175 | :start-after: # [15-test_cloned_repo_object] | |
| 176 | 176 | :end-before: # ![15-test_cloned_repo_object] | |
| 177 | 177 | ||
| 178 | - .. code-block:: python | ||
| 178 | + .. 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] | ||
| 179 | 183 | ||
| 180 | - print_files_from_git(tree) | ||
| 181 | 184 | ||
| 182 | - .. code-block:: python | ||
| 183 | 185 | ||
| 184 | - # Output | ||
| 185 | - | 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 | 186 | ||
| 187 | + Printing text files | ||
| 188 | + #################### | ||
| 192 | 189 | ||
| 193 | - Print file version | ||
| 194 | - ################## | ||
| 190 | + .. literalinclude:: ../../test/test_quick_doc.py | ||
| 191 | + :language: python | ||
| 192 | + :dedent: 8 | ||
| 193 | + :start-after: # [17-test_cloned_repo_object] | ||
| 194 | + :end-before: # ![17-test_cloned_repo_object] | ||
| 195 | 195 | ||
| 196 | 196 | .. literalinclude:: ../../test/test_quick_doc.py | |
| 197 | 197 | :language: python | |
| 198 | 198 | :dedent: 8 | |
| 199 | - :start-after: # [16-test_cloned_repo_object] | ||
| 200 | - :end-before: # ![16-test_cloned_repo_object] | ||
| 199 | + :start-after: # [18-test_cloned_repo_object] | ||
| 200 | + :end-before: # ![18-test_cloned_repo_object] | ||
| 201 | 201 | ||
| 202 | - .. code-block:: python | ||
| 203 | 202 | ||
| 204 | - blob = tree[print_file] | ||
| 205 | - print(blob.data_stream.read().decode()) | ||
| 206 | 203 | ||
| 207 | - # Output | ||
| 208 | - # file 2 version 1 | ||
| 209 | - # Update version 2 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -156,19 +156,34 @@ def print_files_from_git(tree, delim='-', i=0): | |||
| 156 | 156 | ||
| 157 | 157 | # ![15-test_cloned_repo_object] | |
| 158 | 158 | ||
| 159 | - # Printing text files | ||
| 160 | 159 | # [16-test_cloned_repo_object] | |
| 161 | - print_file = 'dir1/file2.txt' | ||
| 162 | - tree[print_file] | ||
| 160 | + print_files_from_git(tree) | ||
| 163 | 161 | ||
| 164 | - # Output <git.Blob "3fab4a2e97ee374d0eccd854f298eee0b06a62fb"> | ||
| 165 | - # ![16-test_cloned_repo_object] | ||
| 162 | + # Output | ||
| 163 | + # | Downloads, tree | ||
| 164 | + # ---- | Downloads / file3.txt, blob | ||
| 165 | + # | dir1, tree | ||
| 166 | + # ---- | dir1 / file1.txt, blob | ||
| 167 | + # ---- | dir1 / file2.txt, blob | ||
| 168 | + # | file4.txt, blob | ||
| 169 | + # # ![16-test_cloned_repo_object] | ||
| 166 | 170 | ||
| 171 | + # Printing text files | ||
| 167 | 172 | # [17-test_cloned_repo_object] | |
| 173 | + print_file = 'dir1/file2.txt' | ||
| 174 | + tree[print_file] | ||
| 168 | 175 | ||
| 176 | + # Output <git.Blob "3fab4a2e97ee374d0eccd854f298eee0b06a62fb"> | ||
| 169 | 177 | # ![17-test_cloned_repo_object] | |
| 170 | 178 | ||
| 179 | + # [18-test_cloned_repo_object] | ||
| 180 | + blob = tree[print_file] | ||
| 181 | + print(blob.data_stream.read().decode()) | ||
| 171 | 182 | ||
| 183 | + # Output | ||
| 184 | + # file 2 version 1 | ||
| 185 | + # Update version 2 | ||
| 172 | 186 | ||
| 187 | + # ![18-test_cloned_repo_object] | ||
| 173 | 188 | ||
| 174 | 189 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments