[Twisted-Python] filewatch.py

Don Smith donwsmith at gmail.com
Mon Dec 20 15:30:07 MST 2004


Greetings!

I'm fairly new to Twisted, but I like it already. However, I'm having
some difficulty with the filewatch.py example.

Actually, I extended it to loop over a list of files and start service
for each. The log files in the list are actually commands to determine
the most recent log file.

But I have a condition where the log files will get rotated
unexpectedly. I would like to re-evaluate my list of log files every
120 seconds. I have figured out a method to accomplish this, but it
just adds the new log files to the service. This is bad. I want to
stop service on all log files, then start service on the new ones.
This is what I can't figure out how to do. How do I stop the service?

This is how I start it:
if os.path.exists(logfile):
	        internet.TimerService(0.1, watch2,
file(logfile),logfile).startService()


Thanks for you help!!

Don Smith




More information about the Twisted-Python mailing list