mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Output the actual command used for the linux native dialogs in debug mode
This commit is contained in:
parent
3b05cd601f
commit
84b853dca8
@ -14,7 +14,7 @@ from threading import Thread
|
|||||||
from PyQt5.Qt import QEventLoop
|
from PyQt5.Qt import QEventLoop
|
||||||
|
|
||||||
from calibre import force_unicode
|
from calibre import force_unicode
|
||||||
from calibre.constants import filesystem_encoding, preferred_encoding
|
from calibre.constants import filesystem_encoding, preferred_encoding, DEBUG
|
||||||
from calibre.utils.config import dynamic
|
from calibre.utils.config import dynamic
|
||||||
|
|
||||||
|
|
||||||
@ -107,7 +107,13 @@ def decode_output(raw):
|
|||||||
def run(cmd):
|
def run(cmd):
|
||||||
from calibre.gui2 import sanitize_env_vars
|
from calibre.gui2 import sanitize_env_vars
|
||||||
with sanitize_env_vars():
|
with sanitize_env_vars():
|
||||||
p = subprocess.Popen(list(map(encode_arg, cmd)), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
ecmd = list(map(encode_arg, cmd))
|
||||||
|
if DEBUG:
|
||||||
|
try:
|
||||||
|
print(ecmd)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
p = subprocess.Popen(ecmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
ret = p.wait()
|
ret = p.wait()
|
||||||
return ret, decode_output(stdout), decode_output(stderr)
|
return ret, decode_output(stdout), decode_output(stderr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user