diff options
| author | Simeon Simeonov | 2014-05-08 22:52:20 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2014-05-08 22:52:20 +0200 |
| commit | 81cf914085c509b3ec0d5407c3572ce1c22c14bc (patch) | |
| tree | 325d13807fc01d72b8944b38f0eae573a17a0b82 | |
| parent | f29504285598af79076c981985dccb1d2033efd4 (diff) | |
A few fixes and bugfixes
| -rw-r--r-- | beinc_server.json | 10 | ||||
| -rwxr-xr-x | beinc_server.py | 3 | ||||
| -rw-r--r-- | beinc_weechat.py | 20 |
3 files changed, 12 insertions, 21 deletions
diff --git a/beinc_server.json b/beinc_server.json index a6c5e0d..4c50fff 100644 --- a/beinc_server.json +++ b/beinc_server.json | |||
| @@ -44,15 +44,5 @@ | |||
| 44 | } | 44 | } |
| 45 | ] | 45 | ] |
| 46 | }, | 46 | }, |
| 47 | "poller": { | ||
| 48 | "target_url": "https://10.0.0.2:9898/pull/secondtest", | ||
| 49 | "target_password": "changeme", | ||
| 50 | "target_cert_file": "", | ||
| 51 | "polling_interval": 5, | ||
| 52 | "osd_system": "pynotify", | ||
| 53 | "osd_timeout": 5000, | ||
| 54 | "daemonize": 1, | ||
| 55 | "debug": 1, | ||
| 56 | }, | ||
| 57 | "config_version": 1 | 47 | "config_version": 1 |
| 58 | } | 48 | } |
diff --git a/beinc_server.py b/beinc_server.py index 1ed5563..64e21f5 100755 --- a/beinc_server.py +++ b/beinc_server.py | |||
| @@ -275,12 +275,13 @@ def main(): | |||
| 275 | sys.stderr.write('Unable to parse {0}: {1}'.format(args.config_file, | 275 | sys.stderr.write('Unable to parse {0}: {1}'.format(args.config_file, |
| 276 | e)) | 276 | e)) |
| 277 | sys.exit(errno.EIO) | 277 | sys.exit(errno.EIO) |
| 278 | ssl_module = config_dict['server']['general']['ssl_module'].encode('utf-8') | ||
| 278 | ssl_certificate = config_dict['server']['general']['ssl_certificate'] | 279 | ssl_certificate = config_dict['server']['general']['ssl_certificate'] |
| 279 | ssl_private_key = config_dict['server']['general']['ssl_private_key'] | 280 | ssl_private_key = config_dict['server']['general']['ssl_private_key'] |
| 280 | cherrypy.config.update({ | 281 | cherrypy.config.update({ |
| 281 | 'server.socket_host': args.hostname, | 282 | 'server.socket_host': args.hostname, |
| 282 | 'server.socket_port': args.port, | 283 | 'server.socket_port': args.port, |
| 283 | 'server.ssl_module': config_dict['server']['general']['ssl_module'], | 284 | 'server.ssl_module': ssl_module, |
| 284 | 'server.ssl_certificate': ssl_certificate, | 285 | 'server.ssl_certificate': ssl_certificate, |
| 285 | 'server.ssl_private_key': ssl_private_key, | 286 | 'server.ssl_private_key': ssl_private_key, |
| 286 | 'tools.encode.on': True, | 287 | 'tools.encode.on': True, |
diff --git a/beinc_weechat.py b/beinc_weechat.py index 8462b76..b0a7cdc 100644 --- a/beinc_weechat.py +++ b/beinc_weechat.py | |||
| @@ -194,7 +194,7 @@ class WeechatTarget(object): | |||
| 194 | 'message': message_str, | 194 | 'message': message_str, |
| 195 | 'password': self.__password} | 195 | 'password': self.__password} |
| 196 | data = urllib.urlencode(post_values) | 196 | data = urllib.urlencode(post_values) |
| 197 | if self.__send_beinc_message(data) and self.__debug: | 197 | if not self.__send_beinc_message(data) and self.__debug: |
| 198 | beinc_prnt( | 198 | beinc_prnt( |
| 199 | 'BEINC DEBUG: send_private_message_notification-ERROR ' | 199 | 'BEINC DEBUG: send_private_message_notification-ERROR ' |
| 200 | 'for "{0}": __send_beinc_message -> False'.format( | 200 | 'for "{0}": __send_beinc_message -> False'.format( |
| @@ -218,7 +218,7 @@ class WeechatTarget(object): | |||
| 218 | 'message': message_str, | 218 | 'message': message_str, |
| 219 | 'password': self.__password} | 219 | 'password': self.__password} |
| 220 | data = urllib.urlencode(post_values) | 220 | data = urllib.urlencode(post_values) |
| 221 | if self.__send_beinc_message(data) and self.__debug: | 221 | if not self.__send_beinc_message(data) and self.__debug: |
| 222 | beinc_prnt( | 222 | beinc_prnt( |
| 223 | 'BEINC DEBUG: send_channel_message_notification-ERROR ' | 223 | 'BEINC DEBUG: send_channel_message_notification-ERROR ' |
| 224 | 'for "{0}": __send_beinc_message -> False'.format( | 224 | 'for "{0}": __send_beinc_message -> False'.format( |
| @@ -242,7 +242,7 @@ class WeechatTarget(object): | |||
| 242 | 'message': message_str, | 242 | 'message': message_str, |
| 243 | 'password': self.__password} | 243 | 'password': self.__password} |
| 244 | data = urllib.urlencode(post_values) | 244 | data = urllib.urlencode(post_values) |
| 245 | if self.__send_beinc_message(data) and self.__debug: | 245 | if not self.__send_beinc_message(data) and self.__debug: |
| 246 | beinc_prnt( | 246 | beinc_prnt( |
| 247 | 'BEINC DEBUG: send_notify_message_notification-ERROR ' | 247 | 'BEINC DEBUG: send_notify_message_notification-ERROR ' |
| 248 | 'for "{0}": __send_beinc_message -> False'.format( | 248 | 'for "{0}": __send_beinc_message -> False'.format( |
| @@ -387,7 +387,7 @@ def beinc_privmsg_handler(data, signal, signal_data): | |||
| 387 | if not global_values['global_private_messages_policy']: | 387 | if not global_values['global_private_messages_policy']: |
| 388 | return weechat.WEECHAT_RC_OK | 388 | return weechat.WEECHAT_RC_OK |
| 389 | p_messages_policy = global_values['global_private_messages_policy'] | 389 | p_messages_policy = global_values['global_private_messages_policy'] |
| 390 | if p_messages_policy == BEINC_POLICY_LIST_ONLY and | 390 | if p_messages_policy == BEINC_POLICY_LIST_ONLY and \ |
| 391 | '{0}.{1}'.format( | 391 | '{0}.{1}'.format( |
| 392 | ph_values['server'], | 392 | ph_values['server'], |
| 393 | ph_values['source_nick'].lower() | 393 | ph_values['source_nick'].lower() |
| @@ -396,9 +396,9 @@ def beinc_privmsg_handler(data, signal, signal_data): | |||
| 396 | for target in target_list: | 396 | for target in target_list: |
| 397 | if not target.enabled: | 397 | if not target.enabled: |
| 398 | continue | 398 | continue |
| 399 | if target.private_messages_policy == BEINC_POLICY_ALL or | 399 | if target.private_messages_policy == BEINC_POLICY_ALL or \ |
| 400 | ( | 400 | ( |
| 401 | target.private_messages_policy == BEINC_POLICY_LIST_ONLY and | 401 | target.private_messages_policy == BEINC_POLICY_LIST_ONLY and \ |
| 402 | '{0}.{1}'.format( | 402 | '{0}.{1}'.format( |
| 403 | ph_values['server'], | 403 | ph_values['server'], |
| 404 | ph_values['source_nick'].lower()) in target.nicks | 404 | ph_values['source_nick'].lower()) in target.nicks |
| @@ -409,7 +409,7 @@ def beinc_privmsg_handler(data, signal, signal_data): | |||
| 409 | if not global_values['global_notifications_policy']: | 409 | if not global_values['global_notifications_policy']: |
| 410 | return weechat.WEECHAT_RC_OK | 410 | return weechat.WEECHAT_RC_OK |
| 411 | notifications_policy = global_values['global_notifications_policy'] | 411 | notifications_policy = global_values['global_notifications_policy'] |
| 412 | if notifications_policy == BEINC_POLICY_LIST_ONLY and | 412 | if notifications_policy == BEINC_POLICY_LIST_ONLY and \ |
| 413 | ( | 413 | ( |
| 414 | '{0}.{1}'.format( | 414 | '{0}.{1}'.format( |
| 415 | ph_values['server'], | 415 | ph_values['server'], |
| @@ -432,7 +432,7 @@ def beinc_privmsg_handler(data, signal, signal_data): | |||
| 432 | if not global_values['global_notifications_policy']: | 432 | if not global_values['global_notifications_policy']: |
| 433 | return weechat.WEECHAT_RC_OK | 433 | return weechat.WEECHAT_RC_OK |
| 434 | c_messages_policy = global_values['global_channel_messages_policy'] | 434 | c_messages_policy = global_values['global_channel_messages_policy'] |
| 435 | if c_messages_policy == BEINC_POLICY_LIST_ONLY and | 435 | if c_messages_policy == BEINC_POLICY_LIST_ONLY and \ |
| 436 | ( | 436 | ( |
| 437 | '{0}.{1}'.format( | 437 | '{0}.{1}'.format( |
| 438 | ph_values['server'], | 438 | ph_values['server'], |
| @@ -443,9 +443,9 @@ def beinc_privmsg_handler(data, signal, signal_data): | |||
| 443 | for target in target_list: | 443 | for target in target_list: |
| 444 | if not target.enabled: | 444 | if not target.enabled: |
| 445 | continue | 445 | continue |
| 446 | if target.channel_messages_policy == BEINC_POLICY_ALL or | 446 | if target.channel_messages_policy == BEINC_POLICY_ALL or \ |
| 447 | ( | 447 | ( |
| 448 | target.channel_messages_policy == BEINC_POLICY_LIST_ONLY and | 448 | target.channel_messages_policy == BEINC_POLICY_LIST_ONLY and \ |
| 449 | '{0}.{1}'.format( | 449 | '{0}.{1}'.format( |
| 450 | ph_values['server'], | 450 | ph_values['server'], |
| 451 | ph_values['channel'].lower()) in target.chans | 451 | ph_values['channel'].lower()) in target.chans |
