scripts/search-index
changeset 121 86aebc9cb60b
parent 106 0690d715385d
--- a/scripts/search-index	Thu Feb 12 22:34:54 2009 +0200
+++ b/scripts/search-index	Fri Feb 13 00:29:47 2009 +0200
@@ -197,7 +197,8 @@
         except CommandError, e :
             # skip?
             if options.skip_missing :
-                print "[ERROR] %s" % (date_name, e)
+                if not options.quiet :
+                    print "[ERROR] %s" % (date_name, e)
                 continue
 
             else :
@@ -205,8 +206,9 @@
         
         # get the set of days
         days = list(channel.source.get_month_days(month))
-
-        print "Loading %d days of logs:" % (len(days))
+        
+        if not options.quiet :
+            print "Loading %d days of logs:" % (len(days))
 
         # load each day
         for date in days :
@@ -304,7 +306,8 @@
     # reset autoload state?
     if options.reset :
         _autoload_reset(options, channels)
-        print
+        if not options.quiet :
+            print
 
     # iterate channels
     for channel in channels :
@@ -423,7 +426,8 @@
         statefile_tmp.close()
         os.remove(statefile_tmppath)
         
-        print
+        if not options.quiet :
+            print
     
     # done
     return
@@ -549,11 +553,11 @@
                                                 action="store_true"                                         )
 
     general.add_option(     "--formatter",      dest="formatter_name",  help="LogFormatter to use",                 
-            metavar="FMT",  type="choice",                              default="irssi",
+            metavar="FMT",  type="choice",                              default=config.PREF_FORMATTER_DEFAULT.name,
             choices=[fmt_name for fmt_name in config.LOG_FORMATTERS.iterkeys()]                             )
 
     general.add_option(     "--index",          dest="index_path",      help="Index database path",                 
-            metavar="PATH",                                             default="logs/index"                )
+            metavar="PATH",                                             default=config.SEARCH_INDEX_PATH    )
 
     general.add_option(     "--timezone",       dest="timezone",        help="Timezone for output",                 
             metavar="TZ",   type="timezone",                            default=pytz.utc                    )
@@ -579,7 +583,7 @@
     # cmd_autoload options  #                   #                       #                                   #
     autoload = optparse.OptionGroup(parser, "Autoload Options")
     autoload.add_option(    "--autoload-state", dest="autoload_state_path", help="Path to autoload state dir",      
-            metavar="PATH",                                             default="logs/autoload-state"       )
+            metavar="PATH",                                             default=config.SEARCH_AUTOINDEX_PATH)
 
     autoload.add_option(    "--from",           dest="after",           help="Only autoload logfiles from the given date on", 
             metavar="DATE", type="date",        action="parse_date",    default=None                        )