mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修复type()组合键无效问题
This commit is contained in:
parent
e86ac7517d
commit
465ef15734
@ -276,11 +276,17 @@ class Actions:
|
||||
:param keys: 要按下的按键,特殊字符和多个文本可用list或tuple传入
|
||||
:return: self
|
||||
"""
|
||||
modifiers = []
|
||||
for i in keys:
|
||||
for character in i:
|
||||
self.key_down(character)
|
||||
sleep(.05)
|
||||
if character in ('\ue009', '\ue008', '\ue00a', '\ue03d'):
|
||||
modifiers.append(character)
|
||||
else:
|
||||
sleep(.01)
|
||||
self.key_up(character)
|
||||
for m in modifiers:
|
||||
self.key_up(m)
|
||||
return self
|
||||
|
||||
def input(self, text):
|
||||
|
@ -36,7 +36,8 @@ KEYS = Literal['NULL', 'CANCEL', 'HELP', 'BACKSPACE', 'BACK_SPACE', 'meta',
|
||||
'g', 'h', 'j', 'k', 'l', ';', '\'', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',',
|
||||
'.', '/', '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+',
|
||||
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', 'A', 'S', 'D',
|
||||
'F', 'G', 'H', 'J', 'K', 'L', ':', '"', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?']
|
||||
'F', 'G', 'H', 'J', 'K', 'L', ':', '"', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?'
|
||||
]
|
||||
|
||||
|
||||
class Actions:
|
||||
@ -89,11 +90,11 @@ class Actions:
|
||||
|
||||
def right(self, pixel: int) -> Actions: ...
|
||||
|
||||
def key_down(self, key: KEYS) -> Actions: ...
|
||||
def key_down(self, key: Union[KEYS, str]) -> Actions: ...
|
||||
|
||||
def key_up(self, key: KEYS) -> Actions: ...
|
||||
def key_up(self, key: Union[KEYS, str]) -> Actions: ...
|
||||
|
||||
def type(self, keys: Union[str, list, tuple]) -> Actions: ...
|
||||
def type(self, keys: Union[KEYS, str, list, tuple]) -> Actions: ...
|
||||
|
||||
def input(self, text: Any) -> Actions: ...
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
requests
|
||||
lxml
|
||||
cssselect
|
||||
DownloadKit>=2.0.0b1
|
||||
websocket-client
|
||||
DownloadKit>=2.0.0b2
|
||||
websocket-client>=1.7.0
|
||||
click
|
||||
tldextract
|
||||
psutil
|
10
setup.py
10
setup.py
@ -6,7 +6,7 @@ with open("README.md", "r", encoding='utf-8') as fh:
|
||||
|
||||
setup(
|
||||
name="DrissionPage",
|
||||
version="4.0.0b28",
|
||||
version="4.0.0b29",
|
||||
author="g1879",
|
||||
author_email="g1879@qq.com",
|
||||
description="Python based web automation tool. It can control the browser and send and receive data packets.",
|
||||
@ -22,19 +22,19 @@ setup(
|
||||
'lxml',
|
||||
'requests',
|
||||
'cssselect',
|
||||
'DownloadKit>=2.0.0b1',
|
||||
'websocket-client',
|
||||
'DownloadKit>=2.0.0b2',
|
||||
'websocket-client>=1.7.0',
|
||||
'click',
|
||||
'tldextract',
|
||||
'psutil'
|
||||
],
|
||||
classifiers=[
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Development Status :: 4 - Beta",
|
||||
"Topic :: Utilities",
|
||||
"License :: OSI Approved :: BSD License",
|
||||
],
|
||||
python_requires='>=3.6',
|
||||
python_requires='>=3.8',
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'dp = DrissionPage.commons.cli:main',
|
||||
|
Loading…
x
Reference in New Issue
Block a user