vchrome 0.1.13__py3-none-any.whl → 0.1.15__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
vchrome/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = '0.1.13'
1
+ __version__ = '0.1.15'
2
2
  __author__ = 'v'
3
3
  # ----------------------------------------------------------------------------------------------------
4
4
  _allowed = {'Chrome'}
@@ -1094,9 +1094,12 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
1094
1094
  return self.f.cdp('DOM.getBoxModel', {'objectId': self.objectId})
1095
1095
  def __repr__(self):
1096
1096
  return '<DOM:[{}] [{}]>'.format(self.className, self.objectId)
1097
+ def focus(self):
1098
+ self.f.cdp('DOM.focus', {"objectId": self.objectId})
1097
1099
  def clear(self, delay_uptime=0.15, timegap=0.01, timeout=15):
1098
1100
  self.wait_show(timeout)
1099
- self.f.cdp('DOM.focus', {"objectId": self.objectId})
1101
+ self.focus()
1102
+ time.sleep(0.01)
1100
1103
  clear_ents = self.f.rootf.make_clear()
1101
1104
  for kdn in clear_ents[:2]: time.sleep(timegap); self.f.cdp('Input.dispatchKeyEvent', kdn)
1102
1105
  time.sleep(delay_uptime)
@@ -1104,7 +1107,8 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
1104
1107
  for delt in clear_ents[4:]: time.sleep(timegap); self.f.cdp('Input.dispatchKeyEvent', delt)
1105
1108
  def input(self, str, delay_time=0.02, delay_uptime=0.15, random_gap=0.01, timeout=15):
1106
1109
  self.wait_show(timeout)
1107
- self.f.cdp('DOM.focus', {"objectId": self.objectId})
1110
+ self.focus()
1111
+ time.sleep(0.01)
1108
1112
  for kdn, kup in self.f.rootf.make_input_events(str):
1109
1113
  if kdn == 'insertText':
1110
1114
  self.f.cdp('Input.insertText', {"text": kup})
@@ -1137,6 +1141,8 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
1137
1141
  def click(self, x=1, y=2, zero='center', button='left', count=1, timeout=15):
1138
1142
  self.wait_show(timeout)
1139
1143
  self._set_in_view()
1144
+ self.focus()
1145
+ time.sleep(0.01)
1140
1146
  _x, _y = self._get_xy(x, y, zero)
1141
1147
  self.f.cdp('Input.dispatchMouseEvent',{"buttons":0,"type":"mouseMoved","x":_x,"y":_y,"button":"none","clickCount":0})
1142
1148
  self.f.cdp('Input.dispatchMouseEvent',{"buttons":1,"type":"mousePressed","x":_x,"y":_y,"button":button,"clickCount":count})
@@ -1193,6 +1199,8 @@ def cdp_client(hostname, port, debug=False, runtimeEnable=False, cfg={}):
1193
1199
  def drag(self, x=1, y=2, zero='center', button='left', count=1, timeout=15):
1194
1200
  self.wait_show(timeout)
1195
1201
  self._set_in_view()
1202
+ self.focus()
1203
+ time.sleep(0.01)
1196
1204
  x, y = self._get_xy(x, y, zero)
1197
1205
  self.cache_xy = [x, y]
1198
1206
  self.f.cdp('Input.dispatchMouseEvent',{"buttons":1,"type":"mousePressed","x":int(x),"y":int(y),"button":button,"clickCount":count})
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vchrome
3
- Version: 0.1.13
3
+ Version: 0.1.15
4
4
 
@@ -0,0 +1,6 @@
1
+ v/__init__.py,sha256=6ZddLaDcwLudHWmFr2utAcYhperXw9AYoItNPm8EZSM,65
2
+ vchrome/__init__.py,sha256=D9ffiok0sw1PE0_6fR1l7ChBOvNCRVGh9b57XUQypng,229297
3
+ vchrome-0.1.15.dist-info/METADATA,sha256=E5EP_v4O7tRltuoH74X00QxM0hRgX3ZQkLWDh9n3NgQ,57
4
+ vchrome-0.1.15.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
5
+ vchrome-0.1.15.dist-info/top_level.txt,sha256=IYbkbnFb2FGoroYj_ZXIitmnJDgYBA29_HmK9BdEUkY,10
6
+ vchrome-0.1.15.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- v/__init__.py,sha256=6ZddLaDcwLudHWmFr2utAcYhperXw9AYoItNPm8EZSM,65
2
- vchrome/__init__.py,sha256=573YdmXm9CHnE0IXbGV8_OhzMX9CV1TQRHB1heDFkyk,229113
3
- vchrome-0.1.13.dist-info/METADATA,sha256=TK9eZNxl2LcjYmPO-VyjXuhw7xAFTom4XTDzgK1HxDo,57
4
- vchrome-0.1.13.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
5
- vchrome-0.1.13.dist-info/top_level.txt,sha256=IYbkbnFb2FGoroYj_ZXIitmnJDgYBA29_HmK9BdEUkY,10
6
- vchrome-0.1.13.dist-info/RECORD,,