[Galago-commits] r2774 - in trunk/notify-python: . tests
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Tue Apr 25 22:28:37 PDT 2006
Author: chipx86
Date: 2006-04-25 22:28:35 -0700 (Tue, 25 Apr 2006)
New Revision: 2774
Added:
trunk/notify-python/tests/applet-critical.png
trunk/notify-python/tests/test-default-action.py
trunk/notify-python/tests/test-image.py
Modified:
trunk/notify-python/ChangeLog
trunk/notify-python/tests/Makefile.am
trunk/notify-python/tests/test-multi-actions.py
Log:
dded several test apps.
Modified: trunk/notify-python/ChangeLog
===================================================================
--- trunk/notify-python/ChangeLog 2006-04-26 05:28:01 UTC (rev 2773)
+++ trunk/notify-python/ChangeLog 2006-04-26 05:28:35 UTC (rev 2774)
@@ -1,3 +1,12 @@
+Tue Apr 25 22:28:15 PDT 2006 Christian Hammond <chipx86 at chipx86.com>
+
+ * tests/Makefile.am:
+ A tests/applet-critical.png:
+ A tests/test-default-action.py:
+ A tests/test-image.py:
+ * tests/test-multi-actions.py:
+ - Added several test apps.
+
Tue Apr 25 22:25:42 PDT 2006 Christian Hammond <chipx86 at chipx86.com>
* src/pynotify.override:
Modified: trunk/notify-python/tests/Makefile.am
===================================================================
--- trunk/notify-python/tests/Makefile.am 2006-04-26 05:28:01 UTC (rev 2773)
+++ trunk/notify-python/tests/Makefile.am 2006-04-26 05:28:35 UTC (rev 2774)
@@ -1,5 +1,8 @@
EXTRA_DIST = \
+ applet-critical.png \
test-basic.py \
+ test-default-action.py \
+ test-image.py \
test-markup.py \
test-multi-actions.py \
test-replace.py \
Added: trunk/notify-python/tests/applet-critical.png
===================================================================
(Binary files differ)
Property changes on: trunk/notify-python/tests/applet-critical.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/notify-python/tests/test-default-action.py
===================================================================
--- trunk/notify-python/tests/test-default-action.py 2006-04-26 05:28:01 UTC (rev 2773)
+++ trunk/notify-python/tests/test-default-action.py 2006-04-26 05:28:35 UTC (rev 2774)
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+import pygtk
+pygtk.require('2.0')
+import gtk
+import pynotify
+import sys
+
+def default_cb(n, action):
+ assert action == "default"
+ print "You clicked the default action"
+ n.close()
+ gtk.main_quit()
+
+if __name__ == '__main__':
+ if not pynotify.init("Default Action Test"):
+ sys.exit(1)
+
+ n = pynotify.Notification("Matt is online")
+ n.set_category("presence.online")
+ n.add_action("default", "Default Action", default_cb)
+
+ if not n.show():
+ print "Failed to send notification"
+ sys.exit(1)
+
+ gtk.main()
Property changes on: trunk/notify-python/tests/test-default-action.py
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/notify-python/tests/test-image.py
===================================================================
--- trunk/notify-python/tests/test-image.py 2006-04-26 05:28:01 UTC (rev 2773)
+++ trunk/notify-python/tests/test-image.py 2006-04-26 05:28:35 UTC (rev 2774)
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+
+import pygtk
+pygtk.require('2.0')
+import pynotify
+import sys
+import gtk
+import os
+
+if __name__ == '__main__':
+ if not pynotify.init("Images Test"):
+ sys.exit(1)
+
+ # Stock icon
+ n = pynotify.Notification("Icon Test", "Testing stock icon",
+ "stock_samples")
+
+ if not n.show():
+ print "Failed to send notification"
+ sys.exit(1)
+
+ # Image URI
+ uri = "file://" + os.path.abspath(os.path.curdir) + "/applet-critical.png"
+ print "Sending " + uri
+
+ n = pynotify.Notification("Alert!", "Testing URI icons", uri)
+ if not n.show():
+ print "Failed to send notification"
+ sys.exit(1)
+
+ # Raw image
+ n = pynotify.Notification("Raw image test",
+ "Testing sending raw pixbufs")
+ helper = gtk.Button()
+ icon = helper.render_icon(gtk.STOCK_DIALOG_QUESTION, gtk.ICON_SIZE_DIALOG)
+ n.set_icon_from_pixbuf(icon)
+
+ if not n.show():
+ print "Failed to send notification"
+ sys.exit(1)
Property changes on: trunk/notify-python/tests/test-image.py
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/notify-python/tests/test-multi-actions.py
===================================================================
--- trunk/notify-python/tests/test-multi-actions.py 2006-04-26 05:28:01 UTC (rev 2773)
+++ trunk/notify-python/tests/test-multi-actions.py 2006-04-26 05:28:35 UTC (rev 2774)
@@ -10,19 +10,19 @@
assert action == "help"
print "You clicked Help"
n.close()
- sys.exit(0)
+ gtk.main_quit()
def ignore_cb(n, action):
assert action == "ignore"
print "You clicked Ignore"
n.close()
- sys.exit(0)
+ gtk.main_quit()
def empty_cb(n, action):
assert action == "empty"
print "You clicked Empty Trash"
n.close()
- sys.exit(0)
+ gtk.main_quit()
if __name__ == '__main__':
if not pynotify.init("Multi Action Test"):
More information about the galago-commits
mailing list