babel: fixed bug in org-babel-expand-body:python

This commit is contained in:
Eric Schulte 2010-04-20 00:18:03 -06:00
parent 9ff31a5110
commit 0917218da5
1 changed files with 8 additions and 8 deletions

View File

@ -37,14 +37,14 @@
(add-to-list 'org-babel-tangle-langs '("python" "py" "#!/usr/bin/env python")) (add-to-list 'org-babel-tangle-langs '("python" "py" "#!/usr/bin/env python"))
(defun org-babel-expand-body:python (body params &optional processed-params) (defun org-babel-expand-body:python (body params &optional processed-params)
(let (vars (second (or processed-params (org-babel-process-params params)))) (concat
(concat (mapconcat ;; define any variables
(mapconcat ;; define any variables (lambda (pair)
(lambda (pair) (format "%s=%s"
(format "%s=%s" (car pair)
(car pair) (org-babel-python-var-to-python (cdr pair))))
(org-babel-python-var-to-python (cdr pair)))) (second (or processed-params (org-babel-process-params params))) "\n")
vars "\n") "\n" (org-babel-trim body) "\n"))) "\n" (org-babel-trim body) "\n"))
(defun org-babel-execute:python (body params) (defun org-babel-execute:python (body params)
"Execute a block of Python code with org-babel. This function is "Execute a block of Python code with org-babel. This function is