Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/plat-mac/FrameWork.py

    r2 r391  
    220220                return
    221221        (what, message, when, where, modifiers) = event
    222         if eventname.has_key(what):
     222        if what in eventname:
    223223            name = "do_" + eventname[what]
    224224        else:
     
    251251        if gotone:
    252252            window = dlg.GetDialogWindow()
    253             if self._windows.has_key(window):
     253            if window in self._windows:
    254254                self._windows[window].do_itemhit(item, event)
    255255            else:
     
    265265        # Find the correct name.
    266266        #
    267         if partname.has_key(partcode):
     267        if partcode in partname:
    268268            name = "do_" + partname[partcode]
    269269        else:
     
    280280                    MacOS.HandleEvent(event)
    281281                return
    282         elif self._windows.has_key(wid):
     282        elif wid in self._windows:
    283283            # It is a window. Hand off to correct window.
    284284            window = self._windows[wid]
     
    367367            # See whether the front window wants it
    368368            w = MyFrontWindow()
    369             if w and self._windows.has_key(w):
     369            if w and w in self._windows:
    370370                window = self._windows[w]
    371371                try:
     
    382382        (what, message, when, where, modifiers) = event
    383383        wid = WhichWindow(message)
    384         if wid and self._windows.has_key(wid):
     384        if wid and wid in self._windows:
    385385            window = self._windows[wid]
    386386            window.do_rawupdate(wid, event)
     
    392392        (what, message, when, where, modifiers) = event
    393393        wid = WhichWindow(message)
    394         if wid and self._windows.has_key(wid):
     394        if wid and wid in self._windows:
    395395            window = self._windows[wid]
    396396            window.do_activate(modifiers & 1, event)
     
    412412        (what, message, when, where, modifiers) = event
    413413        wid = MyFrontWindow()
    414         if wid and self._windows.has_key(wid):
     414        if wid and wid in self._windows:
    415415            window = self._windows[wid]
    416416            window.do_activate(message & 1, event)
     
    436436        (what, message, when, where, modifiers) = event
    437437        nicewhat = repr(what)
    438         if eventname.has_key(what):
     438        if what in eventname:
    439439            nicewhat = eventname[what]
    440440        print nicewhat,
     
    516516                if type(callback) == types.StringType:
    517517                    wid = MyFrontWindow()
    518                     if wid and self.parent._windows.has_key(wid):
     518                    if wid and wid in self.parent._windows:
    519519                        window = self.parent._windows[wid]
    520520                        if hasattr(window, "domenu_" + callback):
     
    532532
    533533    def dispatch(self, id, item, window, event):
    534         if self.menus.has_key(id):
     534        if id in self.menus:
    535535            self.menus[id].dispatch(id, item, window, event)
    536536        else:
     
    606606        title, shortcut, callback, mtype = self.items[item-1]
    607607        if callback:
    608             if not self.bar.parent or type(callback) <> types.StringType:
     608            if not self.bar.parent or type(callback) != types.StringType:
    609609                menuhandler = callback
    610610            else:
    611611                # callback is string
    612612                wid = MyFrontWindow()
    613                 if wid and self.bar.parent._windows.has_key(wid):
     613                if wid and wid in self.bar.parent._windows:
    614614                    window = self.bar.parent._windows[wid]
    615615                    if hasattr(window, "domenu_" + callback):
     
    752752
    753753    def open(self, bounds=(40, 40, 400, 400), resid=None):
    754         if resid <> None:
     754        if resid != None:
    755755            self.wid = GetNewWindow(resid, -1)
    756756        else:
     
    830830        # the activate event.
    831831        #
    832         if MyFrontWindow() <> window:
     832        if MyFrontWindow() != window:
    833833            window.SelectWindow()
    834834            return
     
    879879
    880880    def do_inContent(self, partcode, window, event):
    881         if MyFrontWindow() <> window:
     881        if MyFrontWindow() != window:
    882882            window.SelectWindow()
    883883            return
Note: See TracChangeset for help on using the changeset viewer.