diff options
| author | Simeon Simeonov | 2017-05-14 12:59:19 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2017-05-14 12:59:19 +0200 |
| commit | 0680cabd7c963586f732512eb622c85a68865233 (patch) | |
| tree | 4e0dd9d71652f52413b29b7fadabd29fd6ea0431 /beinc_server.py | |
| parent | 06136d21f73eb26c8fc516b257345a87540ed658 (diff) | |
Fix a few encoding/decoding and OSD timeout bugs
Diffstat (limited to 'beinc_server.py')
| -rwxr-xr-x | beinc_server.py | 13 |
1 files changed, 10 insertions, 3 deletions
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): | |||
| 125 | sys.exit(errno.EPERM) | 125 | sys.exit(errno.EPERM) |
| 126 | try: | 126 | try: |
| 127 | self.__osd_notification = pynotify.Notification(' ') | 127 | self.__osd_notification = pynotify.Notification(' ') |
| 128 | self.__osd_notification.timeout = 1000 * int(instance_dict.get( | 128 | if PY3: |
| 129 | 'osd_timeout', 5)) | 129 | self.__osd_notification.timeout = 1000 * int( |
| 130 | self.__osd_notification.set_category('im.received') | 130 | instance_dict.get('osd_timeout', 5)) |
| 131 | self.__osd_notification.set_category('im.received') | ||
| 132 | else: | ||
| 133 | self.__osd_notification.set_timeout( | ||
| 134 | 1000 * int(instance_dict.get('osd_timeout', 5))) | ||
| 135 | self.__osd_notification.set_property( | ||
| 136 | 'app_name', | ||
| 137 | '{0} {1}'.format(sys.argv[0], __version__)) | ||
| 131 | self.__osd_type = BEINC_OSD_TYPE_PYNOTIFY | 138 | self.__osd_type = BEINC_OSD_TYPE_PYNOTIFY |
| 132 | except Exception as e: | 139 | except Exception as e: |
| 133 | sys.stderr.write( | 140 | sys.stderr.write( |
