فهرست منبع

babel: python now treats 'hline lines in tables as "None"s

  Thanks to Christopher Webber (cwebb) for bringing this up.
Eric Schulte 14 سال پیش
والد
کامیت
2f0e2f1c5e
1فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 4 2
      lisp/babel/langs/ob-python.el

+ 4 - 2
lisp/babel/langs/ob-python.el

@@ -96,7 +96,7 @@ called by `org-babel-execute-src-block'."
 specifying a var of the same value."
   (if (listp var)
       (concat "[" (mapconcat #'org-babel-python-var-to-python var ", ") "]")
-    (format "%S" var)))
+    (if (equal var 'hline) "None" (format "%S" var))))
 
 (defun org-babel-python-table-or-string (results)
   "If the results look like a list or tuple, then convert them into an
@@ -110,7 +110,9 @@ Emacs-lisp table, otherwise return the results as a string."
                  "\\[" "(" (replace-regexp-in-string
                             "\\]" ")" (replace-regexp-in-string
                                        ", " " " (replace-regexp-in-string
-                                                 "'" "\"" results))))))
+                                                 "'" "\""
+						 (replace-regexp-in-string
+						  "None" "hline" results t)))))))
      results)))
 
 (defvar org-babel-python-buffers '(:default . nil))