Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
ff41775d
Commit
ff41775d
authored
Aug 17, 2019
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'pwr/unpickle-iso-languages' into Develop
parents
d04a78af
9f8cab99
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5938 additions
and
21797 deletions
+5938
-21797
isoLanguages.py
cps/isoLanguages.py
+2
-17
iso_language_names.py
cps/iso_language_names.py
+5936
-0
iso639.pickle
cps/translations/iso639.pickle
+0
-21780
No files found.
cps/isoLanguages.py
View file @
ff41775d
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
...
@@ -18,14 +17,8 @@
...
@@ -18,14 +17,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from
__future__
import
division
,
print_function
,
unicode_literals
from
__future__
import
division
,
print_function
,
unicode_literals
import
sys
import
os
try
:
import
cPickle
except
ImportError
:
import
pickle
as
cPickle
from
.
constants
import
TRANSLATIONS_DIR
as
_TRANSLATIONS_DIR
from
.
iso_language_names
import
LANGUAGE_NAMES
as
_LANGUAGE_NAMES
try
:
try
:
...
@@ -54,16 +47,8 @@ except ImportError:
...
@@ -54,16 +47,8 @@ except ImportError:
return
_copy_fields
(
pyc_languages
.
get
(
name
=
name
))
return
_copy_fields
(
pyc_languages
.
get
(
name
=
name
))
try
:
with
open
(
os
.
path
.
join
(
_TRANSLATIONS_DIR
,
'iso639.pickle'
),
'rb'
)
as
f
:
_LANGUAGES
=
cPickle
.
load
(
f
)
except
cPickle
.
UnpicklingError
as
error
:
print
(
"Can't read file cps/translations/iso639.pickle:
%
s"
%
error
)
sys
.
exit
(
1
)
def
get_language_names
(
locale
):
def
get_language_names
(
locale
):
return
_LANGUAGES
.
get
(
locale
)
return
_LANGUAGE
_NAME
S
.
get
(
locale
)
def
get_language_name
(
locale
,
lang_code
):
def
get_language_name
(
locale
,
lang_code
):
...
...
cps/iso_language_names.py
0 → 100644
View file @
ff41775d
This diff is collapsed.
Click to expand it.
cps/translations/iso639.pickle
deleted
100644 → 0
View file @
d04a78af
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment