本文整理汇总了Python中taskcoachlib.render.dateTime函数的典型用法代码示例。如果您正苦于以下问题:Python dateTime函数的具体用法?Python dateTime怎么用?Python dateTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dateTime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _OnSelectFile
def _OnSelectFile(self, event):
self.__backups.DeleteAllItems()
for index, dateTime in enumerate(self.__manifest.listBackups(self.__filenames[event.GetIndex()])):
self.__backups.InsertStringItem(index, render.dateTime(dateTime, humanReadable=True))
self.__backups.SetColumnWidth(0, -1)
self.__backups.Enable(True)
self.__selection = (self.__filenames[event.GetIndex()], None)
示例2: testCollapsedCompositeTaskShowsRecursivePlannedStartDateTime
def testCollapsedCompositeTaskShowsRecursivePlannedStartDateTime(self):
self.taskList.extend([self.task, self.child])
self.task.addChild(self.child)
now = date.Now()
self.child.setPlannedStartDateTime(now)
self.task.setPlannedStartDateTime(date.DateTime())
self.viewer.setSortByTaskStatusFirst(False)
self.viewer.setSortOrderAscending(False)
expectedDateTime = "(%s)" % render.dateTime(now, humanReadable=True) if self.treeMode else ''
self.task.expand(False, context=self.viewer.settingsSection())
self.assertEqual(expectedDateTime, self.getItemText(0, 1))
示例3: assertRenderedDateTime
def assertRenderedDateTime(self, expectedDateTime, *dateTimeArgs):
renderedDateTime = render.dateTime(date.DateTime(*dateTimeArgs))
if expectedDateTime:
renderedParts = renderedDateTime.split(' ', 1)
if len(renderedParts) > 1:
renderedDate, renderedTime = renderedParts
expectedDate, expectedTime = expectedDateTime.split(' ', 1)
self.assertEqual(expectedTime, renderedTime)
else:
expectedDate, renderedDate = expectedDateTime, renderedDateTime
self.assertEqual(expectedDate, renderedDate)
else:
self.assertEqual(expectedDateTime, renderedDateTime)
示例4: AddInnerContent
def AddInnerContent(self, sizer, panel):
idleTimeFormatted = render.dateTime(self._idleTime)
sizer.Add(wx.StaticText(panel, wx.ID_ANY,
_('No user input since %s. The following task was\nbeing tracked:') % \
idleTimeFormatted))
sizer.Add(wx.StaticText(panel, wx.ID_ANY,
self._effort.task().subject()))
btnNothing = wx.Button(panel, wx.ID_ANY, _('Do nothing'))
btnStopAt = wx.Button(panel, wx.ID_ANY, _('Stop it at %s') % idleTimeFormatted)
btnStopResume = wx.Button(panel, wx.ID_ANY, _('Stop it at %s and resume now') % idleTimeFormatted)
sizer.Add(btnNothing, 0, wx.EXPAND | wx.ALL, 1)
sizer.Add(btnStopAt, 0, wx.EXPAND | wx.ALL, 1)
sizer.Add(btnStopResume, 0, wx.EXPAND | wx.ALL, 1)
wx.EVT_BUTTON(btnNothing, wx.ID_ANY, self.DoNothing)
wx.EVT_BUTTON(btnStopAt, wx.ID_ANY, self.DoStopAt)
wx.EVT_BUTTON(btnStopResume, wx.ID_ANY, self.DoStopResume)
示例5: testCompletionDateTomorrow
def testCompletionDateTomorrow(self):
tomorrow = date.Tomorrow().startOfDay()
self.viewer.showColumnByName('completionDateTime')
self.task.setCompletionDateTime(tomorrow)
self.expectInCSV(render.dateTime(tomorrow, humanReadable=False))
示例6: testCreationDateTime
def testCreationDateTime(self):
self.viewer.showColumnByName('creationDateTime')
self.expectInCSV(
render.dateTime(self.task.creationDateTime(), humanReadable=False))
示例7: testCompletionDateTimeToday
def testCompletionDateTimeToday(self):
today = date.Now()
self.viewer.showColumnByName('completionDateTime')
self.task.setCompletionDateTime(today)
self.expectInCSV(render.dateTime(today, humanReadable=False))
示例8: testCompletionDateYesterday
def testCompletionDateYesterday(self):
yesterday = date.Yesterday().startOfDay()
self.viewer.showColumnByName('completionDateTime')
self.task.setCompletionDateTime(yesterday)
self.expectInCSV(render.dateTime(yesterday, humanReadable=False))
示例9: testActualStartDateTimeTomorrow
def testActualStartDateTimeTomorrow(self):
tomorrow = date.Tomorrow()
self.viewer.showColumnByName('actualStartDateTime')
self.task.setActualStartDateTime(tomorrow)
self.expectInCSV(render.dateTime(tomorrow, humanReadable=False))
示例10: testActualStartDateToday
def testActualStartDateToday(self):
today = date.Now().startOfDay()
self.viewer.showColumnByName('actualStartDateTime')
self.task.setActualStartDateTime(today)
self.expectInCSV(render.dateTime(today, humanReadable=False))
示例11: testModificationDateTime
def testModificationDateTime(self):
self.task.setModificationDateTime(date.DateTime(2012, 1, 1, 10, 0, 0))
self.viewer.showColumnByName("modificationDateTime")
self.expectInHTML(render.dateTime(self.task.modificationDateTime(), humanReadable=False))
示例12: testActualStartDateTimeYesterday
def testActualStartDateTimeYesterday(self):
yesterday = date.Yesterday()
self.viewer.showColumnByName('actualStartDateTime')
self.task.setActualStartDateTime(yesterday)
self.expectInCSV(render.dateTime(yesterday, humanReadable=False))
示例13: testModificationDateTime
def testModificationDateTime(self):
self.viewer.showColumnByName('modificationDateTime')
self.task.setModificationDateTime(date.DateTime(2013, 1, 1, 12, 0, 0))
self.expectInCSV(
render.dateTime(
self.task.modificationDateTime(), humanReadable=False))
示例14: testDateBefore1900
def testDateBefore1900(self):
# Don't check for '1801' since the year may be formatted on only 2
# digits.
result = render.dateTime(date.DateTime(1801, 4, 5, 23, 0, 0))
self.failUnless('01' in result, result)
示例15: renderCreationDateTime
def renderCreationDateTime(item, humanReadable=True):
return render.dateTime(item.creationDateTime(),
humanReadable=humanReadable)