Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork966
Expand file tree
/
Copy path__init__.py
More file actions
86 lines (68 loc) · 2.34 KB
/
__init__.py
File metadata and controls
86 lines (68 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# __init__.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
# flake8: noqa
#@PydevCodeAnalysisIgnore
importinspect
importos
importsys
importos.pathasosp
__version__='git'
#{ Initialization
def_init_externals():
"""Initialize external projects by putting them into the path"""
if__version__=='git'and'PYOXIDIZER'notinos.environ:
sys.path.insert(1,osp.join(osp.dirname(__file__),'ext','gitdb'))
try:
importgitdb
exceptImportErrorase:
raiseImportError("'gitdb' could not be found in your PYTHONPATH")frome
# END verify import
#} END initialization
#################
_init_externals()
#################
#{ Imports
fromgit.excimport*# @NoMove @IgnorePep8
try:
fromgit.configimportGitConfigParser# @NoMove @IgnorePep8
fromgit.objectsimport*# @NoMove @IgnorePep8
fromgit.refsimport*# @NoMove @IgnorePep8
fromgit.diffimport*# @NoMove @IgnorePep8
fromgit.dbimport*# @NoMove @IgnorePep8
fromgit.cmdimportGit# @NoMove @IgnorePep8
fromgit.repoimportRepo# @NoMove @IgnorePep8
fromgit.remoteimport*# @NoMove @IgnorePep8
fromgit.indeximport*# @NoMove @IgnorePep8
fromgit.utilimport (# @NoMove @IgnorePep8
LockFile,
BlockingLockFile,
Stats,
Actor,
rmtree,
)
exceptGitErrorasexc:
raiseImportError('%s: %s'% (exc.__class__.__name__,exc))fromexc
#} END imports
__all__= [nameforname,objinlocals().items()
ifnot (name.startswith('_')orinspect.ismodule(obj))]
#{ Initialize git executable path
GIT_OK=None
defrefresh(path=None):
"""Convenience method for setting the git executable path."""
globalGIT_OK
GIT_OK=False
ifnotGit.refresh(path=path):
return
ifnotFetchInfo.refresh():
return
GIT_OK=True
#} END initialize git executable path
#################
try:
refresh()
exceptExceptionasexc:
raiseImportError('Failed to initialize: {0}'.format(exc))fromexc
#################