diff options
| -rwxr-xr-x | beinc_poller.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/beinc_poller.py b/beinc_poller.py index b4e798f..cd1bd10 100755 --- a/beinc_poller.py +++ b/beinc_poller.py | |||
| @@ -71,8 +71,14 @@ def display_notification(args, title, message): | |||
| 71 | raise Exception('There was a problem with libnotify\n') | 71 | raise Exception('There was a problem with libnotify\n') |
| 72 | notification_obj = pynotify.Notification(summary=title, | 72 | notification_obj = pynotify.Notification(summary=title, |
| 73 | message=message) | 73 | message=message) |
| 74 | notification_obj.timeout = 1000 * args.osd_timeout | 74 | if PY3: |
| 75 | notification_obj.set_category('im.received') | 75 | notification_obj.timeout = 1000 * args.osd_timeout |
| 76 | notification_obj.set_category('im.received') | ||
| 77 | else: | ||
| 78 | notification_obj.set_timeout(1000 * args.osd_timeout) | ||
| 79 | notification_obj.set_property( | ||
| 80 | 'app_name', | ||
| 81 | '{0} {1}'.format(sys.argv[0], __version__)) | ||
| 76 | notification_obj.show() | 82 | notification_obj.show() |
| 77 | else: | 83 | else: |
| 78 | raise Exception( | 84 | raise Exception( |
