dsoprea / PyInotify

An efficient and elegant inotify (Linux filesystem activity monitor) library for Python. Python 2 and 3 compatible.
GNU General Public License v2.0
242 stars 73 forks source link

[Improvement] Adapters: Remove duplicate code #106

Open EsipovPA opened 10 months ago

EsipovPA commented 10 months ago

Current state It seems to me that the code in the methods __load_tree of the inotifyTree and inotifyTrees classes is being duplicated. If I'm not being wrong, it is possible to convert this code into a method of the parent class __BaseTree and add some more parameters for child classes to call it, like debug_message.

Better way to do it? Move duplicated code to __BaseTree class. Maybe do some refactoring.

Motivation Better readability, easier support.

TODO? If nobody is up to this, and nobody is against it, I'm willing to add this myself.