Skip to content

Commit 1c4b55a

Browse files
committed
update
1 parent 26b374c commit 1c4b55a

10 files changed

Lines changed: 35 additions & 17 deletions

File tree

MBPython/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
_LRESULT=c_longlong
99
from .seticon import set_icon
1010
from .screenshot import screen_shot
11+
from .wndproc import WndProcHook
12+
from .timer import Timer
1113
from . import miniblink
-335 Bytes
Binary file not shown.

MBPython/callback.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@
77
c_void_p,
88
POINTER,
99
windll,
10-
CFUNCTYPE,
11-
WINFUNCTYPE
12-
)
13-
from ctypes.wintypes import (
14-
DWORD,
15-
HWND,
16-
UINT
10+
CFUNCTYPE
1711
)
1812
from .winConst import WinConst
1913
from .wkeStruct import (wkeRect,wkeWindowFeatures,wkeMemBuf,mPos)
@@ -233,7 +227,8 @@ def _wkeLoadUrlFailCallback(self,webview,param,url,job):
233227
def _wkeLoadingFinishCallback(self,webview,param,url,result,failedReason):
234228
if hasattr(self,'wkeLoadingFinishCallback'):
235229
url=self.mb.wkeGetStringW(url)
236-
failedReason=self.mb.wkeGetStringW(failedReason)
230+
if result==1:
231+
failedReason=self.mb.wkeGetStringW(failedReason)
237232
param=self.get_param_value(param)
238233
self.wkeLoadingFinishCallback(webview=webview, param=param,url=url,result=result,failedReason=failedReason)
239234
@method(CFUNCTYPE(None, _LRESULT, c_void_p,c_char_p,POINTER(wkeMemBuf)))
@@ -249,13 +244,6 @@ def _wkeOnNetGetFaviconCallback(self,webview,param,url,buf):
249244

250245

251246

252-
@method(WINFUNCTYPE(None,HWND, UINT,UINT,DWORD))
253-
def _timerProc(self,hwnd,msg,nid,dwTime):
254-
if hasattr(self,'timerProc'):
255-
self.timerProc(hwnd=hwnd,msg=msg,nid=nid,dwTime=dwTime)
256-
257-
258-
259247
def param_to_string(self,param):
260248
if param!=0:
261249
_type=0

MBPython/miniblink.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from .proxy import Proxy
2222
from .pyrunjs import PyRunJS
2323
from .window import Window
24-
from .wndproc import WndProcHook
2524
from . import _LRESULT
2625
import platform
2726

MBPython/timer.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding:utf-8 -*-
2+
from ctypes import (
3+
c_void_p,
4+
windll,
5+
WINFUNCTYPE
6+
)
7+
from ctypes.wintypes import (
8+
DWORD,
9+
HWND,
10+
UINT
11+
)
12+
from .method import method
13+
user32=windll.user32
14+
15+
16+
class Timer:
17+
def __init__(self):
18+
self.timer_func_dict={}
19+
def setTimer(self,hwnd,nid,dwTime,is_timer_one=True):
20+
self.is_timer_one=is_timer_one
21+
return user32.SetTimer (hwnd,nid, dwTime, self._timerCallBack)
22+
@method(WINFUNCTYPE(c_void_p,HWND,c_void_p,UINT,DWORD))
23+
def _timerCallBack(self,hwnd,msg,nid,dwTime):
24+
if hasattr(self,'timerCallBack'):
25+
if self.is_timer_one:
26+
self.timerCallBack(hwnd=hwnd,msg=msg,nid=nid,dwTime=dwTime)
27+
user32.KillTimer(hwnd,nid)
28+
return 0
29+
return self.timerCallBack(hwnd=hwnd,msg=msg,nid=nid,dwTime=dwTime)

dist/MBPython-0.1.9.tar.gz

-16.8 KB
Binary file not shown.

dist/MBPython-0.2.1.tar.gz

17 KB
Binary file not shown.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "MBPython"
3-
version = "0.1.9"
3+
version = "0.2.1"
44
description = "Miniblink binding for python"
55
authors = ["lochen <1191826896@qq.com>"]
66
license = "MIT"
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)