当前位置: 首页>>代码示例>>Python>>正文


Python PartyUtils.formatDateTime方法代码示例

本文整理汇总了Python中toontown.parties.PartyUtils.formatDateTime方法的典型用法代码示例。如果您正苦于以下问题:Python PartyUtils.formatDateTime方法的具体用法?Python PartyUtils.formatDateTime怎么用?Python PartyUtils.formatDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在toontown.parties.PartyUtils的用法示例。


在下文中一共展示了PartyUtils.formatDateTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: changeValue

# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import formatDateTime [as 别名]
 def changeValue(self, amount):
     if type == 'ampm':
         self.alterPartyTime(hour=(self.partyTime.hour + 12) % 24)
         newAmount = self.getCurrentAmPm()
         label['text'] = newAmount
     else:
         if type == 'hour':
             newAmount = getattr(self.partyTime, type) + amount
             newAmount = newAmount % 12
             if self.timeInputAmPmLabel['text'] == TTLocalizer.PartyTimeFormatMeridiemPM:
                 newAmount = newAmount % 12 + 12
             self.alterPartyTime(hour=newAmount)
         elif type == 'minute':
             newAmount = getattr(self.partyTime, type) + amount
             self.alterPartyTime(minute=newAmount)
         else:
             PartyPlanner.notify.error('Invalid type for changeValue in PartyPlanner: %s' % type)
         newAmount = getattr(self.partyTime, type)
         if newAmount < 10 and type == 'minute':
             label['text'] = '0%d' % newAmount
         else:
             if type == 'hour':
                 newAmount = newAmount % 12
                 if newAmount == 0:
                     newAmount = 12
             label['text'] = '%d' % newAmount
     self.timePageRecapToontownTimeLabel2['text'] = '%s' % PartyUtils.formatDateTime(self.partyTime)
     self.timePageRecapLocalTimeLabel['text'] = '%s%s' % (TTLocalizer.PartyPlannerTimeLocalTime, PartyUtils.formatDateTime(self.partyTime, inLocalTime=True))
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:30,代码来源:PartyPlanner.py

示例2: enterTime

# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import formatDateTime [as 别名]
 def enterTime(self, *args):
     self.prevButton.show()
     self.prevButton['state'] = DirectGuiGlobals.NORMAL
     self.nextButton.show()
     self.timePage.show()
     self.timePageRecapToontownTimeLabel2['text'] = '%s' % PartyUtils.formatDateTime(self.partyTime)
     self.timePageRecapLocalTimeLabel['text'] = '%s%s' % (TTLocalizer.PartyPlannerTimeLocalTime, PartyUtils.formatDateTime(self.partyTime, inLocalTime=True))
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:9,代码来源:PartyPlanner.py

示例3: _createTimePage

# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import formatDateTime [as 别名]
 def _createTimePage(self):
     page = DirectFrame(self.frame)
     page.setName('PartyPlannerTimePage')
     self.createTimeTitleLabel = DirectLabel(parent=page, relief=None, text=TTLocalizer.PartyPlannerTimeTitle, pos=self.gui.find('**/title_locator').getPos(), scale=self.titleScale)
     self.clockImage = DirectFrame(parent=page, relief=None, geom=self.gui.find('**/toontownTime_background'))
     self.timePageToontownLabel = DirectLabel(parent=page, relief=None, text=TTLocalizer.PartyPlannerTimeToontown, pos=self.gui.find('**/step_03_toontown_locator').getPos(), scale=0.15, text_fg=(1.0, 0.0, 0.0, 1.0), text_font=ToontownGlobals.getSignFont())
     self.timePageTimeLabel = DirectLabel(parent=page, relief=None, text=TTLocalizer.PartyPlannerTimeTime, pos=self.gui.find('**/step_03_time_locator').getPos(), scale=0.15, text_fg=(1.0, 0.0, 0.0, 1.0), text_font=ToontownGlobals.getSignFont())
     self.timePageRecapLabel = DirectLabel(parent=page, relief=None, text=TTLocalizer.PartyPlannerTimeRecap, pos=self.gui.find('**/step_03_partyDateAndTime_locator').getPos(), scale=0.09)
     self.timePageRecapToontownTimeLabel1 = DirectLabel(parent=page, relief=None, text=TTLocalizer.PartyPlannerTimeToontownTime, pos=self.gui.find('**/step_03_toontownTime_locator').getPos(), scale=0.06)
     self.timePageRecapToontownTimeLabel2 = DirectLabel(parent=page, relief=None, text='%s' % PartyUtils.formatDateTime(self.partyTime), pos=self.gui.find('**/step_03_toontownDateAndTime_loactor').getPos(), textMayChange=True, scale=0.06)
     self.timePageRecapLocalTimeLabel = DirectLabel(parent=page, relief=None, text='%s%s' % (TTLocalizer.PartyPlannerTimeLocalTime, PartyUtils.formatDateTime(self.partyTime, inLocalTime=True)), pos=self.gui.find('**/step_03_localDateAndTime_loactor').getPos(), textMayChange=True, scale=0.06, text_fg=(1.0, 0.0, 0.0, 1.0))
     self.timeInputHourLabel, self.timeInputHourUpButton, self.timeInputHourDownButton = self.getTimeWidgets(page, 'hour')
     self.timeInputMinuteLabel, self.timeInputMinuteUpButton, self.timeInputMinuteDownButton = self.getTimeWidgets(page, 'minute')
     self.timeInputAmPmLabel, self.timeInputAmPmUpButton, self.timeInputAmPmDownButton = self.getTimeWidgets(page, 'ampm')
     self.timePagecolonLabel = DirectLabel(parent=page, relief=None, text=':', pos=self.gui.find('**/step_03_colon_locator').getPos(), scale=0.15)
     return page
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:18,代码来源:PartyPlanner.py


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