3# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
5# Unity Autopilot Test Suite
6# Copyright (C) 2012, 2013, 2014, 2015 Canonical
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
23from gi.repository import GLib, Notify
27def action_callback(notification, action_id, data):
31def quit_callback(notification):
35if __name__ == '__main__':
36 parser = argparse.ArgumentParser(
37 description='Create an interactive notification'
42 help='summary text of the notification',
47 help='body text of the notification',
52 help='path to the icon to display',
57 help='id and label for the callback in the format: id,label',
63 help='LOW, NORMAL, CRITICAL',
64 choices=['LOW', 'NORMAL', 'CRITICAL'],
69 help='list of comma sep options',
74 args = parser.parse_args()
76 Notify.init('Interactive Notifications')
78 notification = Notify.Notification.new(args.summary, args.body, args.icon)
80 for hint in args.hints:
81 key, value = hint.split(',', 1)
82 notification.set_hint_string(key, value)
84 for action in args.action:
85 action_id, action_label = action.split(',', 1)
86 notification.add_action(
93 def signal_handler(signam, frame):
96 signal.signal(signal.SIGINT, signal_handler)
98 loop = GLib.MainLoop.new(None, False)
99 notification.connect('closed', quit_callback)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list