Skip to content

Commit

Permalink
Merge pull request #5404 from poncovka/master-remove_timezone_map
Browse files Browse the repository at this point in the history
Remove the timezone map from the Time & Date spoke
  • Loading branch information
poncovka authored Jan 22, 2024
2 parents 7060784 + d401391 commit 1433e88
Show file tree
Hide file tree
Showing 9 changed files with 731 additions and 675 deletions.
3 changes: 0 additions & 3 deletions anaconda.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Source0: https://github.com/rhinstaller/%{name}/releases/download/%{name}-%{vers
%define libarchivever 3.0.4
%define libblockdevver 2.1
%define libreportanacondaver 2.0.21-1
%define libtimezonemapver 0.4.1-2
%define libxklavierver 5.4
%define mehver 0.23-1
%define nmver 1.0
Expand Down Expand Up @@ -70,7 +69,6 @@ BuildRequires: libarchive-devel >= %{libarchivever}
%ifarch s390 s390x
BuildRequires: s390utils-devel
%endif
BuildRequires: libtimezonemap-devel >= %{libtimezonemapver}

# Tools used by the widgets resource bundle generation
BuildRequires: gdk-pixbuf2-devel
Expand Down Expand Up @@ -278,7 +276,6 @@ Requires: adwaita-icon-theme
Requires: tigervnc-server-minimal
Requires: libxklavier >= %{libxklavierver}
Requires: libgnomekbd
Requires: libtimezonemap >= %{libtimezonemapver}
Requires: nm-connection-editor
%ifnarch s390 s390x
Requires: NetworkManager-wifi
Expand Down
11 changes: 11 additions & 0 deletions docs/release-notes/redesign_gui_time_date_spoke.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:Type: GUI
:Summary: Redesign the Time & Date spoke in GUI

:Description:
The timezone map was removed from the Time & Date spoke in the GKT-based user interface
and the spoke was redesigned to accommodate the changes. The installer no longer depends
on the the ``libtimezonemap`` package.

:Links:
- https://github.com/rhinstaller/anaconda/issues/5404
- https://github.com/rhinstaller/anaconda/discussions/5355
32 changes: 25 additions & 7 deletions pyanaconda/timezone.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,40 @@ def get_all_regions_and_timezones():
Get a dictionary mapping the regions to the list of their timezones.
:rtype: dict
"""

result = OrderedDict()

for tz in sorted(all_timezones()):
parts = tz.split("/", 1)
region, city = parse_timezone(tz)

if len(parts) > 1:
if parts[0] not in result:
result[parts[0]] = set()
result[parts[0]].add(parts[1])
if region and city:
result.setdefault(region, set())
result[region].add(city)

return result


def parse_timezone(timezone):
"""Parse the specified timezone.
Return empty strings if the timezone cannot be parsed.
:return: a region and a city
:rtype: a tuple of strings
"""
try:
region, city = timezone.split("/", 1)

if region and city:
return region, city

except ValueError:
pass

log.debug("Invalid timezone: %s", timezone)
return "", ""


def is_valid_timezone(timezone):
"""
Check if a given string is an existing timezone.
Expand Down
991 changes: 515 additions & 476 deletions pyanaconda/ui/gui/spokes/datetime_spoke.glade

Large diffs are not rendered by default.

Loading

0 comments on commit 1433e88

Please sign in to comment.