babel: treat python tuples as lists

This commit is contained in:
Dan Davison 2010-02-19 11:46:36 -05:00
parent a95c05773e
commit fc693eb5e2
1 changed files with 3 additions and 2 deletions

View File

@ -91,10 +91,11 @@ specifying a var of the same value."
(format "%S" var)))
(defun org-babel-python-table-or-string (results)
"If the results look like a table, then convert them into an
"If the results look like a list or tuple, then convert them into an
Emacs-lisp table, otherwise return the results as a string."
(org-babel-read
(if (string-match "^\\[.+\\]$" results)
(if (or (string-match "^\\[.+\\]$" results)
(string-match "^(.+)$" results))
(org-babel-read
(replace-regexp-in-string
"\\[" "(" (replace-regexp-in-string