From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miguel Ruiz Subject: Re: bug in 8.2.5f for using tables as data in python? Date: Wed, 22 Jan 2014 15:58:53 +0000 (GMT) Message-ID: <1390406333.80620.YahooMailNeo@web171303.mail.ir2.yahoo.com> References: <1390394132.49030.YahooMailNeo@web171302.mail.ir2.yahoo.com> <1390394500.74076.YahooMailNeo@web171303.mail.ir2.yahoo.com> <877g9s6qqh.fsf@bzg.ath.cx> Reply-To: Miguel Ruiz Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="-1953309981-898188097-1390406333=:80620" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W60FT-0002wc-Ty for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 11:01:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W60FK-0007qN-1R for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 11:01:51 -0500 Received: from nm41.bullet.mail.ne1.yahoo.com ([98.138.120.48]:42930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W60FJ-0007my-OU for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 11:01:41 -0500 In-Reply-To: <877g9s6qqh.fsf@bzg.ath.cx> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: "emacs-orgmode@gnu.org" ---1953309981-898188097-1390406333=:80620 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Sorry, Bastien=0A=0AAt this moment, in ob-python.el you can see:=0A=0A=0A(d= efun org-babel-python-var-to-python (var) "Convert an elisp value to a pyth= on variable.=0AConvert an elisp value, VAR, into a string of python source = code=0Aspecifying a variable of the same value." (if (listp var) (concat "[= " (mapconcat #'org-babel-python-var-to-python var ", ") "]") (if (equal var= 'hline) org-babel-python-hline-to (format (if (and (stringp var) (string-m= atch "[\n\r]" var)) "\"\"%S\"\"" "%S") (substring-no-properties var)))))=0A= But I understand that Daniel Gerber's proposal is (note the last line):=0A= =0A=0A(defun org-babel-python-var-to-python (var) "Convert an elisp value t= o a python variable.=0AConvert an elisp value, VAR, into a string of python= source code=0Aspecifying a variable of the same value." (if (listp var) (c= oncat "[" (mapconcat #'org-babel-python-var-to-python var ", ") "]") (if (e= qual var 'hline) org-babel-python-hline-to (format (if (and (stringp var) (= string-match "[\n\r]" var)) "\"\"%S\"\"" "%S") (if (stringp var) (substring= -no-properties var) var)))))=0A=0AAnd, related to the problem of the OP, th= is last code works for me.=0A=0AMiguel=0A=0A=0A=0A=0AEl Mi=E9rcoles 22 de e= nero de 2014 15:23, Bastien escribi=F3:=0A =0AHi Miguel,=0A= =0A=0AMiguel Ruiz writes:=0A=0A> Could it be a poorly r= ewritten patch? Original Daniel Gerber's=0A> proposal works for me.=0A=0ACa= n you tell what's wrong in the current version of ob-python.el=0Afrom git r= epo?=A0 Otherwise I'm not sure to understand.=0A=0AThanks,=0A=0A-- =0ABasti= en ---1953309981-898188097-1390406333=:80620 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Sorry, Ba= stien

At this moment, in ob-python.el you can see:

(defu=
n org-babel-python-var-to-python (var)=0A  "Convert an elisp value to a pyt=
hon variable.=0AConvert an elisp value, VAR, into a string of python source=
 code=0Aspecifying a variable of the same value."=0A  (if (listp var)=0A   =
   (concat "[" (mapconcat #'org-babel-python-var-to-python var ", ") "]")=
=0A    (if (equal var 'hline)=0A=09org-babel-python-hline-to=0A      (forma=
t=0A       (if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%S\"\""=
 "%S")=0A       (substring-no-properties var)))))

But I understand= that Daniel Gerber's proposal is (note the last line):

<= pre>(defun org-babel-python-var-to-python (var)=0A "Convert an elisp value= to a python variable.=0AConvert an elisp value, VAR, into a string of pyth= on source code=0Aspecifying a variable of the same value."=0A (if (listp v= ar)=0A (concat "[" (mapconcat #'org-babel-python-var-to-python var ", = ") "]")=0A (if (equal var 'hline)=0A=09org-babel-python-hline-to=0A = (format=0A (if (and (stringp var) (string-match "[\n\r]" var)) "\"\"= %S\"\"" "%S")=0A (if (stringp var) (substring-no-properties var) var)= ))))

And, related to the problem of the OP, this last code works for= me.

Miguel


El Mi=E9rc= oles 22 de enero de 2014 15:23, Bastien <bzg@gnu.org> escribi=F3:
=
Hi Miguel,

Miguel = Ruiz <rbenit68@yahoo.es> writes:
=
> Could it be a poorly rewritten patch? Original Dani= el Gerber's
> proposal works for me.


Can you tell what= 's wrong in the current version of ob-python.el
from git = repo?  Otherwise I'm not sure to understand.

Thanks,

--
Bastien




---1953309981-898188097-1390406333=:80620--