Notifications

This commit is contained in:
Ruud committed 2011-04-09 20:18:51 +02:00
1 parent 288aa8c0a1
commit 85fc1c01ee
67 files changed
+3270 -400

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
from couchpotato.core.event import addEvent
from couchpotato.core.helpers.request import jsonified
from couchpotato.core.plugins.base import Plugin
from couchpotato.environment import Env
class Notification(Plugin):
default_title = 'CouchPotato'
test_message = 'ZOMG Lazors Pewpewpew!'
def __init__(self):
addEvent('notify', self.notify)
def notify(self, message = '', data = {}):
pass
def conf(self, attr):
return Env.setting(attr, self.__class__.__name__.lower())
def isDisabled(self):
return not self.isEnabled()
def isEnabled(self):
return self.conf('enabled', True)
def test(self):
success = self.notify(message = self.test_message)
return jsonified({'success': success})