def _singleton_init(self, controlState, xml): self.timezones = TimezoneList() chosenTZ = userchoices.getTimezone() if chosenTZ: self.selectedTZ = self.timezones.findByCityName(chosenTZ['city']) else: self.selectedTZ = self.timezones.defaultTimezone connectSignalHandlerByDict( self, TimezoneWindow, xml, { ('advanced_ok', 'clicked'): 'onCityListSelect', ('advanced_cancel', 'clicked'): 'onCityListCancel', ('tz_button', 'clicked'): 'onAdvancedClicked', ('TimezoneDrawingArea', 'motion_notify_event'): 'onTZDrawMotion', ('TimezoneDrawingArea', 'button_press_event'): 'onTZDrawPress', ('TimezoneDrawingArea', 'button_release_event'): 'onTZDrawRelease', ('TimezoneDrawingArea', 'expose_event'): 'onTZDrawExpose', }) self.tzEntry = xml.get_widget("tz_entry") self.advancedDialog = AdvancedDialog(xml) self.allTZsView = xml.get_widget("tz_treeview") self.setupMap(xml) self.setupTimezone(xml)
def hostActionTimezone(_context): choice = userchoices.getTimezone() timezones = TimezoneList() if choice: tz = timezones.findByZoneName(choice['tzName']) isUTC = choice['isUTC'] else: tz = timezones.defaultTimezone isUTC = True assert tz tz.hostAction(isUTC)
def hostActionTimezone(_context): choice = userchoices.getTimezone() timezones = TimezoneList() if choice: tz = timezones.findByZoneName(choice["tzName"]) isUTC = choice["isUTC"] else: tz = timezones.defaultTimezone isUTC = True assert tz tz.hostAction(isUTC)
def __init__(self): super(TimezoneWindow, self).__init__() self.substep = self.start self.timezones = TimezoneList() self.userinput = None self.uiTitle = 'Timezone' if not userchoices.getTimezone(): # not set in userchoices # copy default timezone values into userchoices dtz = self.timezones.defaultTimezone userchoices.setTimezone(dtz.zoneName, dtz.offset, dtz.city) dtz.runtimeAction() self.scrollable = None
def askConfirm(self): currentTz = userchoices.getTimezone() if currentTz['city']: formattedTz = tzDictStrWithCity % currentTz else: formattedTz = tzDictStrWithoutCity % currentTz ui = { 'title': self.uiTitle, 'body': askConfirmText % formattedTz, 'menu': { '1': self.stepForward, '2': self.showTzList, '<': self.stepBack, '?': self.help, } } self.setSubstepEnv(ui)
def _singleton_init(self, controlState, xml): self.timezones = TimezoneList() chosenTZ = userchoices.getTimezone() if chosenTZ: self.selectedTZ = self.timezones.findByCityName( chosenTZ['city'] ) else: self.selectedTZ = self.timezones.defaultTimezone connectSignalHandlerByDict(self, TimezoneWindow, xml, { ('advanced_ok', 'clicked'): 'onCityListSelect', ('advanced_cancel', 'clicked'): 'onCityListCancel', ('tz_button', 'clicked'): 'onAdvancedClicked', ('TimezoneDrawingArea', 'motion_notify_event'): 'onTZDrawMotion', ('TimezoneDrawingArea', 'button_press_event'): 'onTZDrawPress', ('TimezoneDrawingArea', 'button_release_event'): 'onTZDrawRelease', ('TimezoneDrawingArea', 'expose_event'): 'onTZDrawExpose', }) self.tzEntry = xml.get_widget("tz_entry") self.advancedDialog = AdvancedDialog(xml) self.allTZsView = xml.get_widget("tz_treeview") self.setupMap(xml) self.setupTimezone(xml)
def reviewTimezone(values): choice = userchoices.getTimezone() values['timezone'] = htmlEscape(choice.get('tzName', 'default'))
def systemClockIsUTC(): choice = userchoices.getTimezone() if not choice: return True #System clock assumed UTC by default else: return choice['isUTC']
def getTimezoneName(): choice = userchoices.getTimezone() if not choice: return os.environ.get('TZ', '') else: return choice['tzName']
def _genTimezone(): choice = userchoices.getTimezone() flags = "" return "timezone%s '%s'\n" % (flags, shquote(choice['tzName']))
def _genTimezone(): choice = userchoices.getTimezone() flags = "" return "timezone%s '%s'\n" % (flags, shquote(choice['tzName']))