New Monitor class

2 views
Skip to first unread message

Olof Bjarnason

unread,
Mar 7, 2012, 3:04:05 AM3/7/12
to pytd...@googlegroups.com
Hi all!

I've reimplemented the monitoring/change detection functionality of pytddmon.

So far it is not integrated into pytddmon, I just developed it separately.

The idea was to skip the "hashing" completely, and just take a
'snapshot' of the current file system, as viewed by pytddmon. Then,
when asked by pytddmon to look for changes, just take another
'snapshot' and compare them, to see if anything changed.

Technically the snapshot is a dictionary file -> (size, modtime).

I've written 6 unit tests for it (no change, size change, file rename,
new file, modtime change, change only detected once).

Here's a paste of the file:

http://pastebin.com/rwkE3HUf

What do you think?

Samuel Ytterbrink

unread,
Mar 7, 2012, 10:27:01 AM3/7/12
to pytd...@googlegroups.com

With only looking at the email.
+5
elegant!

Rafael Capucho

unread,
Mar 7, 2012, 8:12:00 PM3/7/12
to pytd...@googlegroups.com
Very good job Olof,

Congrats.

--
Rafael Capucho
Acrescentar Consultoria & Planejamento
www.acrescentar.com

PGP-Public Key: 2048R/7389A96F pgp.mit.edu
FP: EDB5 CDEE 8442 99CC C92D 9173 6B32 A5C9 7389 A96F

Olof Bjarnason

unread,
Mar 8, 2012, 4:04:33 AM3/8/12
to pytd...@googlegroups.com
Thanks Samuel and Rafael!

2012/3/8 Rafael Capucho <rafael....@gmail.com>:

Reply all
Reply to author
Forward
0 new messages