From b447e9fa78d89abeba180028baf70c37c9513ede Mon Sep 17 00:00:00 2001 From: Thomas Mannay Date: Sun, 30 Oct 2016 15:53:05 +0000 Subject: [PATCH] Add seddy.py, LICENSE, and README --- LICENSE | 27 +++++++++++++++ README.md | 6 +++- seddy.py | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 LICENSE create mode 100644 seddy.py diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..809f783 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright © 2016 Thomas Mannay +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 3f42e2b..a210b50 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # seddy -A sedbot written for tubes +seddy was written to make use of [tubes](https://github.com/sys-fs/tubes). Two +flags are supported: i and g. Due to using Python's re engine, whatever regex +syntax Python knows about should be understood by seddy. + +This project depends on Python 3 and tubes. diff --git a/seddy.py b/seddy.py new file mode 100644 index 0000000..fc8f781 --- /dev/null +++ b/seddy.py @@ -0,0 +1,112 @@ +#!/usr/bin/python3 +# See the LICENSE file for licensing information +import re + +nick = 'seddy' +server = 'chat.freenode.net' +channel = '#example' +gecos = 'A text processing bot' + +receive = open('/tmp/' + server + '.in', 'r') +send = open('/tmp/' + server + '.out', 'w') + +parse_msg = re.compile(' :(.*)') +parse_sed = re.compile('(?