diff nose_notify/build/lib/nose_notify/nose_notify.py @ 2:3cdd7f281e28 v0.2

Transformando tudo em um egg
author Walter Cruz <walter.php@gmail.com>
date Fri, 29 Feb 2008 14:54:33 -0300
parents
children c047cd63d175
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nose_notify/build/lib/nose_notify/nose_notify.py	Fri Feb 29 14:54:33 2008 -0300
@@ -0,0 +1,39 @@
+import sys
+from nose.plugins.base import Plugin
+
+from StringIO import StringIO
+
+import pygtk
+pygtk.require('2.0')
+import pynotify
+from new import instancemethod
+
+def writeln(self,*args):
+    for i in args:
+        self.write(i)
+    self.write("\n")
+
+class NoseNotifyPlugin(Plugin):
+
+    enabled = True
+    score = 1000
+    name = "NotifyPlugin"
+    
+    def __init__(self):
+        self.stdout = []
+        self._buf = StringIO()
+        self._buf.writeln = instancemethod(writeln,self._buf,StringIO)
+    
+    def configure(self, options, conf):
+        pass
+
+    def options(self, parser, env):
+        pass
+
+    def finalize(self, result):
+        result.stream = self._buf
+        result.printSummary(0,2)
+        pynotify.init("Basics")
+        n = pynotify.Notification("Tests", self._buf.getvalue())
+        n.show()
+        return None
\ No newline at end of file