Fix tag delete bug
authorJack Miller <jack@codezen.org>
Fri, 13 May 2011 00:00:40 +0000 (19:00 -0500)
committerJack Miller <jack@codezen.org>
Fri, 13 May 2011 00:00:40 +0000 (19:00 -0500)
We need to reset() on die() so that items are properly cleaned up and
other components are made aware of items being removed.

Signed-off-by: Jack Miller <jack@codezen.org>
canto_curses/tag.py
tests/delfeed/skel/conf [new file with mode: 0644]
tests/delfeed/skel/expected.gz [new file with mode: 0644]
tests/delfeed/skel/feeds [new file with mode: 0644]
tests/delfeed/skel/script.sh [new file with mode: 0755]

index c7887f0..e8f7937 100644 (file)
@@ -60,6 +60,10 @@ class Tag(list):
         callbacks["get_var"]("alltags").append(self)
 
     def die(self):
+        # Reset so items get die() called and everything
+        # else is notified about items disappearing.
+
+        self.reset()
         remove_hook("opt_change", self.on_opt_change)
 
     def on_opt_change(self, opts):
diff --git a/tests/delfeed/skel/conf b/tests/delfeed/skel/conf
new file mode 100644 (file)
index 0000000..d3ca833
--- /dev/null
@@ -0,0 +1,7 @@
+[Feed Static]
+url = file:///tmp/canto.xml
+order = 0
+
+[Feed Static 2]
+url = file:///tmp/canto2.xml
+order = 1
diff --git a/tests/delfeed/skel/expected.gz b/tests/delfeed/skel/expected.gz
new file mode 100644 (file)
index 0000000..6684760
Binary files /dev/null and b/tests/delfeed/skel/expected.gz differ
diff --git a/tests/delfeed/skel/feeds b/tests/delfeed/skel/feeds
new file mode 100644 (file)
index 0000000..4fcf855
Binary files /dev/null and b/tests/delfeed/skel/feeds differ
diff --git a/tests/delfeed/skel/script.sh b/tests/delfeed/skel/script.sh
new file mode 100755 (executable)
index 0000000..951e7fb
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# This tests the remote: capability as well as the ability to show
+# freshly added feeds immediately.
+
+canto-daemon -v -D ./ &
+
+function stimulate() {
+    sleep 3
+
+    echo -n ":"
+    sleep 0.5
+    echo "remote delfeed file:///tmp/canto.xml"
+    sleep 0.5
+    echo -n " "
+
+    sleep 2
+    echo -n ":"
+    sleep 0.5
+    echo "dump-screen canto-screen"
+
+    echo -n "q"
+}
+
+stimulate | canto-curses -v -D ./
+
+canto-remote -D ./ kill