diff options
| author | Simeon Simeonov | 2015-04-19 15:59:10 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2015-04-19 15:59:10 +0200 |
| commit | ae9225cf2b731cc1fa5116d73ddef6945af79efd (patch) | |
| tree | 7088d3b6057bfb557180cb27432a31e502a5651c | |
| parent | 34846014399f8756962051df02d251b91b65bb0c (diff) | |
Version 2.0rc1v2.0rc1
| -rw-r--r-- | Changelog | 2 | ||||
| -rw-r--r-- | README | 10 | ||||
| -rw-r--r-- | beinc_config_sample.json | 2 | ||||
| -rwxr-xr-x | beinc_generic_client.py | 3 | ||||
| -rwxr-xr-x | beinc_poller.py | 3 | ||||
| -rw-r--r-- | beinc_weechat.py | 17 |
6 files changed, 24 insertions, 13 deletions
| @@ -3,7 +3,7 @@ v2.0: | |||
| 3 | - use XMLRPC instead of HTTP POST for a cleaner and more robust API | 3 | - use XMLRPC instead of HTTP POST for a cleaner and more robust API |
| 4 | - several ssl options like ssl_version and ssl_ciphers added | 4 | - several ssl options like ssl_version and ssl_ciphers added |
| 5 | - bugfixes | 5 | - bugfixes |
| 6 | 6 | ||
| 7 | v1.1: | 7 | v1.1: |
| 8 | - when beinc_poller.py fetches several messages from a queue it won't let the last one to completely overwrite the previous ones | 8 | - when beinc_poller.py fetches several messages from a queue it won't let the last one to completely overwrite the previous ones |
| 9 | 9 | ||
| @@ -6,8 +6,8 @@ What is BEINC? | |||
| 6 | -------------- | 6 | -------------- |
| 7 | 7 | ||
| 8 | Blackmore's Enchanced IRC Notification Collection (BEINC) is a free set of | 8 | Blackmore's Enchanced IRC Notification Collection (BEINC) is a free set of |
| 9 | components that aim to provide a complete system for different on-screen-display | 9 | components that aims to provide a complete system for different |
| 10 | notification scenarios. | 10 | on-screen-display notification scenarios. |
| 11 | 11 | ||
| 12 | The current version of BEINC contains the following components: | 12 | The current version of BEINC contains the following components: |
| 13 | beinc_server.py - server used for queueing or providing on-screen-display (OSD) | 13 | 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 | |||
| 19 | to beinc_server.py | 19 | to beinc_server.py |
| 20 | Its main purpose is to provide a convenient way to | 20 | Its main purpose is to provide a convenient way to |
| 21 | test beinc_server.py (and beinc_poller.py) as well as | 21 | test beinc_server.py (and beinc_poller.py) as well as |
| 22 | to serve as an example on how to develop BEINC-clients | 22 | to serve as an example for how to develop BEINC-clients |
| 23 | + documentation and a sample configuration file (beinc_config_sample.json) | 23 | + documentation and a sample configuration file (beinc_config_sample.json) |
| 24 | 24 | ||
| 25 | 25 | ||
| @@ -93,7 +93,9 @@ All components tested on: Gentoo GNU/Linux 2014,2015, | |||
| 93 | 93 | ||
| 94 | 94 | ||
| 95 | Requirements: | 95 | Requirements: |
| 96 | All components: Python 2.7.* (for TLS1.1 and TLS1.2 client support you ned Python>=2.7.9) | 96 | All components: Python 2.7.* |
| 97 | N.B. For TLS1.1 and TLS1.2 client support you need Python>=2.7.9 | ||
| 98 | |||
| 97 | beinc_server.py: Twisted Web >= 14.0, pyopenssl >= 0.13.0, | 99 | beinc_server.py: Twisted Web >= 14.0, pyopenssl >= 0.13.0, |
| 98 | pynotify >= 0.1 (optional), pyosd >= 0.2 (optional) | 100 | pynotify >= 0.1 (optional), pyosd >= 0.2 (optional) |
| 99 | beinc_weechat.py: Weechat >= 0.4.0 | 101 | 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 @@ | |||
| 38 | "use_current_buffer": 0, | 38 | "use_current_buffer": 0, |
| 39 | "targets": [ | 39 | "targets": [ |
| 40 | { | 40 | { |
| 41 | "name": "weechat_main", | 41 | "name": "instance1", |
| 42 | "target_url": "https://10.0.0.2:9898", | 42 | "target_url": "https://10.0.0.2:9898", |
| 43 | "target_password": "changeme", | 43 | "target_password": "changeme", |
| 44 | "target_cert_file": "/home/user/.ca_cert.pem", | 44 | "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): | |||
| 76 | 76 | ||
| 77 | 77 | ||
| 78 | class BEINCCustomSafeTransport(xmlrpclib.Transport): | 78 | class BEINCCustomSafeTransport(xmlrpclib.Transport): |
| 79 | """ | ||
| 80 | Provides an alternative HTTPS transport for clients running on Python<2.7.9 | ||
| 81 | """ | ||
| 79 | 82 | ||
| 80 | def __init__(self, use_datetime=0, custom_ssl_options={}): | 83 | def __init__(self, use_datetime=0, custom_ssl_options={}): |
| 81 | xmlrpclib.Transport.__init__(self, use_datetime=use_datetime) | 84 | 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): | |||
| 94 | 94 | ||
| 95 | 95 | ||
| 96 | class BEINCCustomSafeTransport(xmlrpclib.Transport): | 96 | class BEINCCustomSafeTransport(xmlrpclib.Transport): |
| 97 | """ | ||
| 98 | Provides an alternative HTTPS transport for clients running on Python<2.7.9 | ||
| 99 | """ | ||
| 97 | 100 | ||
| 98 | def __init__(self, use_datetime=0, custom_ssl_options={}): | 101 | def __init__(self, use_datetime=0, custom_ssl_options={}): |
| 99 | xmlrpclib.Transport.__init__(self, use_datetime=use_datetime) | 102 | 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 | |||
| 21 | import httplib | 21 | import httplib |
| 22 | import json | 22 | import json |
| 23 | import os | 23 | import os |
| 24 | import random | ||
| 25 | import socket | 24 | import socket |
| 26 | import ssl | 25 | import ssl |
| 27 | import sys | 26 | import sys |
| @@ -61,6 +60,7 @@ class BEINCCustomHTTPSConnection(httplib.HTTPConnection): | |||
| 61 | allows the server certificate to be validated against CA | 60 | allows the server certificate to be validated against CA |
| 62 | This functionality lacks in Python < 2.7.9 | 61 | This functionality lacks in Python < 2.7.9 |
| 63 | """ | 62 | """ |
| 63 | |||
| 64 | default_port = httplib.HTTPS_PORT | 64 | default_port = httplib.HTTPS_PORT |
| 65 | 65 | ||
| 66 | def __init__(self, host, port=None, key_file=None, cert_file=None, | 66 | def __init__(self, host, port=None, key_file=None, cert_file=None, |
| @@ -86,6 +86,9 @@ class BEINCCustomHTTPSConnection(httplib.HTTPConnection): | |||
| 86 | 86 | ||
| 87 | 87 | ||
| 88 | class BEINCCustomSafeTransport(xmlrpclib.Transport): | 88 | class BEINCCustomSafeTransport(xmlrpclib.Transport): |
| 89 | """ | ||
| 90 | Provides an alternative HTTPS transport for clients running on Python<2.7.9 | ||
| 91 | """ | ||
| 89 | 92 | ||
| 90 | def __init__(self, use_datetime=0, custom_ssl_options={}): | 93 | def __init__(self, use_datetime=0, custom_ssl_options={}): |
| 91 | xmlrpclib.Transport.__init__(self, use_datetime=use_datetime) | 94 | xmlrpclib.Transport.__init__(self, use_datetime=use_datetime) |
| @@ -122,12 +125,10 @@ class WeechatTarget(object): | |||
| 122 | """ | 125 | """ |
| 123 | self.__name = target_dict.get('name', '') | 126 | self.__name = target_dict.get('name', '') |
| 124 | if self.__name == '': | 127 | if self.__name == '': |
| 125 | beinc_prnt('WARNING: Adding a target with no name ' | 128 | raise Exception('"name" not defined for target') |
| 126 | 'will make the target useless') | ||
| 127 | self.__url = target_dict.get('target_url', '') | 129 | self.__url = target_dict.get('target_url', '') |
| 128 | if self.__url == '': | 130 | if self.__url == '': |
| 129 | beinc_prnt('WARNING: Adding a target with no URL ' | 131 | raise Exception('"target_url" not defined for target') |
| 130 | 'will make the target useless') | ||
| 131 | self.__password = target_dict.get('target_password', '') | 132 | self.__password = target_dict.get('target_password', '') |
| 132 | self.__pm_title_template = target_dict.get('pm_title_template', | 133 | self.__pm_title_template = target_dict.get('pm_title_template', |
| 133 | '%s @ %S') | 134 | '%s @ %S') |
| @@ -723,8 +724,10 @@ if int(version) < 0x00040000: | |||
| 723 | weechat.prnt('', 'WeeChat version >= 0.4.0 is required to run beinc') | 724 | weechat.prnt('', 'WeeChat version >= 0.4.0 is required to run beinc') |
| 724 | else: | 725 | else: |
| 725 | weechat.hook_command('beinc', | 726 | weechat.hook_command('beinc', |
| 726 | 'beinc on off toggle', '<on | off | reload>', | 727 | 'BEINC command', ('< broadcast <message> | on | off |' |
| 727 | 'description...', | 728 | ' reload | target <action> >'), |
| 729 | ('Available target actions:\n' | ||
| 730 | 'disable <target name>\nenable <target name>\nlist'), | ||
| 728 | 'None', | 731 | 'None', |
| 729 | 'beinc_command', | 732 | 'beinc_command', |
| 730 | '') | 733 | '') |
