sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 15b68c299d99afd8d7a3c00f3cfb9f6d6af3a7af
parent ac6d8942a5ccff0fcc30b6b603c0f4e44a6461b3
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Fri,  8 Jun 2007 22:44:58 +0000

handle any errors during manager initialization

git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@439 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M bin/sup | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/bin/sup b/bin/sup
@@ -46,9 +46,11 @@ def start_cursing
   Ncurses.stdscr.keypad 1
   Ncurses.curs_set 0
   Ncurses.start_color
+  $cursing = true
 end
 
 def stop_cursing
+  return unless $cursing
   Ncurses.curs_set 1
   Ncurses.echo
   Ncurses.endwin
@@ -82,22 +84,22 @@ EOS
   end
 end
 
-Redwood::start
-Index.load
+begin
+  Redwood::start
+  Index.load
 
-if(s = Index.source_for DraftManager.source_name)
-  DraftManager.source = s
-else
-  Index.add_source DraftManager.new_source
-end
+  if(s = Index.source_for DraftManager.source_name)
+    DraftManager.source = s
+  else
+    Index.add_source DraftManager.new_source
+  end
 
-if(s = Index.source_for SentManager.source_name)
-  SentManager.source = s
-else
-  Index.add_source SentManager.new_source
-end
+  if(s = Index.source_for SentManager.source_name)
+    SentManager.source = s
+  else
+    Index.add_source SentManager.new_source
+  end
 
-begin
   log "starting curses"
   start_cursing
 
@@ -254,7 +256,7 @@ ensure
   Redwood::finish
   stop_cursing
 
-  if SuicideManager.die?
+  if SuicideManager.instantiated? && SuicideManager.die?
     Redwood::log "I've been asked to commit sepuku. I obey!"
   end