[master] "Man, I really like langtable!" patches

Vratislav Podzimek vpodzime at redhat.com
Fri Jul 12 11:01:35 UTC 2013


These patches clean and simplify our code by making use of the wonderful
langtable package and module.

PATCH 1/3 replaces a vast majority of our localization module with a new version
that is better readable, much simpler, well documented and easily testable
(I'll add tests soon). It's "2 files changed, 267 insertions(+),
355 deletions(-)", but this is how pylint sees it:

+----------+-------+------+---------+-----------+
|type      |number |%     |previous |difference |
+==========+=======+======+=========+===========+
|code      |142    |37.37 |282      |-140.00    |
+----------+-------+------+---------+-----------+
|docstring |166    |43.68 |47       |+119.00    |
+----------+-------+------+---------+-----------+
|comment   |31     |8.16  |45       |-14.00     |
+----------+-------+------+---------+-----------+
|empty     |41     |10.79 |26       |+15.00     |
+----------+-------+------+---------+-----------+

And it also allows us to get rid of the python-babel (5.2 M) package as a
dependency.

PATCH 2/3 adapts our code to the new localization module. It could be squashed
with the PATCH 1/3 as they don't work one without the other, but I think it's
better to have them separate. It also removes some lines of code and makes it
more clear.

Finally, PATCH 3/3 removes a lot of our magic for guessing the right default
keyboard layout for a given language and country, i.e. a given locale. This is
the only patch changing the Anaconda's behaviour is some way. The other two
bring Anaconda to the same functionality as without this patchset applied. The
only difference are some additional languages appearing on the welcome screen
as langtable knows more stuff than the babel module.

Vratislav Podzimek (3):
  Rewrite the localization module
  Adapt to the new localization module
  Use langtable to get default layout instead of our magic (#485137)

 anaconda                                |  38 +-
 anaconda.spec.in                        |   3 +-
 pyanaconda/keyboard.py                  |  60 +--
 pyanaconda/localization.py              | 637 ++++++++++++++------------------
 pyanaconda/timezone.py                  |  36 +-
 pyanaconda/ui/gui/spokes/langsupport.py |  52 +--
 pyanaconda/ui/gui/spokes/welcome.py     |  94 ++---
 7 files changed, 370 insertions(+), 550 deletions(-)

-- 
1.7.11.7



More information about the anaconda-patches mailing list