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
23d66a0d
Commit
23d66a0d
authored
Oct 03, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
parent
0d64692c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
helper.py
cps/helper.py
+1
-1
convert.py
cps/tasks/convert.py
+4
-8
updater.py
cps/updater.py
+1
-0
No files found.
cps/helper.py
View file @
23d66a0d
...
@@ -102,7 +102,7 @@ def convert_book_format(book_id, calibrepath, old_book_format, new_book_format,
...
@@ -102,7 +102,7 @@ def convert_book_format(book_id, calibrepath, old_book_format, new_book_format,
txt
=
(
u"
%
s ->
%
s:
%
s"
%
(
old_book_format
,
new_book_format
,
book
.
title
))
txt
=
(
u"
%
s ->
%
s:
%
s"
%
(
old_book_format
,
new_book_format
,
book
.
title
))
settings
[
'old_book_format'
]
=
old_book_format
settings
[
'old_book_format'
]
=
old_book_format
settings
[
'new_book_format'
]
=
new_book_format
settings
[
'new_book_format'
]
=
new_book_format
WorkerThread
.
add
(
user_id
,
TaskConvert
(
file_path
,
book
.
id
,
txt
,
settings
,
kindle_mail
))
WorkerThread
.
add
(
user_id
,
TaskConvert
(
file_path
,
book
.
id
,
txt
,
settings
,
kindle_mail
,
user_id
))
return
None
return
None
else
:
else
:
error_message
=
_
(
u"
%(format)
s not found:
%(fn)
s"
,
error_message
=
_
(
u"
%(format)
s not found:
%(fn)
s"
,
...
...
cps/tasks/convert.py
View file @
23d66a0d
...
@@ -20,12 +20,13 @@ log = logger.create()
...
@@ -20,12 +20,13 @@ log = logger.create()
class
TaskConvert
(
CalibreTask
):
class
TaskConvert
(
CalibreTask
):
def
__init__
(
self
,
file_path
,
bookid
,
taskMessage
,
settings
,
kindle_mail
):
def
__init__
(
self
,
file_path
,
bookid
,
taskMessage
,
settings
,
kindle_mail
,
user
=
None
):
super
(
TaskConvert
,
self
)
.
__init__
(
taskMessage
)
super
(
TaskConvert
,
self
)
.
__init__
(
taskMessage
)
self
.
file_path
=
file_path
self
.
file_path
=
file_path
self
.
bookid
=
bookid
self
.
bookid
=
bookid
self
.
settings
=
settings
self
.
settings
=
settings
self
.
kindle_mail
=
kindle_mail
self
.
kindle_mail
=
kindle_mail
self
.
user
=
user
self
.
results
=
dict
()
self
.
results
=
dict
()
...
@@ -40,14 +41,9 @@ class TaskConvert(CalibreTask):
...
@@ -40,14 +41,9 @@ class TaskConvert(CalibreTask):
# if we're sending to kindle after converting, create a one-off task and run it immediately
# if we're sending to kindle after converting, create a one-off task and run it immediately
# todo: figure out how to incorporate this into the progress
# todo: figure out how to incorporate this into the progress
try
:
try
:
task
=
TaskEmail
(
self
.
settings
[
'subject'
],
self
.
results
[
"path"
],
worker_thread
.
add
(
self
.
user
,
TaskEmail
(
self
.
settings
[
'subject'
],
self
.
results
[
"path"
],
filename
,
self
.
settings
,
self
.
kindle_mail
,
filename
,
self
.
settings
,
self
.
kindle_mail
,
self
.
settings
[
'subject'
],
self
.
settings
[
'body'
],
internal
=
True
)
self
.
settings
[
'subject'
],
self
.
settings
[
'body'
],
internal
=
True
))
task
.
start
(
worker_thread
)
# even though the convert task might be finished, if this task fails, fail the whole thing
if
task
.
stat
!=
STAT_FINISH_SUCCESS
:
raise
Exception
(
task
.
error
)
except
Exception
as
e
:
except
Exception
as
e
:
return
self
.
_handleError
(
str
(
e
))
return
self
.
_handleError
(
str
(
e
))
...
...
cps/updater.py
View file @
23d66a0d
...
@@ -227,6 +227,7 @@ class Updater(threading.Thread):
...
@@ -227,6 +227,7 @@ class Updater(threading.Thread):
os
.
sep
+
'vendor'
,
os
.
sep
+
'calibre-web.log'
,
os
.
sep
+
'.git'
,
os
.
sep
+
'client_secrets.json'
,
os
.
sep
+
'vendor'
,
os
.
sep
+
'calibre-web.log'
,
os
.
sep
+
'.git'
,
os
.
sep
+
'client_secrets.json'
,
os
.
sep
+
'gdrive_credentials'
,
os
.
sep
+
'settings.yaml'
,
os
.
sep
+
'venv'
,
os
.
sep
+
'virtualenv'
,
os
.
sep
+
'gdrive_credentials'
,
os
.
sep
+
'settings.yaml'
,
os
.
sep
+
'venv'
,
os
.
sep
+
'virtualenv'
,
os
.
sep
+
'access.log'
,
os
.
sep
+
'access.log1'
,
os
.
sep
+
'access.log2'
,
os
.
sep
+
'access.log'
,
os
.
sep
+
'access.log1'
,
os
.
sep
+
'access.log2'
,
os
.
sep
+
'.calibre-web.log.swp'
)
)
additional_path
=
self
.
is_venv
()
additional_path
=
self
.
is_venv
()
if
additional_path
:
if
additional_path
:
...
...
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