From 009d48d285846e64e2eac9879897b9e32d13ed21 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 27 2014 09:44:38 +0000 Subject: Add first (and incomplete) IRC plugin --- diff --git a/progit/hooks/irc.py b/progit/hooks/irc.py new file mode 100644 index 0000000..d2c8132 --- /dev/null +++ b/progit/hooks/irc.py @@ -0,0 +1,62 @@ +#-*- coding: utf-8 -*- + +""" + (c) 2014 - Copyright Red Hat Inc + + Authors: + Pierre-Yves Chibon + +""" + +from . import BaseHook + +from flask.ext import wtf +import wtforms + + +class IrcForm(wtf.Form): + ''' Form to configure the irc hook. ''' + server = wtforms.TextField( + 'Server *', + [wtforms.validators.Required()] + ) + port = wtforms.TextField( + 'Port *', + [wtforms.validators.Required()] + ) + room = wtforms.TextField( + 'Room *', + [wtforms.validators.Required()] + ) + nick = wtforms.TextField( + 'Nick *', + [wtforms.validators.Required()] + ) + nick_pass = wtforms.TextField( + 'Nickserv Password *', + [wtforms.validators.Required()] + ) + + active = wtforms.BooleanField( + 'Acive', + [wtforms.validators.Required()] + ) + join = wtforms.BooleanField( + 'Message Without Join', + [wtforms.validators.Required()] + ) + ssl = wtforms.BooleanField( + 'Use SSL', + [wtforms.validators.Required()] + ) + + +class Hook(BaseHook): + ''' IRC hooks. ''' + + name = 'IRC' + form = IrcForm() + form_fields = [ + 'server', 'port', 'room', 'nick', 'nick_pass', 'active', 'join', + 'ssl' + ]