예제 #1
0
파일: timetype.py 프로젝트: weeksjm/gnumed
 def start(self, time):
     if self.appearance.get_week_start() == "tkyriaka":
         days_to_subtract = CopticTimeType().get_day_of_week(time)
     else:
         # It is Psabbaton.
         days_to_subtract = (CopticTimeType().get_day_of_week(time) + 1) % 7
     return CopticTime(time.julian_day - days_to_subtract, 0)
예제 #2
0
 def time_to_wx_date(self, time):
     year, month, day = CopticDateTime.from_time(time).to_date_tuple()
     try:
         return wx.DateTime.FromDMY(day, month - 1, year, 0, 0, 0)
     except OverflowError:
         if year < 0:
             year, month, day = CopticDateTime.from_time(CopticTime(0, 0)).to_date_tuple()
             return wx.DateTime.FromDMY(day, month - 1, year, 0, 0, 0)
예제 #3
0
파일: timetype.py 프로젝트: weeksjm/gnumed
 def choose_strip(self, metrics, appearance):
     """
     Return a tuple (major_strip, minor_strip) for current time period and
     window size.
     """
     day_period = TimePeriod(CopticTime(0, 0), CopticTime(1, 0))
     one_day_width = metrics.calc_exact_width(day_period)
     if one_day_width > 20000:
         return (StripHour(), StripMinute())
     elif one_day_width > 600:
         return (StripDay(), StripHour())
     elif one_day_width > 45:
         return (StripWeek(appearance), StripWeekday())
     elif one_day_width > 25:
         return (StripMonth(), StripDay())
     elif one_day_width > 1.5:
         return (StripYear(), StripMonth())
     elif one_day_width > 0.12:
         return (StripDecade(), StripYear())
     elif one_day_width > 0.012:
         return (StripCentury(), StripDecade())
     else:
         return (StripCentury(), StripCentury())
예제 #4
0
파일: timetype.py 프로젝트: weeksjm/gnumed
 def start(self, time):
     (hours, minutes, _) = time.get_time_of_day()
     return CopticTime(time.julian_day, minutes * 60 + hours * 60 * 60)
예제 #5
0
파일: timetype.py 프로젝트: weeksjm/gnumed
 def get_max_time(self):
     return CopticTime(5369833, 0)
예제 #6
0
 def to_time(self):
     days = coptic_ymd_to_julian_day(self.year, self.month, self.day)
     seconds = self.hour * 60 * 60 + self.minute * 60 + self.second
     return CopticTime(days, seconds)