Re: [O] remote plot with local output?

2015-09-18 Thread Charles C. Berry
On Fri, 18 Sep 2015, Benda Xu wrote: Hi, Benda Xu writes: "Charles C. Berry" writes: Untested, but try this : #+name: localize #+BEGIN_SRC emacs-lisp :var file="" srcinfo=(org-babel-get-src-block-info) (let* ((dir (cdr (assoc :dir (nth 2 srcinfo (rfile (concat (file-name

Re: [O] remote plot with local output?

2015-09-18 Thread Benda Xu
Hi, Benda Xu writes: > "Charles C. Berry" writes: > >> Untested, but try this : >> >> #+name: localize >> #+BEGIN_SRC emacs-lisp :var file="" srcinfo=(org-babel-get-src-block-info) >>(let* ((dir (cdr (assoc :dir (nth 2 srcinfo >> (rfile (concat (file-name-as-directory dir) fil

Re: [O] remote plot with local output?

2015-09-16 Thread Benda Xu
Hi Suvayu, Suvayu Ali writes: > Maybe, you could do all that in your python source block? You could use > the :file header to specify where the plot gets copied to on the local > filesystem. > > WDYT? I did think of putting the logic into python source block. As I will also have R block like

Re: [O] remote plot with local output?

2015-09-15 Thread Benda Xu
Hi Charles, "Charles C. Berry" writes: > Untested, but try this : > > #+name: localize > #+BEGIN_SRC emacs-lisp :var file="" srcinfo=(org-babel-get-src-block-info) >(let* ((dir (cdr (assoc :dir (nth 2 srcinfo > (rfile (concat (file-name-as-directory dir) file)) > (lfi

Re: [O] remote plot with local output?

2015-09-15 Thread Charles C. Berry
On Tue, 15 Sep 2015, Benda Xu wrote: Hi Charles, "Charles C. Berry" writes: Look at the :post header arg (info "(org) post") You write a src block that extracts the remote file name from *this*, creates a local file name from it, copies the remote file to the local host, then subst

Re: [O] remote plot with local output?

2015-09-15 Thread Benda Xu
Hi Suvayu, Suvayu Ali writes: > Maybe, you could do all that in your python source block? You could use > the :file header to specify where the plot gets copied to on the local > filesystem. > > WDYT? I did think of putting the logic into python source block. As I will also have R block like

Re: [O] remote plot with local output?

2015-09-15 Thread Benda Xu
Hi Charles, "Charles C. Berry" writes: > Look at the :post header arg > > (info "(org) post") > > You write a src block that extracts the remote file name from *this*, > creates a local file name from it, copies the remote file to the local > host, then substitutes the local file name in *

Re: [O] remote plot with local output?

2015-09-14 Thread Charles C. Berry
On Tue, 15 Sep 2015, Benda Xu wrote: Dear All, I am looking for a way to configure org-babel so that a program runs remotely and outputs locally. An example is #+NAME: line | 1 | | 2 | | 3 | #+BEGIN_SRC python :results file :var dt=line :dir /ipmuap02:/tmp from matplotlib import p

Re: [O] remote plot with local output?

2015-09-14 Thread Suvayu Ali
On Tue, Sep 15, 2015 at 12:11:03AM +0900, Benda Xu wrote: > > My solution is to cache the result (:cache yes), execute the code block, > copy the output file to localhost, update the #+RESULTS link to the > local one, manually. Now I am facing many such tasks and feel like > automating that. May

[O] remote plot with local output?

2015-09-14 Thread Benda Xu
Dear All, I am looking for a way to configure org-babel so that a program runs remotely and outputs locally. An example is #+NAME: line | 1 | | 2 | | 3 | #+BEGIN_SRC python :results file :var dt=line :dir /ipmuap02:/tmp from matplotlib import pylab as plt plt.plot(dt) p