• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python render.dateTime函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中taskcoachlib.render.dateTime函数的典型用法代码示例。如果您正苦于以下问题:Python dateTime函数的具体用法?Python dateTime怎么用?Python dateTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了dateTime函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:7,代码来源:backupmanager.py


示例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))
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:11,代码来源:TaskViewerTest.py


示例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)
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:13,代码来源:RenderTest.py


示例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)
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:19,代码来源:idlecontroller.py


示例5: testCompletionDateTomorrow

 def testCompletionDateTomorrow(self):
     tomorrow = date.Tomorrow().startOfDay()
     self.viewer.showColumnByName('completionDateTime')
     self.task.setCompletionDateTime(tomorrow)
     self.expectInCSV(render.dateTime(tomorrow, humanReadable=False))
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:5,代码来源:CSVWriterTest.py


示例6: testCreationDateTime

 def testCreationDateTime(self):
     self.viewer.showColumnByName('creationDateTime')
     self.expectInCSV(
         render.dateTime(self.task.creationDateTime(), humanReadable=False))
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:4,代码来源:CSVWriterTest.py


示例7: testCompletionDateTimeToday

 def testCompletionDateTimeToday(self):
     today = date.Now()
     self.viewer.showColumnByName('completionDateTime')
     self.task.setCompletionDateTime(today)
     self.expectInCSV(render.dateTime(today, humanReadable=False))
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:5,代码来源:CSVWriterTest.py


示例8: testCompletionDateYesterday

 def testCompletionDateYesterday(self):
     yesterday = date.Yesterday().startOfDay()
     self.viewer.showColumnByName('completionDateTime')
     self.task.setCompletionDateTime(yesterday)
     self.expectInCSV(render.dateTime(yesterday, humanReadable=False))
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:5,代码来源:CSVWriterTest.py


示例9: testActualStartDateTimeTomorrow

 def testActualStartDateTimeTomorrow(self):
     tomorrow = date.Tomorrow()
     self.viewer.showColumnByName('actualStartDateTime')
     self.task.setActualStartDateTime(tomorrow)
     self.expectInCSV(render.dateTime(tomorrow, humanReadable=False))
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:5,代码来源:CSVWriterTest.py


示例10: testActualStartDateToday

 def testActualStartDateToday(self):
     today = date.Now().startOfDay()
     self.viewer.showColumnByName('actualStartDateTime')
     self.task.setActualStartDateTime(today)
     self.expectInCSV(render.dateTime(today, humanReadable=False))
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:5,代码来源:CSVWriterTest.py


示例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))
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:4,代码来源:HTMLWriterTest.py


示例12: testActualStartDateTimeYesterday

 def testActualStartDateTimeYesterday(self):
     yesterday = date.Yesterday()
     self.viewer.showColumnByName('actualStartDateTime')
     self.task.setActualStartDateTime(yesterday)
     self.expectInCSV(render.dateTime(yesterday, humanReadable=False))
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:5,代码来源:CSVWriterTest.py


示例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))
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:6,代码来源:CSVWriterTest.py


示例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)
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:5,代码来源:RenderTest.py


示例15: renderCreationDateTime

 def renderCreationDateTime(item, humanReadable=True):
     return render.dateTime(item.creationDateTime(), 
                            humanReadable=humanReadable)
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:3,代码来源:base.py


示例16: testMissingModificationDateTime

 def testMissingModificationDateTime(self):
     self.viewer.showColumnByName('modificationDateTime')
     self.expectInHTML(render.dateTime(self.task.modificationDateTime(),
                                       humanReadable=False))
     self.expectNotInHTML('1/1/1')
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:5,代码来源:HTMLWriterTest.py


示例17: renderModificationDateTime

 def renderModificationDateTime(item, humanReadable=True):
     return render.dateTime(item.modificationDateTime(),
                            humanReadable=humanReadable)
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:3,代码来源:base.py


示例18: __init__

 def __init__(self, task, taskList, effortList, settings, *args, **kwargs):
     kwargs['title'] = _('%(name)s reminder - %(task)s') % \
         dict(name=meta.name, task=task.subject(recursive=True))
     super(ReminderDialog, self).__init__(*args, **kwargs)
     self.SetIcon(wx.ArtProvider_GetIcon('taskcoach', wx.ART_FRAME_ICON, 
                                         (16, 16)))
     self.task = task
     self.taskList = taskList
     self.effortList = effortList
     self.settings = settings
     self.registerObserver(self.onTaskRemoved, 
                           eventType=self.taskList.removeItemEventType(),
                           eventSource=self.taskList)
     pub.subscribe(self.onTaskCompletionDateChanged, 
                   task.completionDateTimeChangedEventType())
     pub.subscribe(self.onTrackingChanged, task.trackingChangedEventType())
     self.openTaskAfterClose = self.ignoreSnoozeOption = False
     pane = self.GetContentsPane()
     pane.SetSizerType("form")
     
     wx.StaticText(pane, label=_('Task') + ':')
     panel = wx.Panel(pane)
     sizer = wx.BoxSizer(wx.HORIZONTAL)
     self.openTask = wx.Button(panel, 
                               label=self.task.subject(recursive=True))
     self.openTask.Bind(wx.EVT_BUTTON, self.onOpenTask)
     sizer.Add(self.openTask, flag=wx.ALIGN_CENTER_VERTICAL)
     if self.settings.getboolean('feature', 'effort'):
         self.startTracking = wx.BitmapButton(panel)
         self.setTrackingIcon()
         self.startTracking.Bind(wx.EVT_BUTTON, self.onStartOrStopTracking)
         sizer.Add((3, -1), flag=wx.ALIGN_CENTER_VERTICAL)
         sizer.Add(self.startTracking, flag=wx.ALIGN_CENTER_VERTICAL)
     panel.SetSizerAndFit(sizer)
     
     for label in _('Reminder date/time') + ':', \
         render.dateTime(self.task.reminder()), _('Snooze') + ':':
         wx.StaticText(pane, label=label)
         
     self.snoozeOptions = wx.ComboBox(pane, style=wx.CB_READONLY)
     sizer.Add(self.snoozeOptions, flag=wx.ALIGN_CENTER_VERTICAL)
     snoozeTimesUserWantsToSee = [0] + self.settings.getlist('view', 
                                                             'snoozetimes')
     defaultSnoozeTime = self.settings.getint('view', 'defaultsnoozetime')
     # Use the 1st non-zero option if we don't find the last snooze time:
     selectionIndex = 1  
     # pylint: disable=E1101
     for minutes, label in date.snoozeChoices:
         if minutes in snoozeTimesUserWantsToSee:
             self.snoozeOptions.Append(label, 
                                       date.TimeDelta(minutes=minutes))
             if minutes == defaultSnoozeTime:
                 selectionIndex = self.snoozeOptions.Count - 1
     self.snoozeOptions.SetSelection(min(selectionIndex, 
                                         self.snoozeOptions.Count - 1))
     
     wx.StaticText(pane, label='')
     self.replaceDefaultSnoozeTime = wx.CheckBox(pane, 
         label=_('Also make this the default snooze time for future '
                 'reminders'))
     self.replaceDefaultSnoozeTime.SetValue(self.settings.getboolean('view', 
                                            'replacedefaultsnoozetime'))
     
     buttonSizer = self.CreateStdDialogButtonSizer(wx.OK)
     self.markCompleted = wx.Button(self, label=_('Mark task completed'))
     self.markCompleted.Bind(wx.EVT_BUTTON, self.onMarkTaskCompleted)
     if self.task.completed():
         self.markCompleted.Disable()
     buttonSizer.Add(self.markCompleted, flag=wx.ALIGN_CENTER_VERTICAL)
     self.SetButtonSizer(buttonSizer)
     self.Bind(wx.EVT_CLOSE, self.onClose)
     self.Bind(wx.EVT_BUTTON, self.onOK, id=self.GetAffirmativeId())
     self.Fit()
     self.RequestUserAttention()
     if self.settings.getboolean('feature', 'sayreminder'):
         speak.Speaker().say('"%s: %s"' % (_('Reminder'), task.subject()))
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:76,代码来源:reminder.py


示例19: testPlannedStartDateTimeToday

 def testPlannedStartDateTimeToday(self):
     today = date.Now()
     self.viewer.showColumnByName('plannedStartDateTime')
     self.task.setPlannedStartDateTime(today)
     self.expectInCSV(render.dateTime(today, humanReadable=False))
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:5,代码来源:CSVWriterTest.py



注:本文中的taskcoachlib.render.dateTime函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python render.time函数代码示例发布时间:2022-05-27
下一篇:
Python operating_system.isWindows函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap