Fix install vars

master3.3
Mike Hiretsky 12 years ago
parent f7fb148da1
commit 2131727a8e

@ -621,7 +621,7 @@ class VariableOsLocationData(LocationHelper,TableVariable):
self.label = _("Locations")
def set(self,value):
return sorted(value,key=lambda x:x[0])
return sorted(value,key=lambda x:x and x[0])
class VariableOsLocationSource(LocationHelper,DeviceHelper,Variable):
"""

@ -232,8 +232,10 @@ class VariableOsInstallClockTimezone(LocaleVariable):
lang = self.Get('os_install_locale_lang').split('_')[1]
nativeTZ = map(lambda x:x.encode('utf-8'),
country_timezones[lang])
source = nativeTZ + ["---"] + filter(lambda x:not x in nativeTZ,
source)
source = nativeTZ + ["---"] + \
sorted(filter(lambda x:not x in nativeTZ,source),
key=lambda x:timezone(x)._utcoffset.total_seconds(),
reverse=True)
except (KeyError,IndexError) as e:
pass
return list(self.generateComments(source))

Loading…
Cancel
Save