Skip to content

Commit f283417

Browse files
committed
Reorganized package structure and cleaned up imports
1 parent 3c0a652 commit f283417

18 files changed

+479
-443
lines changed

CHANGES

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ General
1717
where unique
1818
* removed basename method from Objects with path's as it replicated features of os.path
1919

20+
objects Package
21+
----------------
22+
* blob, tree, tag and commit module have been moved to new objects package. This should
23+
not affect you though unless you explicitly imported individual objects. If you just
24+
used the git package, names did not change.
25+
26+
Repo
27+
----
28+
* Moved blame method from Blob to repo as it appeared to belong there much more.
29+
2030
Diff
2131
----
2232
* Members a a_commit and b_commit renamed to a_blob and b_blob - they are populated

lib/git/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,17 @@
99

1010
__version__ = 'git'
1111

12+
from git.objects import *
13+
from git.refs import *
1214
from git.actor import Actor
13-
from git.blob import Blob
14-
from git.commit import Commit
1515
from git.diff import Diff
1616
from git.errors import InvalidGitRepositoryError, NoSuchPathError, GitCommandError
1717
from git.cmd import Git
18-
from git.head import Head
1918
from git.repo import Repo
2019
from git.stats import Stats
21-
from git.tag import Tag,TagRef,TagObject
22-
from git.tree import Tree
2320
from git.utils import dashify
2421
from git.utils import touch
2522

23+
2624
__all__ = [ name for name, obj in locals().items()
2725
if not (name.startswith('_') or inspect.ismodule(obj)) ]

lib/git/blob.py

Lines changed: 0 additions & 126 deletions
This file was deleted.

lib/git/diff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

77
import re
8-
import blob
8+
import objects.blob as blob
99

1010
class Diff(object):
1111
"""

lib/git/head.py

Lines changed: 0 additions & 49 deletions
This file was deleted.

lib/git/objects/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""
2+
Import all submodules main classes into the package space
3+
"""
4+
import inspect
5+
from tag import *
6+
from blob import *
7+
from tree import *
8+
from commit import *
9+
10+
__all__ = [ name for name, obj in locals().items()
11+
if not (name.startswith('_') or inspect.ismodule(obj)) ]

0 commit comments

Comments
 (0)