All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: linux-doc@vger.kernel.org,
	DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: [PATCH 2/6] HACKS: pass stderr along in kfigure.py
Date: Mon, 19 Dec 2016 08:44:25 +0100	[thread overview]
Message-ID: <20161219074431.9562-3-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20161219074431.9562-1-daniel.vetter@ffwll.ch>

Some addition comments on the implementation:
- Also needs to be hacked up for svg conversion.
- Inline kernel-render creates temp files and caches them, doesn't
  seem that good an idea. Probably should switch over to using pipes.
- Reimplements sphinx' depency tracking. Might be fixable if we just
  use pipes (and using the sphinx functions to open/read files).
- Linenumbers are off, but no idea how to fix that.
- Script looks a bit complicated to me, but I don't have python clue.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 Documentation/sphinx/kfigure.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Documentation/sphinx/kfigure.py b/Documentation/sphinx/kfigure.py
index 76425b461a40..d6819337edf6 100644
--- a/Documentation/sphinx/kfigure.py
+++ b/Documentation/sphinx/kfigure.py
@@ -50,6 +50,7 @@ import os
 from os import path
 import subprocess
 from hashlib import sha1
+import sys
 
 from docutils import nodes
 from docutils.statemachine import ViewList
@@ -278,11 +279,16 @@ def dot2format(dot_fname, out_fname):
 
     """
     out_format = path.splitext(out_fname)[1][1:]
-    cmd = [dot_cmd, '-T%s' % out_format, dot_fname]
+    cmd = [dot_cmd, '-T%s' % out_format, dot_fname, '-v']
     exit_code = 42
     with open(out_fname, "w") as out:
-        exit_code = subprocess.call(
+        p = subprocess.Popen(
             cmd, stdout = out, stderr = subprocess.PIPE )
+        meh, err = p.communicate()
+
+        sys.stderr.write(err)
+
+        exit_code = p.returncode
         out.flush()
     return bool(exit_code == 0)
 
-- 
2.11.0


  parent reply	other threads:[~2016-12-19  7:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19  7:44 [PATCH 0/6] diagrams for drm docs Daniel Vetter
2016-12-19  7:44 ` [PATCH 1/6] docs-rst: automatically convert Graphviz and SVG images Daniel Vetter
2016-12-19  7:44 ` Daniel Vetter [this message]
2016-12-19  7:44 ` [PATCH 3/6] drm/doc: Add KMS overview graphs Daniel Vetter
2016-12-19  7:44 ` [PATCH 4/6] drm/doc: Consistent kerneldoc include order Daniel Vetter
2016-12-19  7:44 ` [PATCH 5/6] drm/doc: diagram for mode objects and properties Daniel Vetter
2016-12-19  7:44 ` [PATCH 6/6] drm/doc: atomic overview, with graph Daniel Vetter
2016-12-19  7:44 ` [PATCH] " Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161219074431.9562-3-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-doc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.