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))
 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))
 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))
 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))
 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
 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