From 35ddb45b41b3de2d4f783608ad8d8752f6557997 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Tue, 20 May 2008 15:56:38 +0200 Subject: removed unneeded spaces --- lib/git_python/tree.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/git_python/tree.py') diff --git a/lib/git_python/tree.py b/lib/git_python/tree.py index c459bb43..3faec26b 100644 --- a/lib/git_python/tree.py +++ b/lib/git_python/tree.py @@ -8,7 +8,7 @@ class Tree(LazyMixin): self.repo = repo self.id = None self.contents = None - + for k, v in kwargs.items(): setattr(self, k, v) @@ -18,7 +18,7 @@ class Tree(LazyMixin): @classmethod def construct(cls, repo, treeish, paths = []): - output = repo.git.ls_tree(treeish, *paths) + output = repo.git.ls_tree(treeish, *paths) return Tree(repo, **{'id': treeish}).construct_initialize(repo, treeish, output) def construct_initialize(self, repo, id, text): @@ -26,10 +26,10 @@ class Tree(LazyMixin): self.id = id self.contents = [] self.__baked__ = False - + for line in text.splitlines(): self.contents.append(self.content_from_string(self.repo, line)) - + self.contents = [c for c in self.contents if c is not None] self.__bake_it__() @@ -38,10 +38,10 @@ class Tree(LazyMixin): def content_from_string(self, repo, text): """ Parse a content item and create the appropriate object - + ``repo`` is the Repo - + ``text`` is the single line containing the items data in `git ls-tree` format @@ -52,7 +52,7 @@ class Tree(LazyMixin): mode, typ, id, name = text.expandtabs(1).split(" ", 4) except: return None - + if typ == "tree": return Tree(repo, **{'id': id, 'mode': mode, 'name': name}) elif typ == "blob": @@ -67,21 +67,21 @@ class Tree(LazyMixin): Find the named object in this tree's contents Examples:: - + >>> Repo('/path/to/python-git').tree/'lib' >>> Repo('/path/to/python-git').tree/'README.txt' - + Returns ``GitPython.Blob`` or ``GitPython.Tree`` or ``None`` if not found """ contents = [c for c in self.contents if c.name == file] return contents and contents[0] or None - + @property def basename(self): os.path.basename(self.name) - + def __repr__(self): return '' % self.id -- cgit v1.2.1