run txt cover script with python3
This commit is contained in:
parent
d78c30b163
commit
9db6adc222
2 changed files with 4 additions and 6 deletions
|
@ -9,7 +9,7 @@ import subprocess
|
||||||
|
|
||||||
def cover(path):
|
def cover(path):
|
||||||
image = tempfile.mkstemp('.jpg')[1]
|
image = tempfile.mkstemp('.jpg')[1]
|
||||||
cmd = ['python2', 'static/txt.js/txt.py', '-i', path, '-o', image]
|
cmd = ['python3', 'static/txt.js/txt.py', '-i', path, '-o', image]
|
||||||
p = subprocess.Popen(cmd, close_fds=True)
|
p = subprocess.Popen(cmd, close_fds=True)
|
||||||
p.wait()
|
p.wait()
|
||||||
with open(image, 'rb') as fd:
|
with open(image, 'rb') as fd:
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# vi:si:et:sw=4:sts=4:ts=4
|
# vi:si:et:sw=4:sts=4:ts=4
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import Image
|
from PIL import Image
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
from ox.image import drawText, wrapText
|
from ox.image import drawText, wrapText
|
||||||
from zipfile import ZipFile
|
|
||||||
|
|
||||||
|
|
||||||
root_dir = os.path.normpath(os.path.abspath(os.path.dirname(__file__)))
|
root_dir = os.path.normpath(os.path.abspath(os.path.dirname(__file__)))
|
||||||
os.chdir(root_dir)
|
os.chdir(root_dir)
|
||||||
|
@ -82,4 +80,4 @@ def main():
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue