diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-07-27 07:01:13 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-07-27 07:01:13 (GMT) |
commit | 8b95d5e0bf00d9d0098579d29fd6bb9322071879 (patch) | |
tree | 3d2a6e34012066f5a7d161771376a4500dafc2b7 /Lib | |
parent | e3416e6138a401c2b4cf563c935fe2788c1603f2 (diff) | |
download | cpython-8b95d5e0bf00d9d0098579d29fd6bb9322071879.zip cpython-8b95d5e0bf00d9d0098579d29fd6bb9322071879.tar.gz cpython-8b95d5e0bf00d9d0098579d29fd6bb9322071879.tar.bz2 |
Modernize turtledemo with conditional expressions; remove duplicate line.
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/turtledemo/__main__.py | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py index c933ea1..07560c3 100755 --- a/Lib/turtledemo/__main__.py +++ b/Lib/turtledemo/__main__.py @@ -127,25 +127,12 @@ class DemoWindow(object): def configGUI(self, menu, start, stop, clear, txt="", color="blue"): self.ExamplesBtn.config(state=menu) - self.start_btn.config(state=start) - if start == NORMAL: - self.start_btn.config(bg="#d00") - else: - self.start_btn.config(bg="#fca") - - self.stop_btn.config(state=stop) - if stop == NORMAL: - self.stop_btn.config(bg="#d00") - else: - self.stop_btn.config(bg="#fca") - self.clear_btn.config(state=clear) - - self.clear_btn.config(state=clear) - if clear == NORMAL: - self.clear_btn.config(bg="#d00") - else: - self.clear_btn.config(bg="#fca") - + self.start_btn.config(state=start, + bg="#d00" if start == NORMAL else "#fca") + self.stop_btn.config(state=stop, + bg="#d00" if stop == NORMAL else "#fca") + self.clear_btn.config(state=clear, + bg="#d00" if clear == NORMAL else"#fca") self.output_lbl.config(text=txt, fg=color) def makeLoadDemoMenu(self): |