| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ cdef dict g_pyBrowsers = {} | |||
| 21 | 21 | IF CEF_VERSION == 3: | |
| 22 | 22 | # Unused function warning in CEF 1. | |
| 23 | 23 | cdef PyBrowser GetPyBrowserById(int browserId): | |
| 24 | - if g_pyBrowsers.has_key(browserId): | ||
| 24 | + if browserId in g_pyBrowsers: | ||
| 25 | 25 | return g_pyBrowsers[browserId] | |
| 26 | 26 | return None | |
| 27 | 27 | ||
@@ -87,7 +87,7 @@ IF CEF_VERSION == 3: | |||
| 87 | 87 | # Called from LifespanHandler_OnBeforeClose(). | |
| 88 | 88 | # TODO: call this function also in CEF 1. | |
| 89 | 89 | global g_pyBrowsers | |
| 90 | - if g_pyBrowsers.has_key(browserId): | ||
| 90 | + if browserId in g_pyBrowsers: | ||
| 91 | 91 | Debug("del g_pyBrowsers[%s]" % browserId) | |
| 92 | 92 | del g_pyBrowsers[browserId] | |
| 93 | 93 | else: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -247,10 +247,10 @@ def onKeystroke(self, key): | |||
| 247 | 247 | self.keyInfo(ord(key)), 0) | |
| 248 | 248 | ||
| 249 | 249 | def onButtonDownOrUp(self, keyType, key): | |
| 250 | - if self.modifierKeys.has_key(key): | ||
| 250 | + if key in self.modifierKeys: | ||
| 251 | 251 | self.keyModifiers |= self.modifierKeys[key] | |
| 252 | 252 | else: | |
| 253 | - if self.translateKeys.has_key(key): | ||
| 253 | + if key in self.translateKeys: | ||
| 254 | 254 | self.browser.SendKeyEvent(keyType, | |
| 255 | 255 | self.keyInfo(self.translateKeys[key]), | |
| 256 | 256 | self.keyModifiers) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -307,7 +307,7 @@ cpdef py_void SetGlobalClientCallback(py_string name, object callback): | |||
| 307 | 307 | ||
| 308 | 308 | cpdef object GetGlobalClientCallback(py_string name): | |
| 309 | 309 | global g_globalClientCallbacks | |
| 310 | - if g_globalClientCallbacks.has_key(name): | ||
| 310 | + if name in g_globalClientCallbacks: | ||
| 311 | 311 | return g_globalClientCallbacks[name] | |
| 312 | 312 | else: | |
| 313 | 313 | return None | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ cdef dict g_pyFrames = {} | |||
| 7 | 7 | IF CEF_VERSION == 3: | |
| 8 | 8 | # Unused function warning in CEF 1. | |
| 9 | 9 | cdef PyFrame GetPyFrameById(object frameId): | |
| 10 | - if g_pyFrames.has_key(frameId): | ||
| 10 | + if frameId in g_pyFrames: | ||
| 11 | 11 | return g_pyFrames[frameId] | |
| 12 | 12 | return None | |
| 13 | 13 | ||
@@ -45,7 +45,7 @@ IF CEF_VERSION == 3: | |||
| 45 | 45 | # Called from V8ContextHandler_OnContextReleased(). | |
| 46 | 46 | # TODO: call this function also in CEF 1. | |
| 47 | 47 | global g_pyFrames | |
| 48 | - if g_pyFrames.has_key(frameId): | ||
| 48 | + if frameId in g_pyFrames: | ||
| 49 | 49 | Debug("del g_pyFrames[%s]" % frameId) | |
| 50 | 50 | del g_pyFrames[frameId] | |
| 51 | 51 | else: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,7 @@ cdef object CheckForCefPythonMessageHash(CefRefPtr[CefBrowser] cefBrowser, | |||
| 19 | 19 | if pyString.startswith(cefPythonMessageHash): | |
| 20 | 20 | jsonData = pyString[len(cefPythonMessageHash):] | |
| 21 | 21 | message = json.loads(jsonData) | |
| 22 | - if message and type(message) == dict and message.has_key("what") \ | ||
| 22 | + if message and type(message) == dict and ("what" in message) \ | ||
| 23 | 23 | and message["what"] == "javascript-callback": | |
| 24 | 24 | jsCallback = CreateJavascriptCallback( | |
| 25 | 25 | message["callbackId"], cefBrowser, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -73,7 +73,7 @@ cdef public cpp_bool ExecutePythonCallback( | |||
| 73 | 73 | cdef object returnValue | |
| 74 | 74 | try: | |
| 75 | 75 | global g_pythonCallbacks | |
| 76 | - if g_pythonCallbacks.has_key(callbackId): | ||
| 76 | + if callbackId in g_pythonCallbacks: | ||
| 77 | 77 | # [0] browserId, [1] frameId, [2] function. | |
| 78 | 78 | function = g_pythonCallbacks[callbackId][2] | |
| 79 | 79 | functionArguments = CefListValueToPyList( | |
| Back | FazBrowse Home | New Git URL |
0 commit comments