This present the usage of QFileSystemWatcher Class which monitors the file system for changes to files and directories by watching a list of specified paths. When the file that is monitored is changed in some way, a signal is emited and with the help of smtplib — SMTP protocol client an email is send tot an specific address. For simplicity, an User Interface was created with PyQt4.
I'll asume you already have installed python 3.x, now install PyQt4. PyQt4 is now deprecated, but you can download the right .whl file for your OS from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyqt4 and use:
pip install filename.whlAll the data, like password, sender email, reciver email and so on are stored in a configuration file (*.ini). When the program is started all the data from the config. file are loaded, those data can be alterated to form a new config. file. This is the first step, open the config file whith any txt editor and complet all fields (the path for the file can be completed from UI, so leave it blank for now). After this, sust run:
python main.pyin the repo folder. The UI will apear on screen. Now select the file you want to be monitored and now just... wait? The UI and also the config file have a field for delay. This delay is a "countdown" which start after any modification are made on the watched file, only after all the seconds from the delay spinbox are passed the email is send to a specified address.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature) - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Vesa Bogdan - vesabogdan95@gmail.com
Project Link: https://github.com/VRB95/EmailTrigger_OnFileChange