From ae9225cf2b731cc1fa5116d73ddef6945af79efd Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Sun, 19 Apr 2015 15:59:10 +0200 Subject: Version 2.0rc1 --- Changelog | 2 +- README | 10 ++++++---- beinc_config_sample.json | 2 +- beinc_generic_client.py | 3 +++ beinc_poller.py | 3 +++ beinc_weechat.py | 17 ++++++++++------- 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Changelog b/Changelog index f678c6e..f89373c 100644 --- a/Changelog +++ b/Changelog @@ -3,7 +3,7 @@ v2.0: - use XMLRPC instead of HTTP POST for a cleaner and more robust API - several ssl options like ssl_version and ssl_ciphers added - bugfixes - + v1.1: - when beinc_poller.py fetches several messages from a queue it won't let the last one to completely overwrite the previous ones diff --git a/README b/README index f3e241e..f15f736 100644 --- a/README +++ b/README @@ -6,8 +6,8 @@ What is BEINC? -------------- Blackmore's Enchanced IRC Notification Collection (BEINC) is a free set of -components that aim to provide a complete system for different on-screen-display -notification scenarios. +components that aims to provide a complete system for different +on-screen-display notification scenarios. The current version of BEINC contains the following components: beinc_server.py - server used for queueing or providing on-screen-display (OSD) @@ -19,7 +19,7 @@ beinc_generic_client.py - a simple client used to push notification messages to beinc_server.py Its main purpose is to provide a convenient way to test beinc_server.py (and beinc_poller.py) as well as - to serve as an example on how to develop BEINC-clients + to serve as an example for how to develop BEINC-clients + documentation and a sample configuration file (beinc_config_sample.json) @@ -93,7 +93,9 @@ All components tested on: Gentoo GNU/Linux 2014,2015, Requirements: -All components: Python 2.7.* (for TLS1.1 and TLS1.2 client support you ned Python>=2.7.9) +All components: Python 2.7.* +N.B. For TLS1.1 and TLS1.2 client support you need Python>=2.7.9 + beinc_server.py: Twisted Web >= 14.0, pyopenssl >= 0.13.0, pynotify >= 0.1 (optional), pyosd >= 0.2 (optional) beinc_weechat.py: Weechat >= 0.4.0 diff --git a/beinc_config_sample.json b/beinc_config_sample.json index ecfe9bb..4384555 100644 --- a/beinc_config_sample.json +++ b/beinc_config_sample.json @@ -38,7 +38,7 @@ "use_current_buffer": 0, "targets": [ { - "name": "weechat_main", + "name": "instance1", "target_url": "https://10.0.0.2:9898", "target_password": "changeme", "target_cert_file": "/home/user/.ca_cert.pem", diff --git a/beinc_generic_client.py b/beinc_generic_client.py index ae4762d..f90164d 100755 --- a/beinc_generic_client.py +++ b/beinc_generic_client.py @@ -76,6 +76,9 @@ class BEINCCustomHTTPSConnection(httplib.HTTPConnection): class BEINCCustomSafeTransport(xmlrpclib.Transport): + """ + Provides an alternative HTTPS transport for clients running on Python<2.7.9 + """ def __init__(self, use_datetime=0, custom_ssl_options={}): xmlrpclib.Transport.__init__(self, use_datetime=use_datetime) diff --git a/beinc_poller.py b/beinc_poller.py index d4eb1e5..31d1a37 100755 --- a/beinc_poller.py +++ b/beinc_poller.py @@ -94,6 +94,9 @@ class BEINCCustomHTTPSConnection(httplib.HTTPConnection): class BEINCCustomSafeTransport(xmlrpclib.Transport): + """ + Provides an alternative HTTPS transport for clients running on Python<2.7.9 + """ def __init__(self, use_datetime=0, custom_ssl_options={}): xmlrpclib.Transport.__init__(self, use_datetime=use_datetime) diff --git a/beinc_weechat.py b/beinc_weechat.py index 1e8afb8..486c4f7 100644 --- a/beinc_weechat.py +++ b/beinc_weechat.py @@ -21,7 +21,6 @@ import datetime import httplib import json import os -import random import socket import ssl import sys @@ -61,6 +60,7 @@ class BEINCCustomHTTPSConnection(httplib.HTTPConnection): allows the server certificate to be validated against CA This functionality lacks in Python < 2.7.9 """ + default_port = httplib.HTTPS_PORT def __init__(self, host, port=None, key_file=None, cert_file=None, @@ -86,6 +86,9 @@ class BEINCCustomHTTPSConnection(httplib.HTTPConnection): class BEINCCustomSafeTransport(xmlrpclib.Transport): + """ + Provides an alternative HTTPS transport for clients running on Python<2.7.9 + """ def __init__(self, use_datetime=0, custom_ssl_options={}): xmlrpclib.Transport.__init__(self, use_datetime=use_datetime) @@ -122,12 +125,10 @@ class WeechatTarget(object): """ self.__name = target_dict.get('name', '') if self.__name == '': - beinc_prnt('WARNING: Adding a target with no name ' - 'will make the target useless') + raise Exception('"name" not defined for target') self.__url = target_dict.get('target_url', '') if self.__url == '': - beinc_prnt('WARNING: Adding a target with no URL ' - 'will make the target useless') + raise Exception('"target_url" not defined for target') self.__password = target_dict.get('target_password', '') self.__pm_title_template = target_dict.get('pm_title_template', '%s @ %S') @@ -723,8 +724,10 @@ if int(version) < 0x00040000: weechat.prnt('', 'WeeChat version >= 0.4.0 is required to run beinc') else: weechat.hook_command('beinc', - 'beinc on off toggle', '', - 'description...', + 'BEINC command', ('< broadcast | on | off |' + ' reload | target >'), + ('Available target actions:\n' + 'disable \nenable \nlist'), 'None', 'beinc_command', '') -- cgit v1.3