From da3e92312c997ffee810f39fc5148c1a60b7b02c Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 4 Sep 2015 19:24:04 +0530 Subject: [PATCH] config: Handle miscellaneous time zones also - In appears that in Debian it is possible to set the timezones from one of the listed items in zonetab.info or addtitional timezones from the directory /usr/share/zoneinfo/Etc/. Add these too. - By default all FreedomBox images have Etc/UTC as time zone. This is now properly listed. --- plinth/modules/config/config.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plinth/modules/config/config.py b/plinth/modules/config/config.py index f8f176c45..f277fe588 100644 --- a/plinth/modules/config/config.py +++ b/plinth/modules/config/config.py @@ -24,6 +24,7 @@ from django.contrib import messages from django.core import validators from django.template.response import TemplateResponse from gettext import gettext as _ +import glob import logging import re import socket @@ -111,7 +112,14 @@ separated by dots.'), pass time_zones.sort() - return time_zones + + additional_time_zones = [ + path[len('/usr/share/zoneinfo/'):] + for path in glob.glob('/usr/share/zoneinfo/Etc/*')] + + # Add additional time zones at the top to make them more + # noticeable because people won't look for them + return additional_time_zones + time_zones def init():