forked from cn/GB2260.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from bosondata/upgrade/v0.2
更新行政区域代码201801
- Loading branch information
Showing
30 changed files
with
918 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
[bumpversion] | ||
files = setup.py gb2260/__init__.py | ||
files = setup.py gb2260_v2/__init__.py | ||
commit = True | ||
tag = True | ||
current_version = 0.4.1 | ||
|
||
current_version = 0.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
omit = gb2260_v2/data/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,6 @@ __pycache__ | |
/build | ||
/dist | ||
/htmlcov | ||
/gb2260/data.py | ||
/.idea | ||
/.python-version | ||
.pytest_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[submodule "data"] | ||
path = data | ||
url = https://github.com/cn/GB2260.git | ||
path = data | ||
url = https://github.com/cn/GB2260.git | ||
branch = develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-e. | ||
|
||
pytest | ||
pytest-cov | ||
pytest-pep8 | ||
pytest-mock |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from __future__ import absolute_import, unicode_literals | ||
|
||
from gb2260_v2.exceptions import ( | ||
GB2260Exception, | ||
InvalidCode, | ||
RevisionNotFound, | ||
SourceNotFound, | ||
) | ||
from gb2260_v2.gb2260 import GB2260 | ||
|
||
__all__ = [ | ||
'GB2260', | ||
'GB2260Exception', | ||
'InvalidCode', | ||
'RevisionNotFound', | ||
'SourceNotFound', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from __future__ import absolute_import, unicode_literals | ||
|
||
import sys | ||
|
||
PY2 = sys.version_info[0] == 2 | ||
|
||
if PY2: | ||
text_type = unicode | ||
binary_type = str | ||
|
||
def iteritems(d): | ||
return d.iteritems() | ||
else: | ||
text_type = str | ||
binary_type = bytes | ||
|
||
def iteritems(d): | ||
return d.items() | ||
|
||
|
||
def ensure_text(value, encoding): | ||
if isinstance(value, text_type): | ||
return value | ||
return value.decode(encoding) | ||
|
||
|
||
def ensure_str(value, encoding): | ||
if isinstance(value, str): | ||
return value | ||
if PY2: | ||
return value.encode(encoding) | ||
else: | ||
return value.decode(encoding) |
Oops, something went wrong.