reinforceTimersBundle.py (1537B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\structure\structureBrowser\controllers\reinforceTimersBundle.py 2 from brennivin.itertoolsext import Bundle 3 from eve.client.script.ui.shared.eveCalendar import DAY_NAME_TEXT 4 from localization import GetByLabel 5 from structures import DEFAULT_REINFORCE_HOUR, DEFAULT_REINFORCE_WEEKDAY, NO_REINFORCEMENT_WEEKDAY 6 7 class ReinforcementBundle(Bundle): 8 9 def GetReinforcementTime(self): 10 return (self.GetReinforceWeekday(), self.GetReinforceHour()) 11 12 def GetReinforceWeekday(self): 13 return getattr(self, 'reinforceWeekday', DEFAULT_REINFORCE_WEEKDAY) 14 15 def GetReinforceHour(self): 16 return getattr(self, 'reinforceHour', DEFAULT_REINFORCE_HOUR) 17 18 def GetNextReinforcementTime(self): 19 return (self.GetNextReinforceDay(), self.GetNextReinforceHour()) 20 21 def GetNextReinforceDay(self): 22 return getattr(self, 'nextReinforceWeekday', None) 23 24 def GetNextReinforceHour(self): 25 return getattr(self, 'nextReinforceHour', None) 26 27 def GetNextApply(self): 28 return getattr(self, 'nextReinforceApply', None) 29 30 31 def GetDayAndHourText(day, hour): 32 dayText = GetDayText(day) 33 hourText = GetHourText(hour) 34 return (dayText, hourText) 35 36 37 def GetHourText(hour): 38 hourText = '%.2d:00' % hour if hour is not None else '' 39 return hourText 40 41 42 def GetDayText(day): 43 if day in (NO_REINFORCEMENT_WEEKDAY, None): 44 return '' 45 dayText = GetByLabel(DAY_NAME_TEXT[day]) 46 return dayText