]> git.cworth.org Git - sup/commitdiff
final logging output fixed
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 1 Apr 2007 22:45:03 +0000 (22:45 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 1 Apr 2007 22:45:03 +0000 (22:45 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@360 5c8cc53c-5e98-4d25-b20a-d8db53a31250

bin/sup
bin/sup-add
bin/sup-sync
doc/TODO
lib/sup.rb
lib/sup/index.rb
lib/sup/logger.rb
lib/sup/util.rb

diff --git a/bin/sup b/bin/sup
index dc1f2f9478386e41c904cb75421d4e73f52c81e9..2572fc21f3e724ec143b92e53b40a34f5c11b27c 100644 (file)
--- a/bin/sup
+++ b/bin/sup
@@ -207,12 +207,11 @@ rescue Exception => e
 ensure
   Redwood::finish
   stop_cursing
-  
-  # don't ask me why, but sometimes it's necessary to print something
-  # to stderr at this point or the exception doesn't get printed.
-  # doesn't get printed. WHY?
-
-  $stderr.puts " " 
+  if $exception
+    Redwood::log "oh crap, an exception"
+  else
+    Redwood::log "good night, sweet prince!"
+  end
 end
 
 Index.save unless $exception # TODO: think about this
index b0d8457afa2d355ddbbbf1e2c6c335ec16ad8dd3..caff68d45f05b6e9b27a7dca726758e4155aa503 100644 (file)
@@ -110,6 +110,5 @@ ARGV.each do |uri|
   index.add_source source
 end
 
-say "Saving source list..."
 index.save
 Redwood::finish
index bf7538d8399fd7f93db8d5eb0745dd14b2a90917..f71f6b002f1392679d82e0bfcdff221a732555f1 100644 (file)
@@ -200,7 +200,6 @@ begin
     $stderr.puts "Restored state on #{num_restored} (#{100.0 * num_restored / num_scanned}%) messages." if num_restored > 0
   end
 ensure
-  $stderr.puts "Saving index and sources..."
   index.save
   Redwood::finish
 end
index 42c97e0dcd26b9bbfe8d0da1ed84dff197290338..7888df71e8ee68af1e9a4a4942aa713eb581d4d8 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -5,12 +5,12 @@ _ bugfix: when one new message comes into an imap folder, we don't
    catch it until a reload
 _ bugfix: triggering a pageup when cursor scrolling up jumps to the
    bottom of the page rather than the next line
-  blank compose-mode rather than do nothing
 _ bugfix: add new message counts until keypress
 _ bugfix: attachment filenames sometimes not detected (filename=)
-_ bugfix: final logging messages to stdout?
+x bugfix: final logging messages to stdout?
 x bugfix: mbox directory shouldn't generate an exception, just an error
 x bugfix: m in thread-view-mode when a person is not selected should open up a
+   blank compose-mode rather than do nothing
 x bugfix: stars on messages with blue backgrounds still have green bgs
 x ferret upgrade script (dump & restore)
 x bugfix: mark messages as read immediately when t-v-m is opened
@@ -33,7 +33,7 @@ _ select all, starred, to me, etc
 _ undo
 _ gmail
 _ warnings: top-posting, missing attachment, ruby-talk:XXXX detection
-_ mboxz (compressed mbox)
+_ mboxz, mboxbz
 
 future
 ------
index a4fd388b8619bac4d81c6dc3ad0c7d5752baef89..f672d9eeda0ef9c7e2a7fe80c2f2a78a34ad935e 100644 (file)
@@ -93,6 +93,7 @@ module Redwood
     Redwood::LabelManager.save
     Redwood::ContactManager.save
     Redwood::PersonManager.save
+    Redwood::BufferManager.deinstantiate!
   end
 
   ## not really a good place for this, so I'll just dump it here.
index 18efe86607319c9ff7230f9c5135cb7922ea132a..2fa70cd923c9283537a7e6e786f0ee066b6f6a53 100644 (file)
@@ -30,6 +30,7 @@ class Index
   end
 
   def save
+    Redwood::log "saving index and sources..."
     FileUtils.mkdir_p @dir unless File.exists? @dir
     save_sources
     save_index
index b587e6bf734e26a4c6fbf01cd2c0725562f72126..95cff62a455a65f2d4a2019ac718d8cbce5df706 100644 (file)
@@ -26,7 +26,7 @@ class Logger
 #    $stderr.puts s
     make_buf
     @mode << "#{Time.now}: #{s.chomp}\n"
-    $stderr.puts "[#{Time.now}] #{s.chomp}" unless @mode.buffer
+    $stderr.puts "[#{Time.now}] #{s.chomp}" unless BufferManager.instantiated? && @mode.buffer
   end
   
   def self.method_missing m, *a
index 98632823d96f09c29960057ace47e349432af0f3..e13aac4abb952537fa1c21867af2cf76e416c626 100644 (file)
@@ -263,11 +263,12 @@ end
 ## allows for constructors that take arguments.
 ##
 ## You must have #initialize call "self.class.i_am_the_instance self"
-## at some point or everything will fail horribly
+## at some point or everything will fail horribly.
 module Singleton
   module ClassMethods
     def instance; @instance; end
     def instantiated?; defined?(@instance) && !@instance.nil?; end
+    def deinstantiate!; @instance = nil; end
     def method_missing meth, *a, &b
       raise "no instance defined!" unless defined? @instance
       @instance.send meth, *a, &b