diff options
Diffstat (limited to 'Lib/lib-stdwin')
-rw-r--r-- | Lib/lib-stdwin/Buttons.py | 2 | ||||
-rw-r--r-- | Lib/lib-stdwin/CSplit.py | 2 | ||||
-rw-r--r-- | Lib/lib-stdwin/DirList.py | 2 | ||||
-rw-r--r-- | Lib/lib-stdwin/Split.py | 10 | ||||
-rw-r--r-- | Lib/lib-stdwin/StripChart.py | 2 | ||||
-rw-r--r-- | Lib/lib-stdwin/WindowParent.py | 16 | ||||
-rw-r--r-- | Lib/lib-stdwin/WindowSched.py | 4 | ||||
-rw-r--r-- | Lib/lib-stdwin/dirwin.py | 2 | ||||
-rw-r--r-- | Lib/lib-stdwin/formatter.py | 10 | ||||
-rw-r--r-- | Lib/lib-stdwin/gwin.py | 42 | ||||
-rw-r--r-- | Lib/lib-stdwin/tablewin.py | 8 |
11 files changed, 50 insertions, 50 deletions
diff --git a/Lib/lib-stdwin/Buttons.py b/Lib/lib-stdwin/Buttons.py index 949e128..d1435d3 100644 --- a/Lib/lib-stdwin/Buttons.py +++ b/Lib/lib-stdwin/Buttons.py @@ -110,7 +110,7 @@ class LabelAppearance: # def draw(self, (d, area)): area = _rect.intersect(area, self.bounds) - if area = _rect.empty: + if area == _rect.empty: return d.cliprect(area) self.drawit(d) diff --git a/Lib/lib-stdwin/CSplit.py b/Lib/lib-stdwin/CSplit.py index 5c57d90..90d137e 100644 --- a/Lib/lib-stdwin/CSplit.py +++ b/Lib/lib-stdwin/CSplit.py @@ -43,7 +43,7 @@ class CSplit(Split): # XXX One day Python will have automatic conversions... n = len(self.children) fn = float(n) - if n = 0: return + if n == 0: return (left, top), (right, bottom) = bounds width, height = right-left, bottom-top child_width, child_height = width*3/(n+4), height*3/(n+4) diff --git a/Lib/lib-stdwin/DirList.py b/Lib/lib-stdwin/DirList.py index 20a0fe8..0066c58 100644 --- a/Lib/lib-stdwin/DirList.py +++ b/Lib/lib-stdwin/DirList.py @@ -25,7 +25,7 @@ class DirList(VSplit): if path.isdir(path.join(dirname, name)): fullname = path.join(dirname, name) btn = SubdirButton().definetext(self, fullname) - elif name[-3:] = '.py': + elif name[-3:] == '.py': btn = ModuleButton().definetext(self, name) else: btn = FileButton().definetext(self, name) diff --git a/Lib/lib-stdwin/Split.py b/Lib/lib-stdwin/Split.py index b169d72..aacfa98 100644 --- a/Lib/lib-stdwin/Split.py +++ b/Lib/lib-stdwin/Split.py @@ -116,7 +116,7 @@ class Split: if not self.keybd_focus: self.set_keybd_focus(self.keybd_interest[0]) type, detail = type_detail - if type = WE_COMMAND and detail = WC_TAB and \ + if type == WE_COMMAND and detail == WC_TAB and \ len(self.keybd_interest) > 1: self.next_keybd_focus() return @@ -144,9 +144,9 @@ class Split: self.timer_interest.remove(child) if child in self.altdraw_interest: self.altdraw_interest.remove(child) - if child = self.mouse_focus: + if child == self.mouse_focus: self.mouse_focus = None - if child = self.keybd_focus: + if child == self.keybd_focus: self.keybd_focus = None # def need_mouse(self, child): @@ -154,7 +154,7 @@ class Split: self.mouse_interest.append(child) self.parent.need_mouse(self) def no_mouse(self, child): - if child = self.mouse_focus: + if child == self.mouse_focus: self.mouse_focus = None if child in self.mouse_interest: self.mouse_interest.remove(child) @@ -168,7 +168,7 @@ class Split: if not self.keybd_focus: self.set_keybd_focus(child) def no_keybd(self, child): - if child = self.keybd_focus: + if child == self.keybd_focus: self.keybd_focus = None # Don't call child.deactivate() if child in self.keybd_interest: self.keybd_interest.remove(child) diff --git a/Lib/lib-stdwin/StripChart.py b/Lib/lib-stdwin/StripChart.py index d58f835..5bce412 100644 --- a/Lib/lib-stdwin/StripChart.py +++ b/Lib/lib-stdwin/StripChart.py @@ -51,7 +51,7 @@ class StripChart(LabelAppearance, NoReactivity): # def draw(self, (d, area)): area = rect.intersect(area, self.bounds) - if area = rect.empty: + if area == rect.empty: return d.cliprect(area) d.erase(self.bounds) diff --git a/Lib/lib-stdwin/WindowParent.py b/Lib/lib-stdwin/WindowParent.py index a0593c5..697ed07 100644 --- a/Lib/lib-stdwin/WindowParent.py +++ b/Lib/lib-stdwin/WindowParent.py @@ -149,26 +149,26 @@ class WindowParent(ManageOneChild): # Only call dispatch once we are realized # def dispatch(self, (type, win, detail)): - if type = WE_DRAW: + if type == WE_DRAW: d = self.win.begindrawing() self.child.draw(d, detail) del d if self.do_altdraw: self.child.altdraw(detail) - elif type = WE_MOUSE_DOWN: + elif type == WE_MOUSE_DOWN: if self.do_mouse: self.child.mouse_down(detail) - elif type = WE_MOUSE_MOVE: + elif type == WE_MOUSE_MOVE: if self.do_mouse: self.child.mouse_move(detail) - elif type = WE_MOUSE_UP: + elif type == WE_MOUSE_UP: if self.do_mouse: self.child.mouse_up(detail) elif type in (WE_CHAR, WE_COMMAND): if self.do_keybd: self.child.keybd(type, detail) - elif type = WE_TIMER: + elif type == WE_TIMER: if self.do_timer: self.child.timer() - elif type = WE_SIZE: + elif type == WE_SIZE: self.fixup() - elif type = WE_CLOSE: + elif type == WE_CLOSE: self.close_trigger() - elif type = WE_MENU: + elif type == WE_MENU: self.menu_trigger(detail) if self.pending_destroy: self.destroy() diff --git a/Lib/lib-stdwin/WindowSched.py b/Lib/lib-stdwin/WindowSched.py index 9125317..67c3afb 100644 --- a/Lib/lib-stdwin/WindowSched.py +++ b/Lib/lib-stdwin/WindowSched.py @@ -21,7 +21,7 @@ def delayfunc(msecs): # # Use millisleep for very short delays or if there are no windows # - if msecs < 100 or mainloop.countwindows() = 0: + if msecs < 100 or mainloop.countwindows() == 0: if msecs > 0: time.millisleep(msecs) return @@ -46,7 +46,7 @@ cancel = q.cancel # Emptiness check must check both queues # def empty(): - return q.empty() and mainloop.countwindows() = 0 + return q.empty() and mainloop.countwindows() == 0 # Run until there is nothing left to do # diff --git a/Lib/lib-stdwin/dirwin.py b/Lib/lib-stdwin/dirwin.py index d0a8525..beb5222 100644 --- a/Lib/lib-stdwin/dirwin.py +++ b/Lib/lib-stdwin/dirwin.py @@ -10,7 +10,7 @@ import dircache def action(w, string, i, detail): (h, v), clicks, button, mask = detail - if clicks = 2: + if clicks == 2: name = path.join(w.name, string) try: w2 = anywin.open(name) diff --git a/Lib/lib-stdwin/formatter.py b/Lib/lib-stdwin/formatter.py index aea7deb..b2d4add 100644 --- a/Lib/lib-stdwin/formatter.py +++ b/Lib/lib-stdwin/formatter.py @@ -175,20 +175,20 @@ def test(): winsize = w.getwinsize() while 1: type, window, detail = stdwinq.getevent() - if type = WE_CLOSE: + if type == WE_CLOSE: break - elif type = WE_SIZE: + elif type == WE_SIZE: newsize = w.getwinsize() if newsize <> winsize: w.change((0,0), winsize) winsize = newsize w.change((0,0), winsize) - elif type = WE_MOUSE_DOWN: + elif type == WE_MOUSE_DOWN: stage = (stage + 1) % len(stages) justify, center, title = stages[stage] w.settitle(title) w.change((0, 0), (1000, 1000)) - elif type = WE_DRAW: + elif type == WE_DRAW: width, height = winsize f = formatter().init(w.begindrawing(), 0, 0, width) f.center = center @@ -198,7 +198,7 @@ def test(): for font in font1, font2, font1: f.setfont(font) for word in words: - space = 1 + (word[-1:] = '.') + space = 1 + (word[-1:] == '.') f.addword(word, space) if center and space > 1: f.flush() diff --git a/Lib/lib-stdwin/gwin.py b/Lib/lib-stdwin/gwin.py index c2ec11f..12ed90b 100644 --- a/Lib/lib-stdwin/gwin.py +++ b/Lib/lib-stdwin/gwin.py @@ -49,44 +49,44 @@ def mainloop(): # Handle events until no windows left def treatevent(e): # Handle a stdwin event type, w, detail = e - if type = WE_DRAW: + if type == WE_DRAW: w.draw(w, detail) - elif type = WE_MENU: + elif type == WE_MENU: m, item = detail m.action[item](w, m, item) - elif type = WE_COMMAND: + elif type == WE_COMMAND: treatcommand(w, detail) - elif type = WE_CHAR: + elif type == WE_CHAR: w.char(w, detail) - elif type = WE_MOUSE_DOWN: + elif type == WE_MOUSE_DOWN: if detail[1] > 1: w.m2down(w, detail) else: w.mdown(w, detail) - elif type = WE_MOUSE_MOVE: + elif type == WE_MOUSE_MOVE: w.mmove(w, detail) - elif type = WE_MOUSE_UP: + elif type == WE_MOUSE_UP: if detail[1] > 1: w.m2up(w, detail) else: w.mup(w, detail) - elif type = WE_SIZE: + elif type == WE_SIZE: w.size(w, w.getwinsize()) - elif type = WE_ACTIVATE: + elif type == WE_ACTIVATE: w.activate(w) - elif type = WE_DEACTIVATE: + elif type == WE_DEACTIVATE: w.deactivate(w) - elif type = WE_MOVE: + elif type == WE_MOVE: w.move(w) - elif type = WE_TIMER: + elif type == WE_TIMER: w.timer(w) - elif type = WE_CLOSE: + elif type == WE_CLOSE: w.close(w) def treatcommand(w, type): # Handle a we_command event - if type = WC_CLOSE: + if type == WC_CLOSE: w.close(w) - elif type = WC_RETURN: + elif type == WC_RETURN: w.enter(w) - elif type = WC_TAB: + elif type == WC_TAB: w.tab(w) - elif type = WC_BACKSPACE: + elif type == WC_BACKSPACE: w.backspace(w) elif type in (WC_LEFT, WC_UP, WC_RIGHT, WC_DOWN): w.arrow(w, type) @@ -101,13 +101,13 @@ def close(w): # Close method break def arrow(w, detail): # Arrow key method - if detail = WC_LEFT: + if detail == WC_LEFT: w.kleft(w) - elif detail = WC_UP: + elif detail == WC_UP: w.kup(w) - elif detail = WC_RIGHT: + elif detail == WC_RIGHT: w.kright(w) - elif detail = WC_DOWN: + elif detail == WC_DOWN: w.kdown(w) diff --git a/Lib/lib-stdwin/tablewin.py b/Lib/lib-stdwin/tablewin.py index f9ab907..eba161d 100644 --- a/Lib/lib-stdwin/tablewin.py +++ b/Lib/lib-stdwin/tablewin.py @@ -164,13 +164,13 @@ def whichcol(w, h): # Return column number (may be >= len(w.data)) return len(w.data) def arrow(w, type): - if type = WC_LEFT: + if type == WC_LEFT: incr = -1, 0 - elif type = WC_UP: + elif type == WC_UP: incr = 0, -1 - elif type = WC_RIGHT: + elif type == WC_RIGHT: incr = 1, 0 - elif type = WC_DOWN: + elif type == WC_DOWN: incr = 0, 1 else: return |