[PATCH v02] Clean up code for input handling in TUI spokes.
Vratislav Podzimek
vpodzime at redhat.com
Thu Sep 5 06:38:58 UTC 2013
On Wed, 2013-09-04 at 14:41 -0700, Brian C. Lane wrote:
> On Wed, Sep 04, 2013 at 12:41:29PM -0400, Samantha N. Bueno wrote:
>
> > + except ValueError:
> > + if key.lower() == "c" and 0 <= self._selection < len(self.payload.environments):
> > + self.apply()
> > + self.close()
> > + return True
> > + else:
> > + return key
>
> Should probably add a docstring with info about the possible return
> values. True, key, None? T/F, key?
This is described in the
pyanaconda/ui/tui/simpleline/base.py:UIObject.input method's docstring,
but I agree it's so complicated that it should be either commented
everywhere or replaced with something clearer. Maybe we could use some
constants for True/None and False like INPUT_PROCESSED and
INPUT_DISCARDED. Returning key is quite clear, I think.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list