From 4fa0bf4b0c3644078fb9b5c3e7f604f6f6e442d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 14 Jul 2019 10:10:26 +0200 Subject: New upstream version 2.0.5 --- mwctools.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mwctools.py') diff --git a/mwctools.py b/mwctools.py index cefbbf0..1dca2e6 100755 --- a/mwctools.py +++ b/mwctools.py @@ -33,12 +33,13 @@ class Receiver(Parser): class Content: - def __init__(self, uri, encoding, title, content, contenttype): + def __init__(self, uri, encoding, title, content, contenttype, additional=None): self.uri = uri self.encoding = encoding self.title = title self.content = content self.contenttype = contenttype + self.additional = additional # returns a short subject line @@ -106,13 +107,13 @@ class CommandReceiver(Receiver): contentList = [] # run command and retrieve output - process = subprocess.Popen(self.command, stdout=subprocess.PIPE, shell=True, close_fds=True) + process = subprocess.Popen(self.command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, close_fds=True) thefile = process.stdout result = thefile.read().decode(self.encoding, errors='ignore') thefile.close() if process.wait() != 0: - raise Exception("process terminated with an error") + raise Exception("process terminated with an error: " + str(process.stderr) + "\n" + result) contentList.append(Content(uri=None, encoding=self.encoding, title=None, content=result, contenttype=self.contenttype)) return contentList -- cgit v1.2.3