aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbenadha <benawiadha@gmail.com>2019-10-25 22:08:00 +0700
committerbenadha <benawiadha@gmail.com>2019-10-25 22:08:00 +0700
commitfe2cf0e993823928f6a82b7ac9428a3889374001 (patch)
treeb9905cb78b08f0a8d8da66fc6d50d063609c0792
parent0571b9119671d4946373d5138e584a2327032e4b (diff)
downloadepy-fe2cf0e993823928f6a82b7ac9428a3889374001.tar.gz
Suprress output from subprocess.
-rwxr-xr-xepy.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/epy.py b/epy.py
index 8db085f..8272351 100755
--- a/epy.py
+++ b/epy.py
@@ -53,10 +53,11 @@ import textwrap
import json
import tempfile
import shutil
+import subprocess
import xml.etree.ElementTree as ET
from urllib.parse import unquote
from html import unescape
-from subprocess import run
+# from subprocess import run
from html.parser import HTMLParser
from difflib import SequenceMatcher as SM
@@ -628,7 +629,13 @@ def open_media(scr, epub, src):
try:
with os.fdopen(fd, "wb") as tmp:
tmp.write(epub.file.read(src))
- run(VWR + " " + path, shell=True)
+ # run(VWR + " " + path, shell=True)
+ subprocess.call(
+ VWR + " " + path,
+ shell=True,
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL
+ )
k = scr.getch()
finally:
os.remove(path)