I'm trying to make a python script that will trigger a copy of a file only if the file doesn't contain !ut.
Before the script I have a DirectoryWatcher.Updated
The script looks like this:
Code: Select all
import shutil
filename = ''.join(eg.event.payload)
if filename.find(filename, '!ut') == -1:
shutil.copy(filename,'D:\\shares\\Downloads\\therenamer\\therenamer TV Shows')
Code: Select all
Traceback (most recent call last):
Python script "1", line 3, in <module>
if filename.find(filename, '!ut') == -1:
TypeError: slice indices must be integers or None or have an __index__ method
I'm running 0.3.7.r1462 on a WHS machine.