diff options
| author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-13 17:50:26 +0200 |
|---|---|---|
| committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-13 17:50:26 +0200 |
| commit | 5eb0f2c241718bc7462be44e5e8e1e36e35f9b15 (patch) | |
| tree | e8b61d670c5f50612791b358879c34800911a85d /lib/git/objects/util.py | |
| parent | 86fa577e135713e56b287169d69d976cde27ac97 (diff) | |
| download | GitPython-5eb0f2c241718bc7462be44e5e8e1e36e35f9b15.tar.gz GitPython-5eb0f2c241718bc7462be44e5e8e1e36e35f9b15.zip | |
unified name of utils module, recently it was named util and utils in different packages
Diffstat (limited to 'lib/git/objects/util.py')
| -rw-r--r-- | lib/git/objects/util.py | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/git/objects/util.py b/lib/git/objects/util.py deleted file mode 100644 index 15c1d114..00000000 --- a/lib/git/objects/util.py +++ /dev/null @@ -1,36 +0,0 @@ -# util.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors -# -# This module is part of GitPython and is released under -# the BSD License: http://www.opensource.org/licenses/bsd-license.php -""" -Module for general utility functions -""" -import commit, tag, blob, tree - -def get_object_type_by_name(object_type_name): - """ - Returns - type suitable to handle the given object type name. - Use the type to create new instances. - - ``object_type_name`` - Member of TYPES - - Raises - ValueError: In case object_type_name is unknown - """ - if object_type_name == "commit": - import commit - return commit.Commit - elif object_type_name == "tag": - import tag - return tag.TagObject - elif object_type_name == "blob": - import blob - return blob.Blob - elif object_type_name == "tree": - import tree - return tree.Tree - else: - raise ValueError("Cannot handle unknown object type: %s" % object_type_name) |
