def bmDate.bmDate.__init__ |
( |
|
self | ) |
|
__init__ :
generate a dict containing dates formated as described under :
dates[yesterdayPostfixLiteral] = %Y-%m-%d, where yesterdayPostfixLiteral = "%b %_d", ie dates['Jul 07'] = "2017-07-07'
dates[todayPostfixLiteral] = %Y-%m-%d, where todayPostfixLiteral = "%b %_d", ie dates['Jul 07'] = "2017-07-07'
dates['yesterdayNumELK'] = %Y.%m.%d, ie dates['yesterdayNumELK'] = '2017.07.07'
dates['todayNumELK'] = %Y.%m.%d, ie dates['yesterdayNumELK'] = '2017.07.07'
22 generate a dict containing dates formated as described under : 24 dates[yesterdayPostfixLiteral] = %Y-%m-%d, where yesterdayPostfixLiteral = "%b %_d", ie dates['Jul 07'] = "2017-07-07' 25 dates[todayPostfixLiteral] = %Y-%m-%d, where todayPostfixLiteral = "%b %_d", ie dates['Jul 07'] = "2017-07-07' 26 dates['yesterdayNumELK'] = %Y.%m.%d, ie dates['yesterdayNumELK'] = '2017.07.07' 27 dates['todayNumELK'] = %Y.%m.%d, ie dates['yesterdayNumELK'] = '2017.07.07' 33 todayNum = today.strftime(
"%Y-%m-%d")
34 todayNumELK = today.strftime(
"%Y.%m.%d")
35 todayPostfixLiteral = today.strftime(
"%b %_d")
37 yesterday = today - timedelta(days=1)
38 yesterdayNum = yesterday.strftime(
"%Y-%m-%d")
39 yesterdayNumELK = yesterday.strftime(
"%Y.%m.%d")
40 yesterdayPostfixLiteral = yesterday.strftime(
"%b %_d")
43 self.dates[yesterdayPostfixLiteral] = yesterdayNum
44 self.dates[todayPostfixLiteral] = todayNum
45 self.dates[
'yesterdayNumELK'] = yesterdayNumELK
46 self.dates[
'todayNumELK'] = todayNumELK
def bmDate.bmDate.getCyrusUpdatePoolDates |
( |
|
self | ) |
|
getCyrusUpdatePoolDates:
return a list of pre-formated date as "%b %_d %H:%M"
The number of dates are hard-coded as n=5 for 5 minutes
59 def getCyrusUpdatePoolDates(self):
61 getCyrusUpdatePoolDates: 62 return a list of pre-formated date as "%b %_d %H:%M" 63 The number of dates are hard-coded as n=5 for 5 minutes 66 now = datetime.today()
68 n : number of minutes. Must be the same as set in "/etc/cron.d/bmSearch" (cf updateCyrusInfo.py) 73 before = now - timedelta(minutes=n)
74 dateList.append(before.strftime(
"%b %_d %H:%M"))
def bmDate.bmDate.getDates |
( |
|
self | ) |
|
getDates :
Return dates dict
The documentation for this class was generated from the following file: