Ignore files using a python script
Posted: Tue May 18, 2010 8:06 am
Hi!
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:
I'm getting the following error messages in the log:
I think it's my lack in scripting that is the problem here...
I'm running 0.3.7.r1462 on a WHS machine.
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__ methodI'm running 0.3.7.r1462 on a WHS machine.