[Pythonmac-SIG] [Newbee] Schedule

Francois Granger fgranger@altern.org
Sun, 16 Jul 2000 13:03:17 +0200


I am trying to do a watch folder script. But I find that the 
Macintosh responsivness is not really good during execution. I found 
the instruction
params = MacOS.SchedParams (1, 0, 1, 0.1, 0.25) and lower the 
interval value from 0.25 to 0.1 to make it better responsive, but 
this does not seems enought.

My config is G4 400 with MacOS FU1 9.0.4 and the code is :

#(doint, evtmask, besocial, interval, bgyield)
params = MacOS.SchedParams (1, 0, 1, 0.1, 0.25)
# -- main loop
while 1:
	filesToProcess = []
	filesToProcess = os.listdir(inFolder)
	for file in filesToProcess:
		file = join(inFolder, file)
		print 'processing file : ' , file
		result = process(file)
		if result:
			logAction(file, result)
			print "Moving old to Done ...", file
			temp = findertools.move (file, doneFolder)
		else:
			logAction(file, 'rejected')
			print "Moving old to Rej ...", file
			# -- move to rejected
			temp = findertools.move (file, rejFolder)
-- 
"Computers are like horses; they can sense fear and will act based on
that. Or, look at it like this. If you have a premonition of danger,
maybe you're right." - Adam Engst