diff options
author | Guido van Rossum <guido@python.org> | 1997-06-02 22:52:37 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-06-02 22:52:37 (GMT) |
commit | 525d52f8a44e514547d80caae0fcbb6acd78b0e0 (patch) | |
tree | 4739825cc62e46cf9a23e5814082760397d506d4 /Tools | |
parent | 46ff1903a3bdc34fd721380033fdf3209a3579b8 (diff) | |
download | cpython-525d52f8a44e514547d80caae0fcbb6acd78b0e0.zip cpython-525d52f8a44e514547d80caae0fcbb6acd78b0e0.tar.gz cpython-525d52f8a44e514547d80caae0fcbb6acd78b0e0.tar.bz2 |
Move the roulette() functionality out of the FaqDir class into the
FaqWizard class.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/faqwiz/faqwiz.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Tools/faqwiz/faqwiz.py b/Tools/faqwiz/faqwiz.py index 06e1ab5..804e611 100644 --- a/Tools/faqwiz/faqwiz.py +++ b/Tools/faqwiz/faqwiz.py @@ -325,12 +325,6 @@ class FaqDir: sec, num = self.__okprog.group(1, 2) return string.atoi(sec), string.atoi(num) - def roulette(self): - self.__fill() - import whrandom - if not self.__files: return None - return whrandom.choice(self.__files) - def list(self): # XXX Caller shouldn't modify result self.__fill() @@ -577,10 +571,12 @@ class FaqWizard: emit(TAIL_RECENT) def do_roulette(self): - file = self.dir.roulette() - if not file: + import whrandom + files = self.dir.list() + if not files: self.error("No entries.") return + file = whrandom.choice(files) self.prologue(T_ROULETTE) self.dir.show(file) |