[PATCH 29/34] Straighten out text UI methods so they have the same method signature.
Chris Lumens
clumens at redhat.com
Mon Aug 12 20:33:05 UTC 2013
---
pyanaconda/ui/tui/hubs/progress.py | 2 +-
pyanaconda/ui/tui/simpleline/base.py | 2 +-
pyanaconda/ui/tui/spokes/__init__.py | 19 +++++++++++++------
pyanaconda/ui/tui/spokes/time_spoke.py | 2 +-
pyanaconda/ui/tui/tuiobject.py | 2 +-
5 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/pyanaconda/ui/tui/hubs/progress.py b/pyanaconda/ui/tui/hubs/progress.py
index 3f7cace..82ad263 100644
--- a/pyanaconda/ui/tui/hubs/progress.py
+++ b/pyanaconda/ui/tui/hubs/progress.py
@@ -94,7 +94,7 @@ class ProgressHub(TUIHub):
q.task_done()
return True
- def refresh(self, args):
+ def refresh(self, args = None):
from pyanaconda.install import doInstall, doConfiguration
from pyanaconda.threads import threadMgr, AnacondaThread
diff --git a/pyanaconda/ui/tui/simpleline/base.py b/pyanaconda/ui/tui/simpleline/base.py
index 2f09506..6384a63 100644
--- a/pyanaconda/ui/tui/simpleline/base.py
+++ b/pyanaconda/ui/tui/simpleline/base.py
@@ -616,7 +616,7 @@ class Widget(object):
"""This has to return list (rows) of lists (columns) with one character elements."""
return self._buffer
- def render(self, width = None):
+ def render(self, width):
"""This method has to redraw the widget's self._buffer.
:param width: the width of buffer requested by the caller
diff --git a/pyanaconda/ui/tui/spokes/__init__.py b/pyanaconda/ui/tui/spokes/__init__.py
index bdb2bff..ff10e34 100644
--- a/pyanaconda/ui/tui/spokes/__init__.py
+++ b/pyanaconda/ui/tui/spokes/__init__.py
@@ -98,12 +98,15 @@ class EditTUIDialog(NormalTUISpoke):
NormalTUISpoke.__init__(self, app, data, storage, payload, instclass)
self.value = None
- def refresh(self, args):
+ def refresh(self, args = None):
self._window = []
self.value = None
return True
- def prompt(self, entry):
+ def prompt(self, entry = None):
+ if not entry:
+ return None
+
if entry.aux == self.PASSWORD:
pw = self._app.raw_input(_("%s: ") % entry.title, hidden=True)
confirm = self._app.raw_input(_("%s (confirm): ") % entry.title, hidden=True)
@@ -141,10 +144,14 @@ class OneShotEditTUIDialog(EditTUIDialog):
the value is read
"""
- def prompt(self, entry):
- ret = EditTUIDialog.prompt(self, entry)
- if ret is None:
- self.close()
+ def prompt(self, entry = None):
+ ret = None
+
+ if entry:
+ ret = EditTUIDialog.prompt(self, entry)
+ if ret is None:
+ self.close()
+
return ret
class EditTUISpoke(NormalTUISpoke):
diff --git a/pyanaconda/ui/tui/spokes/time_spoke.py b/pyanaconda/ui/tui/spokes/time_spoke.py
index be1f48e..7e3467b 100644
--- a/pyanaconda/ui/tui/spokes/time_spoke.py
+++ b/pyanaconda/ui/tui/spokes/time_spoke.py
@@ -128,7 +128,7 @@ class TimeZoneSpoke(FirstbootSpokeMixIn, NormalTUISpoke):
else:
return key
- def prompt(self, args):
+ def prompt(self, args = None):
return _("Please select the timezone.\nUse numbers or type names directly [b to region list, q to quit]: ")
def apply(self):
diff --git a/pyanaconda/ui/tui/tuiobject.py b/pyanaconda/ui/tui/tuiobject.py
index e2c96f7..a69a40b 100644
--- a/pyanaconda/ui/tui/tuiobject.py
+++ b/pyanaconda/ui/tui/tuiobject.py
@@ -77,7 +77,7 @@ class YesNoDialog(tui.UIScreen):
self._window.append(u"")
return True
- def prompt(self, args):
+ def prompt(self, args = None):
return _("Please respond 'yes' or 'no': ")
def input(self, args, key):
--
1.8.1.2
More information about the anaconda-patches
mailing list