summaryrefslogtreecommitdiff
path: root/mwctools.py
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2019-07-14 16:56:34 +0200
committerJörg Frings-Fürst <debian@jff.email>2019-07-14 16:56:34 +0200
commit4d9fabf827de7bbfd10470529a46b8e3b6a062ca (patch)
treee5416e47b0fabe697e70bb902bc9b1e5e98cb2d5 /mwctools.py
parent3e926e08d444e0f1d52468e2341277c36a194880 (diff)
parent749921d2ce9862143db6ef80a6acc7c803d9f0f7 (diff)
Merge branch 'release/debian/2.0.5-1'HEADdebian/2.0.5-1master
Diffstat (limited to 'mwctools.py')
-rwxr-xr-xmwctools.py7
1 files changed, 4 insertions, 3 deletions
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