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
6f36eef5
Commit
6f36eef5
authored
Jul 15, 2018
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #544 (missed some config options)
Added lxml to stats sceen
parent
f0459d57
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
14 deletions
+28
-14
book_formats.py
cps/book_formats.py
+11
-2
stats.html
cps/templates/stats.html
+5
-0
web.py
cps/web.py
+12
-12
No files found.
cps/book_formats.py
View file @
6f36eef5
...
...
@@ -7,6 +7,11 @@ import os
from
flask_babel
import
gettext
as
_
import
comic
try
:
from
lxml.etree
import
LXML_VERSION
as
lxmlversion
except
ImportError
:
lxmlversion
=
None
__author__
=
'lemmsh'
logger
=
logging
.
getLogger
(
"book_formats"
)
...
...
@@ -120,9 +125,13 @@ def get_versions():
if
not
use_generic_pdf_cover
:
IVersion
=
ImageVersion
.
MAGICK_VERSION
else
:
IVersion
=
_
(
u'not installed'
)
IVersion
=
_
(
u'not installed'
)
if
use_pdf_meta
:
PVersion
=
PyPdfVersion
else
:
PVersion
=
_
(
u'not installed'
)
return
{
'ImageVersion'
:
IVersion
,
'PyPdfVersion'
:
PVersion
}
if
lxmlversion
:
XVersion
=
'.'
.
join
(
map
(
str
,
lxmlversion
))
else
:
XVersion
=
_
(
u'not installed'
)
return
{
'ImageVersion'
:
IVersion
,
'PyPdfVersion'
:
PVersion
,
'LxmlVersion'
:
XVersion
}
cps/templates/stats.html
View file @
6f36eef5
...
...
@@ -98,6 +98,11 @@
<th>
Pysqlite
</th>
<td>
v{{versions['pysqlite']}}
</td>
</tr>
<tr>
<th>
lxml
</th>
<td>
v{{versions['LxmlVersion']}}
</td>
</tr>
</tbody>
</table>
{% endblock %}
cps/web.py
View file @
6f36eef5
...
...
@@ -1413,7 +1413,7 @@ def stats():
authors
=
len
(
db
.
session
.
query
(
db
.
Authors
)
.
all
())
categorys
=
len
(
db
.
session
.
query
(
db
.
Tags
)
.
all
())
series
=
len
(
db
.
session
.
query
(
db
.
Series
)
.
all
())
versions
=
uploader
.
book_formats
.
get_versions
()
config_anonbrowse
=
uploader
.
book_formats
.
get_versions
()
vendorpath
=
os
.
path
.
join
(
config
.
get_main_dir
,
"vendor"
)
if
sys
.
platform
==
"win32"
:
kindlegen
=
os
.
path
.
join
(
vendorpath
,
u"kindlegen.exe"
)
...
...
@@ -2496,21 +2496,10 @@ def view_configuration():
if
content
.
config_title_regex
!=
to_save
[
"config_title_regex"
]:
content
.
config_title_regex
=
to_save
[
"config_title_regex"
]
reboot_required
=
True
if
"config_log_level"
in
to_save
:
content
.
config_log_level
=
int
(
to_save
[
"config_log_level"
])
if
"config_random_books"
in
to_save
:
content
.
config_random_books
=
int
(
to_save
[
"config_random_books"
])
if
"config_books_per_page"
in
to_save
:
content
.
config_books_per_page
=
int
(
to_save
[
"config_books_per_page"
])
content
.
config_uploading
=
0
content
.
config_anonbrowse
=
0
content
.
config_public_reg
=
0
if
"config_uploading"
in
to_save
and
to_save
[
"config_uploading"
]
==
"on"
:
content
.
config_uploading
=
1
if
"config_anonbrowse"
in
to_save
and
to_save
[
"config_anonbrowse"
]
==
"on"
:
content
.
config_anonbrowse
=
1
if
"config_public_reg"
in
to_save
and
to_save
[
"config_public_reg"
]
==
"on"
:
content
.
config_public_reg
=
1
# Mature Content configuration
if
"config_mature_content_tags"
in
to_save
:
content
.
config_mature_content_tags
=
to_save
[
"config_mature_content_tags"
]
.
strip
()
...
...
@@ -2654,6 +2643,15 @@ def configuration_helper(origin):
return
render_title_template
(
"config_edit.html"
,
content
=
config
,
origin
=
origin
,
gdrive
=
gdrive_support
,
gdriveError
=
gdriveError
,
goodreads
=
goodreads_support
,
title
=
_
(
u"Basic Configuration"
))
content
.
config_uploading
=
0
content
.
config_anonbrowse
=
0
content
.
config_public_reg
=
0
if
"config_uploading"
in
to_save
and
to_save
[
"config_uploading"
]
==
"on"
:
content
.
config_uploading
=
1
if
"config_anonbrowse"
in
to_save
and
to_save
[
"config_anonbrowse"
]
==
"on"
:
content
.
config_anonbrowse
=
1
if
"config_public_reg"
in
to_save
and
to_save
[
"config_public_reg"
]
==
"on"
:
content
.
config_public_reg
=
1
# Remote login configuration
content
.
config_remote_login
=
(
"config_remote_login"
in
to_save
and
to_save
[
"config_remote_login"
]
==
"on"
)
...
...
@@ -2667,6 +2665,8 @@ def configuration_helper(origin):
if
"config_goodreads_api_secret"
in
to_save
:
content
.
config_goodreads_api_secret
=
to_save
[
"config_goodreads_api_secret"
]
if
"config_log_level"
in
to_save
:
content
.
config_log_level
=
int
(
to_save
[
"config_log_level"
])
if
content
.
config_logfile
!=
to_save
[
"config_logfile"
]:
# check valid path, only path or file
if
os
.
path
.
dirname
(
to_save
[
"config_logfile"
]):
...
...
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