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
72fff2a2
Commit
72fff2a2
authored
Aug 22, 2018
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update for running calibre-convert in docker
parent
79173475
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
worker.py
cps/worker.py
+17
-9
No files found.
cps/worker.py
View file @
72fff2a2
...
@@ -233,15 +233,23 @@ class WorkerThread(threading.Thread):
...
@@ -233,15 +233,23 @@ class WorkerThread(threading.Thread):
if
web
.
ub
.
config
.
config_ebookconverter
==
1
:
if
web
.
ub
.
config
.
config_ebookconverter
==
1
:
command
=
[
web
.
ub
.
config
.
config_converterpath
,
u'"'
+
file_path
+
u'.epub"'
]
command
=
[
web
.
ub
.
config
.
config_converterpath
,
u'"'
+
file_path
+
u'.epub"'
]
else
:
else
:
command
=
[
web
.
ub
.
config
.
config_converterpath
,
'"'
+
file_path
+
u'.epub"'
,
# Linux py2.7 encode as list without quotes no empty element for parameters
'"'
+
file_path
+
u'.mobi"'
]
# linux py3.x no encode and as list without quotes no empty element for parameters
if
web
.
ub
.
config
.
config_calibre
:
# windows py2.7 encode as string with qoutes empty element for parameters is okay
command
.
append
(
web
.
ub
.
config
.
config_calibre
)
# windows py 3.x no encode and as string with qoutes empty element for parameters is okay
# special handling for windows
# seperate handling for windows and linux
if
os
.
name
==
'nt'
:
if
os
.
name
==
'nt'
:
command
=
' '
.
join
(
command
)
command
=
web
.
ub
.
config
.
config_converterpath
+
u' "'
+
file_path
+
u'.epub" "'
+
\
if
sys
.
version_info
<
(
3
,
0
):
file_path
+
u'.mobi" '
+
web
.
ub
.
config
.
config_calibre
command
=
command
.
encode
(
sys
.
getfilesystemencoding
())
if
sys
.
version_info
<
(
3
,
0
):
command
=
command
.
encode
(
sys
.
getfilesystemencoding
())
else
:
command
=
[
web
.
ub
.
config
.
config_converterpath
,
(
file_path
+
u'.epub'
),
(
file_path
+
u'.mobi'
)]
if
web
.
ub
.
config
.
config_calibre
:
command
.
append
(
web
.
ub
.
config
.
config_calibre
)
if
sys
.
version_info
<
(
3
,
0
):
command
=
[
x
.
encode
(
sys
.
getfilesystemencoding
())
for
x
in
command
]
p
=
subprocess
.
Popen
(
command
,
stdout
=
subprocess
.
PIPE
,
universal_newlines
=
True
)
p
=
subprocess
.
Popen
(
command
,
stdout
=
subprocess
.
PIPE
,
universal_newlines
=
True
)
except
OSError
as
e
:
except
OSError
as
e
:
...
...
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