summaryrefslogtreecommitdiffstats
path: root/pyanaconda/ui
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2012-12-19 15:52:30 +0100
committerMartin Sivak <msivak@redhat.com>2013-01-02 13:53:03 +0100
commit1f7a448ce014b5269858ba0bf76c25949f48de2e (patch)
treee3f85d3a3836da378613096d7bf4172a234ff725 /pyanaconda/ui
parent266ef9bd7f9468628c86a0bf868c9c549681191f (diff)
downloadanaconda-1f7a448ce014b5269858ba0bf76c25949f48de2e.tar.gz
anaconda-1f7a448ce014b5269858ba0bf76c25949f48de2e.tar.xz
anaconda-1f7a448ce014b5269858ba0bf76c25949f48de2e.zip
Update the way we look for glade files, spokes, hubs and categories
Anaconda will look for glade files also in the same directory where the source file requesting it is located. This patch also adds updates dictionaries to the list of paths we use to look for spokes, hubs and categories.
Diffstat (limited to 'pyanaconda/ui')
-rw-r--r--pyanaconda/ui/gui/__init__.py20
-rw-r--r--pyanaconda/ui/tui/__init__.py8
2 files changed, 21 insertions, 7 deletions
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index b3c74dea0..1ffc49048 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -122,8 +122,13 @@ class GUIObject(common.UIObject):
def _findUIFile(self):
path = os.environ.get("UIPATH", "./:/tmp/updates/:/tmp/updates/ui/:/usr/share/anaconda/ui/")
- for d in path.split(":"):
- testPath = os.path.normpath(d + self.uiFile)
+ dirs = path.split(":")
+
+ # append the directory where this UIObject is defined
+ dirs.append(os.path.dirname(inspect.getfile(self.__class__)))
+
+ for d in dirs:
+ testPath = os.path.join(d, self.uiFile)
if os.path.isfile(testPath) and os.access(testPath, os.R_OK):
return testPath
@@ -238,13 +243,18 @@ class GraphicalUserInterface(UserInterface):
basemask = "pyanaconda.ui.gui"
basepath = os.path.dirname(__file__)
+ updatepath = "/tmp/updates/pyanaconda/ui/gui"
+
paths = UserInterface.paths + {
"categories": [(basemask + ".categories.%s",
- os.path.join(basepath, "categories"))],
+ os.path.join(path, "categories"))
+ for path in (updatepath, basepath)],
"spokes": [(basemask + ".spokes.%s",
- os.path.join(basepath, "spokes"))],
+ os.path.join(path, "spokes"))
+ for path in (updatepath, basepath)],
"hubs": [(basemask + ".hubs.%s",
- os.path.join(basepath, "hubs"))]
+ os.path.join(path, "hubs"))
+ for path in (updatepath, basepath)]
}
def _list_hubs(self):
diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
index b715d0a79..1bf71e719 100644
--- a/pyanaconda/ui/tui/__init__.py
+++ b/pyanaconda/ui/tui/__init__.py
@@ -131,11 +131,15 @@ class TextUserInterface(ui.UserInterface):
basemask = "pyanaconda.ui.tui"
basepath = os.path.dirname(__file__)
+ updatepath = "/tmp/updates/pyanaconda/ui/tui"
+
paths = ui.UserInterface.paths + {
"spokes": [(basemask + ".spokes.%s",
- os.path.join(basepath, "spokes"))],
+ os.path.join(path, "spokes"))
+ for path in (updatepath, basepath)],
"hubs": [(basemask + ".hubs.%s",
- os.path.join(basepath, "hubs"))]
+ os.path.join(path, "hubs"))
+ for path in (updatepath, basepath)]
}
def _list_hubs(self):