1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2025-01-13 16:38:24 +00:00

ob-python: can now handle variable strings with newlines

* lisp/ob-python.el (org-babel-python-var-to-python): python can now
  handle input strings with newlines
This commit is contained in:
Eric Schulte 2010-07-14 11:31:38 -07:00
parent e3af061f90
commit f904376df4

View File

@ -110,7 +110,11 @@ Convert an elisp value, VAR, into a string of python source code
specifying a variable of the same value."
(if (listp var)
(concat "[" (mapconcat #'org-babel-python-var-to-python var ", ") "]")
(if (equal var 'hline) "None" (format "%S" var))))
(if (equal var 'hline)
"None"
(format
(if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%S\"\"" "%S")
var))))
(defun org-babel-python-table-or-string (results)
"Convert RESULTS into an appropriate elisp value.