emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] ob-python noweb and :var reference error


From: stardiviner
Subject: Re: [O] ob-python noweb and :var reference error
Date: Fri, 29 Dec 2017 20:06:12 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

If I use that noweb reference, then I got this error:

>  File "<stdin>", line 8
>    client = DelugeRPCClient('127.0.0.1', 58846, cat ~/.config/deluge/auth | cut -d ":" -f 1, cat ~/.config/deluge/auth | cut -d ":" -f 2)
                                                     ^
SyntaxError: invalid syntax

This is because the <<deluge-daemon-username>> output is not a string in Python src block.

I also tried to specify `:results` to `value`, `output` and `raw` in `deluge-daemon-password` etc. But none of them works.


On 12/29/2017 07:39 PM, Nicolas Goaziou wrote:
Hello,

stardiviner <address@hidden> writes:

I installed python packages through `pip`:

#+begin_src shell
pip install deluge-client
#+end_src


If you want to test those src blocks, you also need to make sure Deluge
installed and daemon started.

And use `deluge-client` like this:

#+NAME: deluge-daemon-username
#+begin_src shell

cat ~/.config/deluge/auth | cut -d ":" -f 1 #+end_src

#+RESULTS: deluge-daemon-username
: localclient

#+NAME: deluge-daemon-password
#+begin_src shell

cat ~/.config/deluge/auth | cut -d ":" -f 2 #+end_src

#+RESULTS: deluge-daemon-password
: 9b83ceded9ac08cc5c7403b093115874a6086958

#+begin_src python :noweb yes :results list
from deluge_client import DelugeRPCClient

client = DelugeRPCClient('127.0.0.1', 58846, username, password)
Shouldn't this be:

   client = DelugeRPCClient('127.0.0.1', 58846, <<deluge-daemon-username>>, 
<<deluge-daemon-password>>)

Untested.

Regards,





reply via email to

[Prev in Thread] Current Thread [Next in Thread]