From 0680cabd7c963586f732512eb622c85a68865233 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Sun, 14 May 2017 12:59:19 +0200 Subject: Fix a few encoding/decoding and OSD timeout bugs --- beinc_server.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'beinc_server.py') diff --git a/beinc_server.py b/beinc_server.py index 3d9ff35..284f657 100755 --- a/beinc_server.py +++ b/beinc_server.py @@ -125,9 +125,16 @@ class BEINCInstance(object): sys.exit(errno.EPERM) try: self.__osd_notification = pynotify.Notification(' ') - self.__osd_notification.timeout = 1000 * int(instance_dict.get( - 'osd_timeout', 5)) - self.__osd_notification.set_category('im.received') + if PY3: + self.__osd_notification.timeout = 1000 * int( + instance_dict.get('osd_timeout', 5)) + self.__osd_notification.set_category('im.received') + else: + self.__osd_notification.set_timeout( + 1000 * int(instance_dict.get('osd_timeout', 5))) + self.__osd_notification.set_property( + 'app_name', + '{0} {1}'.format(sys.argv[0], __version__)) self.__osd_type = BEINC_OSD_TYPE_PYNOTIFY except Exception as e: sys.stderr.write( -- cgit v1.3