[PATCH 3/3] Send run-hub and run-spoke into the great beyond
David Shea
dshea at redhat.com
Fri Aug 22 21:19:35 UTC 2014
---
Makefile.am | 37 ---------
configure.ac | 2 -
pyanaconda/ui/gui/Makefile.am | 2 +-
pyanaconda/ui/gui/tools/Makefile.am | 20 -----
pyanaconda/ui/gui/tools/README | 50 ------------
pyanaconda/ui/gui/tools/run-hub.py | 1 -
pyanaconda/ui/gui/tools/run-spoke.py | 131 ------------------------------
pyanaconda/ui/tui/Makefile.am | 2 +-
pyanaconda/ui/tui/tools/Makefile.am | 20 -----
pyanaconda/ui/tui/tools/run-text-hub.py | 1 -
pyanaconda/ui/tui/tools/run-text-spoke.py | 103 -----------------------
11 files changed, 2 insertions(+), 367 deletions(-)
delete mode 100644 pyanaconda/ui/gui/tools/Makefile.am
delete mode 100644 pyanaconda/ui/gui/tools/README
delete mode 120000 pyanaconda/ui/gui/tools/run-hub.py
delete mode 100755 pyanaconda/ui/gui/tools/run-spoke.py
delete mode 100644 pyanaconda/ui/tui/tools/Makefile.am
delete mode 120000 pyanaconda/ui/tui/tools/run-text-hub.py
delete mode 100755 pyanaconda/ui/tui/tools/run-text-spoke.py
diff --git a/Makefile.am b/Makefile.am
index af5dbaf..a014e24 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -136,43 +136,6 @@ unittests-logpicker:
PYTHONPATH=$(builddir)/pyanaconda/isys/.libs:tests/:$(srcdir):utils/ nosetests -v old_tests/logpicker_test
# GUI TESTING
-runspoke:
- ANACONDA_DATA=$(srcdir)/data \
- ANACONDA_WIDGETS_OVERRIDES=$(srcdir)/widgets/python \
- ANACONDA_WIDGETS_DATA=$(srcdir)/widgets/data \
- ANACONDA_INSTALL_CLASSES=$(srcdir)/pyanaconda/installclasses \
- PYTHONPATH=$(srcdir):$(builddir)/pyanaconda/isys/.libs:$(srcdir)/widgets/python/:$(builddir)/widgets/src/.libs/ \
- LD_LIBRARY_PATH=$(builddir)/widgets/src/.libs \
- UIPATH=$(srcdir)/pyanaconda/ui/gui/ \
- GI_TYPELIB_PATH=$(builddir)/widgets/src/ \
- $(srcdir)/pyanaconda/ui/gui/tools/run-spoke.py ${SPOKE_MODULE} ${SPOKE_CLASS}
-
-runhub:
- ANACONDA_DATA=$(srcdir)/data \
- ANACONDA_WIDGETS_OVERRIDES=$(srcdir)/widgets/python \
- ANACONDA_WIDGETS_DATA=$(srcdir)/widgets/data \
- ANACONDA_INSTALL_CLASSES=$(srcdir)/pyanaconda/installclasses \
- PYTHONPATH=$(srcdir):$(builddir)/pyanaconda/isys/.libs:$(srcdir)/widgets/python/:$(builddir)/widgets/src/.libs/ \
- LD_LIBRARY_PATH=$(builddir)/widgets/src/.libs \
- UIPATH=$(srcdir)/pyanaconda/ui/gui/ \
- GI_TYPELIB_PATH=$(builddir)/widgets/src/ \
- $(srcdir)/pyanaconda/ui/gui/tools/run-hub.py ${HUB_MODULE} ${HUB_CLASS}
-
-runtextspoke:
- ANACONDA_DATA=$(srcdir)/data \
- ANACONDA_INSTALL_CLASSES=$(srcdir)/pyanaconda/installclasses \
- PYTHONPATH=$(srcdir):$(builddir)/pyanaconda/isys/.libs:$(srcdir)/widgets/python/:$(builddir)/widgets/src/.libs/ \
- LD_LIBRARY_PATH=$(builddir)/widgets/src/.libs \
- $(srcdir)/pyanaconda/ui/tui/tools/run-text-spoke.py ${SPOKE_MODULE} ${SPOKE_CLASS}
-
-runtexthub:
- ANACONDA_DATA=$(srcdir)/data \
- ANACONDA_INSTALL_CLASSES=$(srcdir)/pyanaconda/installclasses \
- PYTHONPATH=$(srcdir):$(builddir)/pyanaconda/isys/.libs:$(srcdir)/widgets/python/:$(builddir)/widgets/src/.libs/ \
- LD_LIBRARY_PATH=$(builddir)/widgets/src/.libs \
- $(srcdir)/pyanaconda/ui/tui/tools/run-text-hub.py ${HUB_MODULE} ${HUB_CLASS}
-
-
runglade:
ANACONDA_DATA=$(srcdir)/data \
ANACONDA_WIDGETS_OVERRIDES=$(srcdir)/widgets/python \
diff --git a/configure.ac b/configure.ac
index 37ec4ef..79efbc8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,12 +167,10 @@ AC_CONFIG_FILES([Makefile
pyanaconda/ui/gui/spokes/Makefile
pyanaconda/ui/gui/spokes/advstorage/Makefile
pyanaconda/ui/gui/spokes/lib/Makefile
- pyanaconda/ui/gui/tools/Makefile
pyanaconda/ui/gui/Makefile
pyanaconda/ui/tui/hubs/Makefile
pyanaconda/ui/tui/simpleline/Makefile
pyanaconda/ui/tui/spokes/Makefile
- pyanaconda/ui/tui/tools/Makefile
pyanaconda/ui/tui/Makefile
data/post-scripts/Makefile
tests/Makefile
diff --git a/pyanaconda/ui/gui/Makefile.am b/pyanaconda/ui/gui/Makefile.am
index 013c550..1a618f4 100644
--- a/pyanaconda/ui/gui/Makefile.am
+++ b/pyanaconda/ui/gui/Makefile.am
@@ -15,7 +15,7 @@
#
# Author: Chris Lumens <clumens at redhat.com>
-SUBDIRS = hubs spokes tools
+SUBDIRS = hubs spokes
MAINTAINERCLEANFILES = Makefile.in
diff --git a/pyanaconda/ui/gui/tools/Makefile.am b/pyanaconda/ui/gui/tools/Makefile.am
deleted file mode 100644
index 09e5924..0000000
--- a/pyanaconda/ui/gui/tools/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2011 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published
-# by the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author: Chris Lumens <clumens at redhat.com>
-
-EXTRA_DIST = README run-hub.py run-spoke.py
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/pyanaconda/ui/gui/tools/README b/pyanaconda/ui/gui/tools/README
deleted file mode 100644
index 1b48330..0000000
--- a/pyanaconda/ui/gui/tools/README
+++ /dev/null
@@ -1,50 +0,0 @@
-This directory contains some tools that are helpful in developing the
-anaconda UI. They assume that you have an anaconda git tree checked out
-(which you should if you're reading this), that you've run make in that
-tree, and that you have the anaconda-widgets and anaconda-widgets-devel
-packages installed.
-
-Here's what you've got to work with:
-
-run-spoke.py
-------------
-This program allows you to run a single GUI spoke on an installed system
-without having to start up anaconda. You do not have to be root to do this
-and if you come across a situation where that ends up being a lie, it's a
-bug in anaconda. Please fix it.
-
-This lets you very quickly make tweaks to your glade file and test it out
-to see what things look like when some data is added, or check how buttons
-and dialogs behave. Often, there can be UI layout differences between how
-things look in glade and how they look in reality.
-
-To run, first modify the following lines:
-
- #from pyanaconda.ui.gui.spokes.software import SoftwareSelectionSpoke
- #spokeClass = SoftwareSelectionSpoke
- spokeClass = None
-
-Uncomment the first two, changing "software" and "SoftwareSelectionSpoke" to
-the names of the things you're testing, and then remove the third line.
-
-Then, you run it like so (assuming you're in your home directory):
-
-$ PYTHONPATH=src/anaconda:src/anaconda/pyanaconda/isys/.libs \
- UIPATH=src/anaconda/pyanaconda/ui/gui/ \
- src/anaconda/pyanaconda/ui/gui/tools/run-spoke.py
-
-The $UIPATH environment variable ensures that you do not need to be anywhere
-special when you run the program. anaconda will be able to find your glade
-file based on that.
-
-run-hub.py
-----------
-This is the same as run-spoke.py, except it deals with hubs instead of spokes.
-Because it deals with hubs, it also provides you with the ability to dive
-down into individual spokes. This is useful for making sure that the status,
-apply, and setup methods of spokes work correctly.
-
-Pressing the quit and continue buttons will immediately quit the program.
-
-
-Direct any questions to clumens at redhat.com.
diff --git a/pyanaconda/ui/gui/tools/run-hub.py b/pyanaconda/ui/gui/tools/run-hub.py
deleted file mode 120000
index 4583bed..0000000
--- a/pyanaconda/ui/gui/tools/run-hub.py
+++ /dev/null
@@ -1 +0,0 @@
-run-spoke.py
\ No newline at end of file
diff --git a/pyanaconda/ui/gui/tools/run-spoke.py b/pyanaconda/ui/gui/tools/run-spoke.py
deleted file mode 100755
index 4edaacd..0000000
--- a/pyanaconda/ui/gui/tools/run-spoke.py
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/bin/python
-
-import sys, os
-
-import gi.overrides
-
-# We need this so we can tell GI to look for overrides objects
-# also in anaconda source directories
-for p in os.environ.get("ANACONDA_WIDGETS_OVERRIDES", "").split(":"):
- gi.overrides.__path__.insert(0, p)
-
-from gi.repository import Gtk
-
-import ctypes
-import os.path
-
-# Check command line arguments
-if len(sys.argv)<2:
- print("Usage: $0 <spoke module name> [<spoke widget class>]")
- sys.exit(1)
-
-# This is a hack to make sure the AnacondaWidgets library gets loaded
-ctypes.CDLL("libAnacondaWidgets.so.1", ctypes.RTLD_GLOBAL)
-
-# Logging always needs to be set up first thing, or there'll be tracebacks.
-from pyanaconda import anaconda_log
-anaconda_log.init()
-
-from pyanaconda.installclass import DefaultInstall
-from blivet import Blivet
-from pyanaconda.threads import initThreading
-from pyanaconda.packaging.yumpayload import YumPayload
-from pykickstart.version import makeVersion
-
-# Don't worry with fcoe, iscsi, dasd, any of that crud.
-from pyanaconda.flags import flags
-flags.imageInstall = True
-flags.testing = True
-
-initThreading()
-
-# Figure out the part we are about to show: hub/spoke?
-# And get the name of the module which represents it
-if os.path.basename(sys.argv[0]) == "run-spoke.py":
- spokeModuleName = "pyanaconda.ui.gui.spokes.%s" % sys.argv[1]
- from pyanaconda.ui.common import Spoke
- spokeBaseClass = Spoke
- spokeText = "spoke"
- SpokeText = "Spoke"
-elif os.path.basename(sys.argv[0]) == "run-hub.py":
- spokeModuleName = "pyanaconda.ui.gui.hubs.%s" % sys.argv[1]
- from pyanaconda.ui.common import Hub
- spokeBaseClass = Hub
- spokeText = "hub"
- SpokeText = "Hub"
-else:
- print("You have to run this command as run-spoke.py or run-hub.py.")
- sys.exit(1)
-
-# Set default spoke class
-spokeClass = None
-
-# Load spoke specified on the command line
-# If the spoke module was specified, but the spoke class was not,
-# try to find it using class hierarchy
-try:
- spokeClassName = sys.argv[2]
- __import__(spokeModuleName, fromlist = [spokeClassName])
- spokeModule = sys.modules[spokeModuleName]
-except IndexError:
- __import__(spokeModuleName)
- spokeModule = sys.modules[spokeModuleName]
- for k,v in vars(spokeModule).iteritems():
- try:
- if issubclass(v, spokeBaseClass) and v != spokeBaseClass:
- spokeClassName = k
- spokeClass = v
- except TypeError:
- pass
-
-if not spokeClass:
- try:
- spokeClass = getattr(spokeModule, spokeClassName)
- except KeyError:
- print("%s %s could not be found in %s" % (SpokeText, spokeClassName, spokeModuleName))
- sys.exit(1)
-
-
-print("Running %s %s from %s" % (spokeText, spokeClass, spokeModule))
-
-ksdata = makeVersion()
-storage = Blivet(ksdata=ksdata)
-storage.reset()
-instclass = DefaultInstall()
-
-payload = YumPayload(ksdata)
-payload.setup(storage)
-
-from pyanaconda.ui.gui.spokes import StandaloneSpoke
-spoke = spokeClass(ksdata, storage, payload, instclass)
-if isinstance(spoke, StandaloneSpoke):
- spoke.window.connect_after("continue-clicked", Gtk.main_quit)
- spoke.window.connect("quit-clicked", Gtk.main_quit)
-
-if hasattr(spoke, "set_path"):
- spoke.set_path("categories", [
- ("pyanaconda.ui.categories.%s",
- os.path.join(os.path.dirname(__file__),"..", "categories"))
- ])
- spoke.set_path("spokes", [
- ("pyanaconda.ui.gui.spokes.%s",
- os.path.join(os.path.dirname(__file__), "..", "spokes"))
- ])
-
-spoke.initialize()
-
-if not spoke.showable:
- print("This %s is not showable, but I'll continue anyway." % spokeText)
-
-spoke.refresh()
-spoke.window.set_beta(True)
-spoke.window.set_property("distribution", "TEST HARNESS")
-spoke.window.show_all()
-
-Gtk.main()
-
-if hasattr(spoke, "status"):
- print("%s status:\n%s\n" % (SpokeText, spoke.status))
-if hasattr(spoke, "completed"):
- print("%s completed:\n%s\n" % (SpokeText, spoke.completed))
-print("%s kickstart fragment:\n%s" % (SpokeText, ksdata))
diff --git a/pyanaconda/ui/tui/Makefile.am b/pyanaconda/ui/tui/Makefile.am
index 389638e..5abbf2e 100644
--- a/pyanaconda/ui/tui/Makefile.am
+++ b/pyanaconda/ui/tui/Makefile.am
@@ -15,7 +15,7 @@
#
# Author: Chris Lumens <clumens at redhat.com>
-SUBDIRS = hubs spokes simpleline tools
+SUBDIRS = hubs spokes simpleline
MAINTAINERCLEANFILES = Makefile.in
diff --git a/pyanaconda/ui/tui/tools/Makefile.am b/pyanaconda/ui/tui/tools/Makefile.am
deleted file mode 100644
index 408c53a..0000000
--- a/pyanaconda/ui/tui/tools/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2011 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published
-# by the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author: Chris Lumens <clumens at redhat.com>
-
-EXTRA_DIST = run-text-hub.py run-text-spoke.py
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/pyanaconda/ui/tui/tools/run-text-hub.py b/pyanaconda/ui/tui/tools/run-text-hub.py
deleted file mode 120000
index 506993e..0000000
--- a/pyanaconda/ui/tui/tools/run-text-hub.py
+++ /dev/null
@@ -1 +0,0 @@
-run-text-spoke.py
\ No newline at end of file
diff --git a/pyanaconda/ui/tui/tools/run-text-spoke.py b/pyanaconda/ui/tui/tools/run-text-spoke.py
deleted file mode 100755
index c503cdc..0000000
--- a/pyanaconda/ui/tui/tools/run-text-spoke.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/python
-
-import sys, os
-import os.path
-
-# Check command line arguments
-if len(sys.argv)<2:
- print("Usage: $0 <spoke module name> [<spoke widget class>]")
- sys.exit(1)
-
-# Logging always needs to be set up first thing, or there'll be tracebacks.
-from pyanaconda import anaconda_log
-anaconda_log.init()
-
-from pyanaconda.installclass import DefaultInstall
-from blivet import Blivet
-from pyanaconda.threads import initThreading
-from pyanaconda.packaging.yumpayload import YumPayload
-from pykickstart.version import makeVersion
-from pyanaconda.ui.tui.simpleline import App
-from pyanaconda.ui.tui import YesNoDialog
-
-# Don't worry with fcoe, iscsi, dasd, any of that crud.
-from pyanaconda.flags import flags
-flags.imageInstall = True
-flags.testing = True
-
-initThreading()
-
-# Figure out the part we are about to show: hub/spoke?
-# And get the name of the module which represents it
-if os.path.basename(sys.argv[0]) == "run-text-spoke.py":
- spokeModuleName = "pyanaconda.ui.tui.spokes.%s" % sys.argv[1]
- from pyanaconda.ui.common import Spoke
- spokeBaseClass = Spoke
- spokeText = "spoke"
- SpokeText = "Spoke"
-elif os.path.basename(sys.argv[0]) == "run-text-hub.py":
- spokeModuleName = "pyanaconda.ui.tui.hubs.%s" % sys.argv[1]
- from pyanaconda.ui.common import Hub
- spokeBaseClass = Hub
- spokeText = "hub"
- SpokeText = "Hub"
-else:
- print("You have to run this command as run-spoke.py or run-hub.py.")
- sys.exit(1)
-
-# Set default spoke class
-spokeClass = None
-spokeClassName = None
-
-# Load spoke specified on the command line
-# If the spoke module was specified, but the spoke class was not,
-# try to find it using class hierarchy
-try:
- spokeClassName = sys.argv[2]
- __import__(spokeModuleName, fromlist = [spokeClassName])
- spokeModule = sys.modules[spokeModuleName]
-except IndexError:
- __import__(spokeModuleName)
- spokeModule = sys.modules[spokeModuleName]
- for k,v in vars(spokeModule).iteritems():
- try:
- print(k,v)
- if issubclass(v, spokeBaseClass) and v != spokeBaseClass:
- spokeClassName = k
- spokeClass = v
- except TypeError:
- pass
-
-if not spokeClass:
- try:
- spokeClass = getattr(spokeModule, spokeClassName)
- except KeyError:
- print("%s %s could not be found in %s" % (SpokeText, spokeClassName, spokeModuleName))
- sys.exit(1)
-
-
-print("Running %s %s from %s" % (spokeText, spokeClass, spokeModule))
-
-ksdata = makeVersion()
-storage = Blivet(ksdata=ksdata)
-storage.reset()
-instclass = DefaultInstall()
-app = App("TEST HARNESS", yes_or_no_question = YesNoDialog)
-
-payload = YumPayload(ksdata)
-payload.setup(storage)
-payload.install_log = sys.stdout
-
-spoke = spokeClass(app, ksdata, storage, payload, instclass)
-
-if not spoke.showable:
- print("This %s is not showable, but I'll continue anyway." % spokeText)
-
-app.schedule_screen(spoke)
-app.run()
-
-if hasattr(spoke, "status"):
- print("%s status:\n%s\n" % (SpokeText, spoke.status))
-if hasattr(spoke, "completed"):
- print("%s completed:\n%s\n" % (SpokeText, spoke.completed))
-print("%s kickstart fragment:\n%s" % (SpokeText, ksdata))
--
1.9.3
More information about the anaconda-patches
mailing list