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 <numbch...@gmail.com> 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