Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf6aa8d1

Browse files
committed
initial set of adjustments to make (most) imports work.
More to come, especially when it's about strings
1 parent3936084 commitf6aa8d1

37 files changed

+136
-114
lines changed

‎README.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ In short, I want to make a new release of 0.3 with all contributions and fixes i
8383

8484
The goals I have set for myself, in order, are as follows, all on branch 0.3.
8585

86-
* bring the test suite back online to work with the most commonly used git version
87-
* merge all open pull requests, may there be a test-case or not, back. If something breaks, fix it if possible or let the contributor know
88-
* conform git-python's structure and toolchain to the one used in my[other OSS projects](https://github.com/Byron/bcore)
89-
* evaluate all open issues and close them if possible
9086
* evaluate python 3.3 compatibility and establish it if possible
9187

9288
While that is happening, I will try hard to foster community around the project. This means being more responsive on the mailing list and in issues, as well as setting up clear guide lines about the[contribution](http://rfc.zeromq.org/spec:22) and maintenance workflow.

‎doc/source/changes.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Changelog
66
=====
77
* When fetching, pulling or pushing, and an error occours, it will not be reported on stdout anymore. However, if there is a fatal error, it will still result in a GitCommandError to be thrown. This goes hand in hand with improved fetch result parsing.
88
* Code Cleanup (in preparation for python 3 support)
9+
910
* Applied autopep8 and cleaned up code
1011
* Using python logging module instead of print statments to signal certain kinds of errors
1112

‎git/cmd.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@
77
importos
88
importsys
99
importlogging
10-
fromutilimport (
11-
LazyMixin,
12-
stream_copy
13-
)
14-
fromexcimportGitCommandError
15-
1610
fromsubprocessimport (
1711
call,
1812
Popen,
1913
PIPE
2014
)
2115

16+
17+
from .utilimport (
18+
LazyMixin,
19+
stream_copy
20+
)
21+
from .excimportGitCommandError
22+
23+
2224
execute_kwargs= ('istream','with_keep_cwd','with_extended_output',
2325
'with_exceptions','as_process',
2426
'output_stream')

‎git/compat.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#-*-coding:utf-8-*-
2+
# config.py
3+
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
4+
#
5+
# This module is part of GitPython and is released under
6+
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
7+
"""utilities to help provide compatibility with python 3"""
8+
9+
fromgitdb.utils.compatimport (# noqa
10+
PY3,
11+
xrange,
12+
MAXSIZE,
13+
izip,
14+
)
15+
16+
fromgitdb.utils.encodingimport (# noqa
17+
string_types,
18+
text_type
19+
)

‎git/config.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
configuration files"""
88

99
importre
10-
importConfigParserascp
10+
try:
11+
importConfigParserascp
12+
exceptImportError:
13+
# PY3
14+
importconfigparserascp
1115
importinspect
1216
importlogging
1317

‎git/db.py‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
"""Module with our own gitdb implementation - it uses the git command"""
2-
fromexcimport (
3-
GitCommandError,
4-
BadObject
5-
)
6-
72
fromgitdb.baseimport (
83
OInfo,
94
OStream
105
)
11-
126
fromgitdb.utilimport (
137
bin_to_hex,
148
hex_to_bin
159
)
1610
fromgitdb.dbimportGitDB
1711
fromgitdb.dbimportLooseObjectDB
1812

13+
from .excimport (
14+
GitCommandError,
15+
BadObject
16+
)
17+
1918

2019
__all__= ('GitCmdObjectDB','GitDB')
2120

‎git/diff.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
#
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
6-
76
importre
8-
fromobjects.blobimportBlob
9-
fromobjects.utilimportmode_str_to_int
107

118
fromgitdb.utilimporthex_to_bin
129

10+
from .objects.blobimportBlob
11+
from .objects.utilimportmode_str_to_int
12+
1313

1414
__all__= ('Diffable','DiffIndex','Diff')
1515

‎git/index/base.py‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,23 @@
88
importsys
99
importsubprocess
1010
importglob
11-
fromcStringIOimportStringIO
11+
fromioimportStringIO
1212

1313
fromstatimportS_ISLNK
1414

15-
fromtypimport (
15+
from.typimport (
1616
BaseIndexEntry,
1717
IndexEntry,
1818
)
1919

20-
fromutilimport (
20+
from.utilimport (
2121
TemporaryFileSwap,
2222
post_clear_cache,
2323
default_index,
2424
git_working_dir
2525
)
2626

2727
importgit.diffasdiff
28-
2928
fromgit.excimport (
3029
GitCommandError,
3130
CheckoutError
@@ -40,6 +39,7 @@
4039
)
4140

4241
fromgit.objects.utilimportSerializable
42+
fromgit.compatimportizip
4343

4444
fromgit.utilimport (
4545
LazyMixin,
@@ -49,7 +49,7 @@
4949
to_native_path_linux,
5050
)
5151

52-
fromfunimport (
52+
from.funimport (
5353
entry_key,
5454
write_cache,
5555
read_cache,
@@ -62,7 +62,6 @@
6262
fromgitdb.baseimportIStream
6363
fromgitdb.dbimportMemoryDB
6464
fromgitdb.utilimportto_bin_sha
65-
fromitertoolsimportizip
6665

6766
__all__= ('IndexFile','CheckoutError')
6867

‎git/index/fun.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
S_IFGITLINK=S_IFLNK|S_IFDIR# a submodule
1414

15-
fromcStringIOimportStringIO
15+
fromioimportStringIO
1616

1717
fromgit.utilimportIndexFileSHA1Writer
1818
fromgit.excimportUnmergedEntriesError
@@ -22,15 +22,15 @@
2222
traverse_trees_recursive
2323
)
2424

25-
fromtypimport (
25+
from.typimport (
2626
BaseIndexEntry,
2727
IndexEntry,
2828
CE_NAMEMASK,
2929
CE_STAGESHIFT
3030
)
3131
CE_NAMEMASK_INV=~CE_NAMEMASK
3232

33-
fromutilimport (
33+
from.utilimport (
3434
pack,
3535
unpack
3636
)
@@ -49,7 +49,7 @@ def stat_mode_to_index_mode(mode):
4949
returnS_IFLNK
5050
ifS_ISDIR(mode)orS_IFMT(mode)==S_IFGITLINK:# submodules
5151
returnS_IFGITLINK
52-
returnS_IFREG|0644| (mode&0100)# blobs with or without executable bit
52+
returnS_IFREG|0o644| (mode&0o100)# blobs with or without executable bit
5353

5454

5555
defwrite_cache(entries,stream,extension_data=None,ShaStreamCls=IndexFileSHA1Writer):

‎git/index/typ.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
"""Module with additional types used by the index"""
22

3-
fromutilimport (
3+
frombinasciiimportb2a_hex
4+
5+
from .utilimport (
46
pack,
57
unpack
68
)
9+
fromgit.objectsimportBlob
710

8-
frombinasciiimport (
9-
b2a_hex,
10-
)
1111

12-
fromgit.objectsimportBlob
1312
__all__= ('BlobFilter','BaseIndexEntry','IndexEntry')
1413

1514
#{ Invariants

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp