本文整理汇总了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))
示例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))
示例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