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
4259aa69
Commit
4259aa69
authored
Apr 26, 2017
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of shel=true again
parent
2d918bfb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
helper.py
cps/helper.py
+4
-4
No files found.
cps/helper.py
View file @
4259aa69
...
@@ -66,9 +66,9 @@ def make_mobi(book_id, calibrepath):
...
@@ -66,9 +66,9 @@ def make_mobi(book_id, calibrepath):
vendorpath
=
os
.
path
.
join
(
os
.
path
.
normpath
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
+
vendorpath
=
os
.
path
.
join
(
os
.
path
.
normpath
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
+
os
.
sep
+
"../vendor"
+
os
.
sep
))
os
.
sep
+
"../vendor"
+
os
.
sep
))
if
sys
.
platform
==
"win32"
:
if
sys
.
platform
==
"win32"
:
kindlegen
=
os
.
path
.
join
(
vendorpath
,
u"kindlegen.exe"
)
kindlegen
=
(
os
.
path
.
join
(
vendorpath
,
u"kindlegen.exe"
))
.
encode
(
sys
.
getfilesystemencoding
()
)
else
:
else
:
kindlegen
=
os
.
path
.
join
(
vendorpath
,
u"kindlegen"
)
kindlegen
=
(
os
.
path
.
join
(
vendorpath
,
u"kindlegen"
))
.
encode
(
sys
.
getfilesystemencoding
()
)
if
not
os
.
path
.
exists
(
kindlegen
):
if
not
os
.
path
.
exists
(
kindlegen
):
app
.
logger
.
error
(
"make_mobi: kindlegen binary not found in:
%
s"
%
kindlegen
)
app
.
logger
.
error
(
"make_mobi: kindlegen binary not found in:
%
s"
%
kindlegen
)
return
None
return
None
...
@@ -80,8 +80,8 @@ def make_mobi(book_id, calibrepath):
...
@@ -80,8 +80,8 @@ def make_mobi(book_id, calibrepath):
file_path
=
os
.
path
.
join
(
calibrepath
,
book
.
path
,
data
.
name
)
file_path
=
os
.
path
.
join
(
calibrepath
,
book
.
path
,
data
.
name
)
if
os
.
path
.
exists
(
file_path
+
u".epub"
):
if
os
.
path
.
exists
(
file_path
+
u".epub"
):
p
=
subprocess
.
Popen
(
(
kindlegen
+
"
\"
"
+
file_path
+
u".epub
\"
"
)
.
encode
(
sys
.
getfilesystemencoding
())
,
p
=
subprocess
.
Popen
(
[
kindlegen
,
(
"
\"
"
+
file_path
+
u".epub
\"
"
)
.
encode
(
sys
.
getfilesystemencoding
())]
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
True
)
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
# Poll process for new output until finished
# Poll process for new output until finished
while
True
:
while
True
:
nextline
=
p
.
stdout
.
readline
()
nextline
=
p
.
stdout
.
readline
()
...
...
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