diff options
author | Steve Frécinaux <code@istique.net> | 2008-09-08 19:27:51 +0200 |
---|---|---|
committer | Steve Frécinaux <code@istique.net> | 2008-09-08 19:27:51 +0200 |
commit | a2856af1d9289ee086b10768b53b65e0fd13a335 (patch) | |
tree | 2dd49ceb26d56241e7d5578aa26c3e6b2031115c | |
parent | 5d3e2f7f57620398df896d9569c5d7c5365f823d (diff) | |
download | gitpython-a2856af1d9289ee086b10768b53b65e0fd13a335.tar.gz |
Update tutorial to demonstrate dict-like tree objects.
-rw-r--r-- | doc/tutorial.txt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/tutorial.txt b/doc/tutorial.txt index 5ad56129..42e015b6 100644 --- a/doc/tutorial.txt +++ b/doc/tutorial.txt @@ -124,8 +124,8 @@ This tree contains three ``Blob`` objects and one ``Tree`` object. The trees are subdirectories and the blobs are files. Trees below the root have additional attributes. - >>> contents = tree.contents[-2] - <GitPython.Tree "e5445b9db4a9f08d5b4de4e29e61dffda2f386ba"> + >>> contents = tree["lib"] + <GitPython.Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a3"> >>> contents.name 'test' @@ -134,7 +134,8 @@ additional attributes. '040000' There is a convenience method that allows you to get a named sub-object -from a tree. +from a tree with a syntax similar to how paths are written in an unix +system. >>> tree/"lib" <GitPython.Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a30"> |