cosmetic: move the dir property in dispatch.py with other public methods.
Also use a more modern way of declaring a property.
---
pyanaconda/dispatch.py | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
+ @property
+ def dir(self):
+ return self.anaconda.dir
+
+ @dir.setter
+ def dir(self, dir):
+ if dir not in [DISPATCH_BACK, DISPATCH_FORWARD, DISPATCH_DEFAULT]:
+ raise RuntimeError("dispatch: wrong direction code")
+ if dir in [DISPATCH_BACK, DISPATCH_FORWARD]:
+ self.anaconda.dir = dir
+
def done_steps(self, *steps):
map(lambda s: self.steps[s].done(), steps)
@@ -201,11 +212,11 @@ class Dispatcher(object):
The caller should make sure can_go_back() is True before calling this
method.
"""
- self._setDir(DISPATCH_BACK)
+ self.dir = DISPATCH_BACK
self.dispatch()
def can_go_back(self):
@@ -290,14 +301,3 @@ class Dispatcher(object):
(self.dir, self.step))
self.done_steps(self.step)
self._advance_step()
-
- def _getDir(self):
- return self.anaconda.dir
-
- def _setDir(self, dir):
- if dir not in [DISPATCH_BACK, DISPATCH_FORWARD, DISPATCH_DEFAULT]:
- raise RuntimeError("dispatch: wrong direction code")
- if dir in [DISPATCH_BACK, DISPATCH_FORWARD]:
- self.anaconda.dir = dir
-
- dir = property(_getDir,_setDir)
--
1.7.3.3
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list