Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Search found 3 matches

by Nepsir
Tue May 18, 2010 11:12 am
Forum: Coding Corner
Topic: Ignore files using a python script
Replies: 4
Views: 2841

Re: Ignore files using a python script

Pako wrote:

Code: Select all

import shutil
for filename in eg.event.payload:
    if filename.find('!ut') == -1:
        shutil.copy(filename,'D:\\shares\\Downloads\\therenamer\\therenamer TV Shows')
Pako
Again, thank you so much!
It seems to work now.
by Nepsir
Tue May 18, 2010 10:28 am
Forum: Coding Corner
Topic: Ignore files using a python script
Replies: 4
Views: 2841

Re: Ignore files using a python script

import shutil
filename = ''.join(eg.event.payload)
if filename.find('!ut') == -1:
shutil.copy(filename,'D:\\shares\\Downloads\\therenamer\\therenamer TV Shows') Pako


Thank you so much!
Now it seems to ignore files containing !ut but now i get another error when it is a file that doesn't contain ...
by Nepsir
Tue May 18, 2010 8:06 am
Forum: Coding Corner
Topic: Ignore files using a python script
Replies: 4
Views: 2841

Ignore files using a python script

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:
import shutil
filename = ''.join(eg.event.payload)
if filename.find(filename, '!ut') == -1:
shutil.copy ...