hyde / hyde-old

Static website generator inspired by Jekyll
http://ringce.com/hyde
MIT License
875 stars 81 forks source link

enable notification on linux with pynotify/libnotify #23

Open solsticedhiver opened 14 years ago

solsticedhiver commented 14 years ago

by loooking carefully at the default settings.py I noticed a setting to enable growl notification.

so i added a few lines here and there to enable notification via pynotify (which uses libnotify)

This is not really an important feature ;-)

one can use PYNOTIFY = True in settings.py and install pynotify --- a/hydeengine/init.py +++ b/hydeengine/init.py @@ -25,6 +25,13 @@ from file_system import File, Folder from path_util import PathUtil from processor import Processor from siteinfo import SiteInfo +try:

 class _HydeDefaults:

@@ -248,6 +255,8 @@ class Generator(object):
                 subprocess.call([settings.GROWL, "-n", "Hyde", "-t", title, "-m", message])        
             except:
                 pass    
+        if hasattr(settings, "PYNOTIFY") and settings.PYNOTIFY and PYNOTIFY:
+            pynotify.Notification(title, message, None).show()

     def pre_process(self, node):
         self.processor.pre_process(node)

None is for the icon as there is none for hyde ???

navilan commented 14 years ago

Nice. Will add in the patch.

Hyde has an icon. I should probably add it to the Hyde repository ;)