本文整理汇总了Python中taskcoachlib.render.time函数的典型用法代码示例。如果您正苦于以下问题:Python time函数的具体用法?Python time怎么用?Python time使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了time函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testExportAllColumns_Split
def testExportAllColumns_Split(self):
self.expectInCSV('%s,%s,%s,%s' % (render.date(self.effort.getStart().date()),
render.time(self.effort.getStart().time()),
render.date(self.effort.getStop().date()),
render.time(self.effort.getStop().time())),
separateDateAndTimeColumns=True,
columns=self.viewer.selectableColumns())
示例2: testDontWriteDefaultDateTimesWithSeparatedDateAndTimeColumns
def testDontWriteDefaultDateTimesWithSeparatedDateAndTimeColumns(self):
defaultDateTime = date.DateTime()
self.expectNotInCSV(
','.join(
[render.date(defaultDateTime),
render.time(defaultDateTime)]),
separateDateAndTimeColumns=True)
示例3: testDontWriteSeparateDateAndTimeColumns
def testDontWriteSeparateDateAndTimeColumns(self):
plannedStartDateTime = date.Now()
self.task.setPlannedStartDateTime(plannedStartDateTime)
self.expectInCSV(
' '.join((render.date(plannedStartDateTime),
render.time(plannedStartDateTime))),
separateDateAndTimeColumns=False)
示例4: testWriteSeparateDateAndTimeColumnsWithDateBefore1900
def testWriteSeparateDateAndTimeColumnsWithDateBefore1900(self):
plannedStartDateTime = date.DateTime(1600, 1, 1, 12, 30, 0)
self.task.setPlannedStartDateTime(plannedStartDateTime)
self.expectInCSV(
','.join((render.date(plannedStartDateTime),
render.time(plannedStartDateTime))),
separateDateAndTimeColumns=True)
示例5: __init__
def __init__(self, parent, value, defaultValue=0, disabledValue=None, disabledMessage=None):
super(TimeEntry, self).__init__(parent)
self.__disabledValue = disabledValue
sizer = wx.BoxSizer(wx.HORIZONTAL)
self.__entry = sdtc.TimeEntry(self, format=lambda x: render.time(x, minutes=False),
hour=defaultValue, minute=0, second=0)
self.__entry.EnableChoices()
sizer.Add(self.__entry, 0, wx.ALL, 3)
if disabledMessage is not None:
self.__checkbox = wx.CheckBox(self, wx.ID_ANY, disabledMessage)
self.Bind(wx.EVT_CHECKBOX, self.OnCheck)
if value == disabledValue:
self.__entry.SetTime(date.Time(hour=defaultValue, minute=0, second=0))
self.__checkbox.SetValue(True)
self.__entry.Enable(False)
else:
self.__entry.SetTime(date.Time(hour=value, minute=0, second=0))
sizer.Add(self.__checkbox, 1, wx.ALL, 3)
else:
self.__entry.SetTime(date.Time(hour=value, minute=0, second=0))
self.__checkbox = None
self.SetSizer(sizer)
示例6: __formatTime
def __formatTime(dateTime, includeMinutes=False):
return render.time(TaskSchedule.tcDateTime(dateTime),
minutes=includeMinutes)
示例7: splitDateAndTime
def splitDateAndTime(self, column, item):
dateTime = getattr(item, column.name())()
if dateTime == date.DateTime():
return '', ''
else:
return render.date(dateTime), render.time(dateTime)
示例8: testActualStartDateTimeYesterday
def testActualStartDateTimeYesterday(self):
yesterday = date.Yesterday()
self.task.setActualStartDateTime(yesterday)
self.taskList.append(self.task)
self.showColumn('actualStartDateTime')
self.assertEqual(_('Yesterday %s') % render.time(yesterday.time()), self.getItemText(0, 3))
示例9: testDueDateTimeTomorrow
def testDueDateTimeTomorrow(self):
tomorrow = date.Tomorrow()
self.task.setDueDateTime(tomorrow)
self.taskList.append(self.task)
self.showColumn('dueDateTime')
self.assertEqual(_('Tomorrow %s') % render.time(tomorrow.time()), self.getItemText(0, 2))
示例10: testDueDateTimeToday
def testDueDateTimeToday(self):
today = date.Now()
self.task.setDueDateTime(today)
self.taskList.append(self.task)
self.showColumn('dueDateTime')
self.assertEqual(_('Today %s') % render.time(today.time()), self.getItemText(0, 2))
示例11: __splitDateAndTime
def __splitDateAndTime(self, dateTime):
if dateTime == date.DateTime() or dateTime is None:
return '', ''
return render.date(dateTime), render.time(dateTime)