Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Cross platform config auto reload #326
First of all thanks for adding support (even if experimental) for the auto config reload!
Unfortunately pyinotify is not supported on the likes of OS X, limiting the use of the feature for those of us developing on OS X. Not only can one not install pyinotify on OS X, once you register
without conditional OS logic, an app will error out on OS X, because of the dependency missing.
Have you maybe looked at watchdog as a cross platform alternative?
Thanks a lot for all the work you are putting into this!
I've begun playing around with
My thoughts are:
from cement.core.foundation import CementApp def reload_app_if_config_changes(app, modified_path): if modified_path in app._meta.config_files: app.reload() class MyApp(CementApp) class Meta: extensions = ['watchdog'] with MyApp() as app: for path in app._meta.config_files: app.watchdog.add(path) app.hook.register('watchdog_path_modified', reload_app_if_config_changes) app.run()
This is just a mockup... but essentially... A) Ability to add files/dirs to watch, and B) tie in with hooks that can operate if anything chnages (that we're watching).. and if those are config files, call
Not sure how this will work... I tried with
Will try and work on this this week, but might not make it into 2.8.x.
added a commit
Jul 13, 2016
@fxstein I've added the
There are some caveats. The first being that with the default list of config files, we'd end up watching the users entire home directory because of the default path of
Will be working on a proper example... which may or may not replace the