unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: 43477@debbugs.gnu.org
Cc: zimoun <zimon.toutoune@gmail.com>
Subject: [bug#43477] [PATCH 1/1] guix: graph: Add 'plain' backend.
Date: Thu, 17 Sep 2020 21:40:32 +0200	[thread overview]
Message-ID: <20200917194032.15103-1-zimon.toutoune@gmail.com> (raw)
In-Reply-To: <20200917193931.14699-1-zimon.toutoune@gmail.com>

* guix/graph.scm: (emit-plain-prologue, emit-plain-epilogue, emit-plain-node,
emit-plain-edge): New procedures.
(%plain-backend): New variable.
(%graph-backends): Update variable.
---
 guix/graph.scm | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/guix/graph.scm b/guix/graph.scm
index b695ca4306..4be864b29a 100644
--- a/guix/graph.scm
+++ b/guix/graph.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2016, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -324,6 +325,28 @@ nodeArray.push(nodes[\"~a\"]);~%"
                  emit-cypher-prologue emit-cypher-epilogue
                  emit-cypher-node emit-cypher-edge))
 
+\f
+;;;
+;;; Plain export
+;;;
+
+(define (emit-plain-prologue name port)
+  (format port ""))
+
+(define (emit-plain-epilogue port)
+  (format port ""))
+
+(define (emit-plain-node id label port)
+  (format port "~a~%" label))
+
+(define (emit-plain-edge id1 id2 port)
+  (format port ""))
+
+(define %plain-backend
+  (graph-backend "plain"
+                 "Generate Plain queries."
+                 emit-plain-prologue emit-plain-epilogue
+                 emit-plain-node emit-plain-edge))
 
 \f
 ;;;
@@ -333,7 +356,8 @@ nodeArray.push(nodes[\"~a\"]);~%"
 (define %graph-backends
   (list %graphviz-backend
         %d3js-backend
-        %cypher-backend))
+        %cypher-backend
+        %plain-backend))
 
 (define* (export-graph sinks port
                        #:key
-- 
2.28.0





  reply	other threads:[~2020-09-17 19:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 19:39 [bug#43477] [PATCH 0/1] guix: graph: Add 'plain' backend zimoun
2020-09-17 19:40 ` zimoun [this message]
2020-09-18  9:35 ` Mathieu Othacehe
2020-09-18 19:59   ` zimoun
2020-09-18 12:34 ` Ricardo Wurmus
2020-09-18 20:04   ` zimoun
2020-09-24 14:44     ` Ludovic Courtès
2020-09-24 15:47       ` zimoun
2020-09-25  9:32         ` Ludovic Courtès
2020-09-25  9:54           ` zimoun
2020-09-25 10:11             ` Ricardo Wurmus
2020-09-25 12:22               ` [bug#43477] Guix aliases? (was: [bug#43477] [PATCH 0/1] guix: graph: Add 'plain' backend.) zimoun
2020-09-25 15:56                 ` [bug#43477] Guix aliases? Ludovic Courtès
2020-09-25 17:00                   ` zimoun
2020-10-05  8:03                     ` bug#43477: " Ludovic Courtès

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20200917194032.15103-1-zimon.toutoune@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=43477@debbugs.gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).