[master 02/11] modules: pyanaconda.textw and pyanaconda.iw are now regular modules.

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

 



---
 loader/loader.c              |    2 --
 pyanaconda/gui.py            |    9 +++++----
 pyanaconda/text.py           |   14 +++++++-------
 3 files changed, 12 insertions(+), 13 deletions(-)
 create mode 100644 pyanaconda/iw/__init__.py
 create mode 100644 pyanaconda/textw/__init__.py

diff --git a/loader/loader.c b/loader/loader.c
index 082dbed..edbb67b 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -2221,8 +2221,6 @@ int main(int argc, char ** argv) {
     add_fw_search_dir(&loaderData, "/tmp/product/firmware");
 
     add_to_path_env("PYTHONPATH", "/tmp/updates");
-    add_to_path_env("PYTHONPATH", "/tmp/updates/iw");
-    add_to_path_env("PYTHONPATH", "/tmp/updates/textw");
     add_to_path_env("PYTHONPATH", "/tmp/product");
     add_to_path_env("LD_LIBRARY_PATH", "/tmp/updates");
     add_to_path_env("LD_LIBRARY_PATH", "/tmp/product");
diff --git a/pyanaconda/gui.py b/pyanaconda/gui.py
index 6655538..f970ee5 100755
--- a/pyanaconda/gui.py
+++ b/pyanaconda/gui.py
@@ -44,7 +44,8 @@ from product import *
 import network
 from installinterfacebase import InstallInterfaceBase
 import xutils
-import imputil
+import imp
+import iw
 
 import gettext
 _ = lambda x: gettext.ldgettext("anaconda", x)
@@ -1214,9 +1215,9 @@ class InstallControlWindow:
 
         while True:
             try:
-                found = imputil.imp.find_module(file)
-                loaded = imputil.imp.load_module(className, found[0], found[1],
-                                                 found[2])
+                found = imp.find_module(file, iw.__path__)
+                moduleName = 'pyanaconda.iw.%s' % file
+                loaded = imp.load_module(moduleName, *found)
                 newScreenClass = loaded.__dict__[className]
                 break
             except ImportError, e:
diff --git a/pyanaconda/iw/__init__.py b/pyanaconda/iw/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/pyanaconda/text.py b/pyanaconda/text.py
index ca2961f..0c48407 100644
--- a/pyanaconda/text.py
+++ b/pyanaconda/text.py
@@ -33,11 +33,12 @@ import product
 import string
 from language import expandLangs
 from flags import flags
-from constants_text import *
+from textw.constants_text import *
 from constants import *
 from network import hasActiveNetDev
 from installinterfacebase import InstallInterfaceBase
-import imputil
+import imp
+import textw
 
 import gettext
 _ = lambda x: gettext.ldgettext("anaconda", x)
@@ -501,13 +502,12 @@ class InstallInterface(InstallInterfaceBase):
 
                 while 1:
                     try:
-                        found = imputil.imp.find_module(file)
-                        loaded = imputil.imp.load_module(classNames[step],
-                                                         found[0], found[1],
-                                                         found[2])
+                        found = imp.find_module(file, textw.__path__)
+                        moduleName = 'pyanaconda.textw.%s' % file
+                        loaded = imp.load_module(moduleName, *found)
                         nextWindow = loaded.__dict__[classNames[step]]
                         break
-                    except ImportError, e:
+                    except ImportError as e:
                         rc = ButtonChoiceWindow(self.screen, _("Error!"),
                                           _("An error occurred when attempting "
                                             "to load an installer interface "
diff --git a/pyanaconda/textw/__init__.py b/pyanaconda/textw/__init__.py
new file mode 100644
index 0000000..e69de29
-- 
1.7.0.1

_______________________________________________
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