Using .Popen() and .shlex() to load files to deluge-console

109 Views Asked by At

I am having trouble getting a script to load files via deluge-console using .Popen() and .shlex(). I am using xubuntu and byobu on gnome-terminal.

def torrentLoad(url): #client_run = subprocess.Popen(['deluged']]) sourceList = torrentWrite(sortXML(url)) print(sourceList) for s in sourceList: sleep(2) delugeList = ['deluge-console', 'add', s] load = subprocess.Popen(delugeList, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = load.communicate() print(out, err) The variable sourceList contains functions that parse xml and returns a list of torrent files locations. (e.g. '/home/YOURHOME/Documents/torrents/file.torrent')

In theory this should feed the command: deluge-console add /home/YOURHOME/Documents/torrents/file.torrent directly to terminal. Mind you I am running Byobu as well. I don't know if that would play a part in this or not.

The output I am getting is nodda. Zilch.Thanks for any help.

0

There are 0 best solutions below