Re: [PATCH] Support upgrading when the language isn't in lang-table (#528317).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks good to me, just one question below...

Radek

Chris Lumens wrote:
@@ -211,11 +212,36 @@ class Language(object):
     def getCurrentLangSearchList(self):
         return expandLangs(self.systemLang) + ['C']
- def getDefaultKeyboard(self):
-        return self.localeInfo[self.systemLang][3]
+    def getDefaultKeyboard(self, instPath):
+        try:
+            return self.localeInfo[self.systemLang][3]
+        except KeyError:
+            try:
+                kbd = keyboard.Keyboard()
+                kbd.read(instPath)
+                return kbd.get()
+            except:
+                return self.localeInfo[self._default][3]
+        else:
+            return self.localeInfo[self._default][3]

What is the point of this else clause?

-    def getDefaultTimeZone(self):
-        return self.localeInfo[self.systemLang][4]
+    def getDefaultTimeZone(self, instPath):
+        try:
+            return self.localeInfo[self.systemLang][4]
+        except KeyError:
+            # If doing an upgrade and the system language is something not
+            # recognized by anaconda, we should try to see if we can figure
+            # it out from the running system.
+            if os.path.exists(instPath + "/etc/sysconfig/clock"):
+                cfg = SimpleConfigFile()
+                cfg.read(instPath + "/etc/sysconfig/clock")
+
+                try:
+                    return cfg.get("ZONE")
+                except:
+                    return self.localeInfo[self._default][4]
+            else:
+                return self.localeInfo[self._default][4]
def getFontFile(self, lang):
         # Note: in /etc/fonts.cgz fonts are named by the map
diff --git a/textw/keyboard_text.py b/textw/keyboard_text.py
index 52ecffb..d136446 100644
--- a/textw/keyboard_text.py
+++ b/textw/keyboard_text.py

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux