just some cleanups and ideas in hanez.json

This commit is contained in:
Johannes Findeisen 2013-09-19 21:12:03 +02:00
commit 8103e33299
4 changed files with 12 additions and 14 deletions

View file

@ -19,7 +19,7 @@
"class": "tcpconnect",
"args": { "port": 80 },
"periods": ["always"],
"threshold": 10
"threshold": 2
}
]
}
@ -34,6 +34,14 @@
"max_logfile_size": 1024000,
"max_logfile_count": 4,
"max_worker_threads": 8,
"members":[ "root" ]
"members":[ "root" ],
"tasks": {
"jabber":{
"server": "systemchaos.org",
"port": 5222,
"user": "linspector",
"password": "hallo_welt"
}
}
}
}

View file

@ -22,7 +22,7 @@ class JabberTask(Task):
client.connect(server=('systemchaos.org', 5222))
client.auth('linspector', 'PASSWORD', 'alert')
client.sendInitPresence()
message = xmpp.Message('hanez@systemchaos.org', msg)
message = xmpp.Message(self.recipient, msg)
message.setAttr('type', 'chat')
client.send(message)

View file

@ -14,7 +14,7 @@ class SmsTask(Task):
self.set_task_type(kwargs["type"])
self.recipient = kwargs["args"]["rcpt"]
def execute_task(self, msg):
def execute(self, msg):
pass

View file

@ -4,21 +4,11 @@ The task class.
class Task:
"""
Base class for all built-in Tasks.
"""
def set_task_type(self, taskType):
self._taskType = taskType
def get_task_type(self):
"""
:return: the type set by set_type_task
"""
return self._taskType
def some_other_irrelevant_methods(self):
pass
def execute(self, msg):
pass