Help request - plugin won't execute py scripts (Windows)

Suggest, post, or discuss plugins for Deluge
Post Reply
Whitestrake

Help request - plugin won't execute py scripts (Windows)

Post by Whitestrake »

Hi all,

I'm trying to get execute to run a python script. I'd just use batch, except I'm not keen on the cmd window stealing focus. I'm on Windows 8.1 with client 1.3.11 and libtorrent 0.16.18.0.

The following work fine from cmd line and produce expected results:
python G:\\test-added.pyw
G:\\test-added.pyw
G:\\test.bat

However when set up like this, the batch file runs, but the python script doesn't. When set up the opposite way (.pyw first), neither run. The same effect occurs with .py files. I'm not sure where to go from here.

Here is the contents of my execute.conf:

Code: Select all

{
  "file": 1, 
  "format": 1
}{
  "commands": [
    [
      "f7b8a29d3bf2f953508f08cad79a68c98d625ce7", 
      "added", 
      "G:\\test.bat"
    ], 
    [
      "528e5d7a943b7353526a7f54d730a9ce7a93ff25", 
      "added", 
      "G:\\test-added.pyw"
    ]
  ]
}
For reference, the batch file ("test.bat"):

Code: Select all

@echo off
set torrentid=%1
set torrentname=%2
set torrentpath=%3
@echo Torrent Details:  %torrentname% %torrentpath% %torrentid%  >> G:\test-bat.txt
And the python script ("test-added.pyw"):

Code: Select all

from sys import argv
import os
f = open('G:\\test-py.txt', 'w')
f.write('Torrent added: ')
for arg in argv[1:]:
	f.write(arg + ' ')
f.write('\n')
f.close()
Post Reply