[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mhc:02224] Re: patch for mhc2ol.in



野口です。


From: NOGUCHI Yusuke <nogunogu@xxxxxxxxxxxxxxxxx>
Subject: [mhc:02222] Re: patch for mhc2ol.in
Date: Tue, 03 Oct 2006 11:33:45 +0900 (JST)

で当 ML に御提案した patch ですが、

X-SC-Day: 20061024
X-SC-Time: 
X-SC-Alarm: 1 day

の様に、X-SC-Time: が空のスケジュールで異常終了する問題がありました。
上記の問題を修正した patch を再度お送りさせていただきます。

以上、ご検討いただければ幸いです
-- 
NOGUCHI Yusuke <nogunogu@xxxxxxxxxxxxxxxxx>


*** mhc2ol.in.org	Mon May  2 07:55:08 2005
--- mhc2ol.in	Thu Oct 19 19:49:52 2006
***************
*** 65,70 ****
--- 65,86 ----
        [@stime, @etime]
      end
  
+     def get_sdatetime
+       if @stime .nil?
+ 	Time .local(@sdate. y, @sdate. m, @sdate .d, 0, 0)
+       else
+ 	Time .local(@sdate. y, @sdate. m, @sdate .d, @stime .hh, @stime .mm)
+       end
+     end
+ 
+     def get_edatetime
+       if @stime .nil?
+ 	Time .local(@edate. y, @edate. m, @edate .d, 0, 0)
+       else
+ 	Time .local(@edate. y, @edate. m, @edate .d, @etime .hh, @etime .mm)
+       end
+     end
+ 
      def handle_recurrence(ol_appoint)
      end
  
***************
*** 183,189 ****
  
  def usage
    print '
! usage: mhc2ol [-a | -i | -d | -N] [-H] [-n] [-s] [-m] [-r dir] [-c category] [YYYYMMDD-yyyymmdd]
  
    mhc2ol -- Add/Copy mhc articles to Outlook.
  
--- 199,205 ----
  
  def usage
    print '
! usage: mhc2ol [-a | -i | -d | -N] [-A] [-H] [-n] [-s] [-m] [-r dir] [-c category] [YYYYMMDD-yyyymmdd]
  
    mhc2ol -- Add/Copy mhc articles to Outlook.
  
***************
*** 205,210 ****
--- 221,227 ----
               ~/Mail/schedule
      -c     : Copy only the mhc articles of which the category
               matches the specified regexp.
+     -A     : Disable reminder if the mhc article already has been passed.
  
      YYYYMMDD-yyyymmdd : set a start and end date of scanning mhc.
                          if omitted, scan from 3 months ago to
***************
*** 341,346 ****
--- 358,364 ----
    @@flag_export_part = 'all' # 'all' || 'body_only'
    @@flag_noharm = false
    @@flag_timestamp = false
+   @@flag_disable_passed_sch = false
    @@mhc_category_name = 'MHC-sch'
    @@additional_category = false
  
***************
*** 475,482 ****
  
        # a reminder is valid for a future schedule.
        if sch .alarm() != nil then
! 	appoint .ReminderSet = true
! 	appoint .ReminderMinutesBeforeStart = sch .alarm() / 60
        else
  	appoint .ReminderSet = false
        end
--- 493,504 ----
  
        # a reminder is valid for a future schedule.
        if sch .alarm() != nil then
! 	if period .get_sdatetime >= Time .now && $flag_disable_passed_sch
! 	  appoint .ReminderSet = true
! 	  appoint .ReminderMinutesBeforeStart = sch .alarm() / 60
! 	else
! 	  appoint .ReminderSet = false
! 	end
        else
  	appoint .ReminderSet = false
        end
***************
*** 752,757 ****
--- 774,783 ----
      @@flag_additional_category = flag
    end
  
+   def Exporter.set_flag_disable_passed_sch(flag)
+     @@set_flag_disable_passed_sch = flag
+   end
+ 
    def Exporter.to_ol_date(date)
      format("%4d/%02d/%02d", date .y(), date .m(), date .d()) if date
    end
***************
*** 775,780 ****
--- 801,807 ----
  $flag_separation = false
  $flag_discreet = false
  $flag_additional_category = false
+ $flag_disable_passed_sch = false
  
  while ARGV .length > 0
    case ARGV[0]
***************
*** 804,809 ****
--- 831,838 ----
      $flag_separation = true
    when '-m'
      $flag_additional_category = true
+   when '-A'
+     $flag_disable_passed_sch = true
    else
      usage()
    end
***************
*** 850,855 ****
--- 879,885 ----
  Exporter .set_flag_noharm($flag_noharm)
  Exporter .set_flag_timestamp($flag_timestamp)
  Exporter .set_flag_additional_category($flag_additional_category)
+ Exporter .set_flag_disable_passed_sch($flag_disable_passed_sch)
  exporter = Exporter .new(mdb, outlook)
  exporter .set_category_regexp($flag_category_regexp)
  exporter .delete_ol_schedules()