{"id":55,"date":"2024-08-29T18:30:25","date_gmt":"2024-08-29T10:30:25","guid":{"rendered":"https:\/\/203929.xyz\/?p=55"},"modified":"2024-08-29T18:35:22","modified_gmt":"2024-08-29T10:35:22","slug":"python%e4%b8%advisible_only-not-found%e7%9b%b8%e5%85%b3%e7%9a%84%e9%97%ae%e9%a2%98%e5%85%b6%e4%b8%ad%e7%9a%84%e4%b8%80%e4%b8%aa%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95%ef%bc%8c%e5%85%b3%e4%ba%8epywinauto","status":"publish","type":"post","link":"https:\/\/203929.xyz\/index.php\/2024\/08\/29\/python%e4%b8%advisible_only-not-found%e7%9b%b8%e5%85%b3%e7%9a%84%e9%97%ae%e9%a2%98%e5%85%b6%e4%b8%ad%e7%9a%84%e4%b8%80%e4%b8%aa%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95%ef%bc%8c%e5%85%b3%e4%ba%8epywinauto\/","title":{"rendered":"python\u4e2dvisible_only not found\u76f8\u5173\u7684\u95ee\u9898\u5176\u4e2d\u7684\u4e00\u4e2a\u89e3\u51b3\u65b9\u6cd5\uff0c\u5173\u4e8epywinauto application\u4e2dconnect\u65b9\u6cd5"},"content":{"rendered":"<p>\u200b<br \/>\n<strong>PS\uff1aUP\u4e3b\u53ea\u662f\u67d0\u53cc\u975e\u4e00\u672c\u7684\u6d4b\u5f00\u5b9e\u4e60\u751f\uff0c\u5728\u5f00\u53d1\u811a\u672c\u7684\u65f6\u5019\u53d1\u73b0\u7684\u8fd9\u4e2a\u95ee\u9898\uff0c\u5982\u679c\u6709\u8bf4\u7684\u4e0d\u5bf9\u7684\u5730\u65b9\u548c\u5199\u6587\u7ae0\u4e0d\u597d\u7684\u5730\u65b9\u8bf7\u591a\u6307\u6559\u3002<\/strong><\/p>\n<p><strong>\u6d89\u53ca\u7684\u989d\u5916\u6982\u5ff5\uff1a<br \/>\n\u8fdb\u7a0b\u548c\u7ebf\u7a0b\u7684\u533a\u522b<br \/>\n\u8fdb\u7a0b\u7684\u4f18\u5148\u7ea7<\/p>\n<p>pywinauto\u5e93<\/p>\n<p>python\u81ea\u52a8\u5316<\/p>\n<p>\u8fdb\u7a0b\u4e2d\u7684\u7ebf\u7a0b\u5728 CPU \u4e0a\u6267\u884c<\/p>\n<p>\u5199\u5728\u9898\u5934\uff1a\u8bf7\u68c0\u67e5\u4f60\u7684python\u4ee3\u7801\u4e2d\u6709\u6ca1\u6709Application.connect\u8fd9\u4e2a\u65b9\u6cd5\uff08\u522b\u7684\u8bed\u8a00\u6682\u672a\u77e5\u9053\u662f\u54ea\u4e2a\u65b9\u6cd5\u540d\u79f0\uff09\uff0c\u5982\u679c\u6709\u7684\u8bdd\uff0c\u90a3\u4e48\u8bf7\u7ee7\u7eed\u770b\u4e0b\u53bb<\/strong><\/p>\n<p><strong>1\u3001\u51fa\u9519\u539f\u56e0<\/strong><br \/>\nApplication(object).connect(self, **kwargs)\u4e0ewindow\u8d44\u6e90\u7ba1\u7406\u5668explore.exe\u9020\u6210\u7684\u4e00\u4e9b\u51b2\u7a81\u3002<\/p>\n<p><strong>2\u3001\u89e3\u51b3\u529e\u6cd5<\/strong><br \/>\n\u5728**kwargs\u4e2d\u52a0\u5165\u9884\u8bbe\u7684\u65f6\u95f4\u53c2\u6570\uff0c\u6216\u8005\u5728\u8fd9\u4e2a\u51fd\u6570\u524dtime.sleep(5)\u5373\u53ef<\/p>\n<p><strong>3\u3001\u57fa\u672c\u539f\u7406\uff08\u901a\u8fc7\u4e3e\u4f8b\u8bf4\u660e\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5177\u4f53\u7684\u4f8b\u5b50\uff09<\/strong><br \/>\n<strong>\uff081\uff09\u80cc\u666f\u9610\u8ff0\uff0c\u4ecb\u7ecd\u8fd9\u4e2a\u4f8b\u5b50<\/strong><br \/>\n\u8be5\u4f8b\u5b50\u662f\u5f00\u53d1\u81ea\u52a8\u5316\u811a\u672c\uff0c\u8981\u6c42\u6a21\u62df\u4eba\u7684\u5f00\u5173WiFi\uff0c\u84dd\u7259\uff0c\u98de\u884c\u6a21\u5f0f\uff0c\u4f46\u662f\u5f53\u6211\u6253\u5f00\u53f3\u4e0b\u89d2\u83dc\u5355\u7684\u65f6\u5019\uff0c\u51fa\u73b0\u4e86\u627e\u4e0d\u5230WiFi\u3001\u84dd\u7259\u63a7\u4ef6\u7684\u9519\u8bef\u3002<\/p>\n<p>\u9519\u8bef\u63d0\u793a\uff1avisible_only not found\u6211\u81ea\u5df1\u8bbe\u5b9a\u8981\u627e\u7684\u5b57\u7b26\u4e32\u6bd4\u5982wlan\uff0cbluetooth<\/p>\n<p><strong>\uff082\uff09windows\u8d44\u6e90\u7ba1\u7406\u5668\u64cd\u4f5c\u8fdb\u7a0b\u7684\u539f\u7406<\/strong><br \/>\n\u9996\u5148\u5148\u8bf4\u660e\u4e00\u70b9\uff0c\u50cf\u684c\u9762\u4e0a\u7684\u8fd9\u79cd\u56fe\u6807\uff0c\u5305\u62ec\u4f60\u7684\u6587\u4ef6\u5939<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i-blog.csdnimg.cn\/direct\/b8bc71ea296148bd92ce9ab452a7de32.png\" alt=\"\u684c\u9762\u56fe\u6807\" \/><\/p>\n<p>\u90fd\u662f\u7531window\u8d44\u6e90\u7ba1\u7406\u5668\u8fd9\u4e2a\u8fdb\u7a0b\u52a0\u8f7d\u7684<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i-blog.csdnimg.cn\/direct\/aad14ec464164ab0ab819fc9f9a9ff7a.png\" alt=\"\u8d44\u6e90\u7ba1\u7406\u5668\" \/><\/p>\n<p>\u6709\u4e9b\u53ebwindows\u8d44\u6e90\u7ba1\u7406\u5668\uff0c\u6709\u4e9b\u53ebexplorer.exe\uff0c\u90fd\u4e00\u6837<\/p>\n<p>\u8fd9\u4e2a\u8fdb\u7a0b\u4f5c\u4e3a\u5b9e\u73b0\u8bf8\u591a\u529f\u80fd\u7684\u96c6\u5927\u6210\u8005\uff0c\u662f\u5728\u5f00\u673a\u7684\u65f6\u5019\u5c31\u5df2\u7ecf\u5c06\u8fd9\u4e2a\u4e3b\u8fdb\u7a0b\u57fa\u672c\u542f\u52a8\u4e86\uff0c<\/p>\n<p>\u4f46\u662f\u6211\u4eec\u8981\u77e5\u9053windows\u4e3a\u4e86\u4f18\u5316\u5f00\u673a\u901f\u5ea6\uff0c\u4ece\u800c\u8ba9\u67d0\u4e9b\u8fdb\u7a0b\u5728\u5f00\u673a\u7684\u65f6\u5019\u53ea\u6267\u884c\u4e3b\u8fdb\u7a0b\uff0c\u4f46\u662f\u5173\u8054\u7684\u5b50\u8fdb\u7a0b\u5728\u5f00\u673a\u4e4b\u540e\u624d\u51c6\u5907\u5c31\u7eea\uff0cwindows\u8d44\u6e90\u7ba1\u7406\u5668\u6211\u60f3\u4e5f\u662f\u5982\u6b64\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i-blog.csdnimg.cn\/direct\/b8bc71ea296148bd92ce9ab452a7de32.png\" alt=\"\u684c\u9762\u56fe\u6807\" \/><\/p>\n<p>\u5f00\u673a\u4e4b\u540e\uff0c\u5927\u5bb6\u53ef\u4ee5\u70b9\u51fb\u8fd9\u4e2a\u56fe\u6807\u770b\u4e00\u4e0b\uff0c\u662f\u4e0d\u662f\u8fd9\u4e2a\u8fdb\u7a0b\u6253\u5f00\u7684\u65f6\u5019\u65f6\u95f4\u4f1a\u6162\uff0c\u751a\u81f3\u6709\u5361\u987f\uff0c\u8fd9\u5c31\u662fwindows\u8d44\u6e90\u7ba1\u7406\u5668\u5728\u8fd0\u884c\u5b50\u8fdb\u7a0b\u7684\u65f6\u5019\uff0c\u8fd9\u4e2a\u4f18\u5148\u7ea7\u6ca1\u90a3\u4e48\u9ad8\u7684\u5b50\u8fdb\u7a0b\u88ab\u4eba\u4e3a\u7684\u6253\u5f00\u8c03\u7528\u4e86\u3002\u589e\u52a0\u4e86\u8be5\u8fdb\u7a0b\u7684\u4f18\u5148\u7ea7\u3002<\/p>\n<p>\u6211\u4eec\u628a\u8fd9\u4e2a\u5b50\u8fdb\u7a0b\u79f0\u4f5cin\u8fdb\u7a0b\uff08internet\u56fe\u6807\u76f8\u5173\u8fdb\u7a0b\uff09<\/p>\n<p>\u8fdb\u7a0b\u7684\u72b6\u6001\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/i-blog.csdnimg.cn\/direct\/2cf07b5fccc744de8f35d1fc7c64fa4e.png\" alt=\"\u8fdb\u7a0b\u72b6\u6001\" \/><\/p>\n<p>\u90a3\u4e48\u5c31\u53ef\u4ee5\u77e5\u9053\uff0c\u521a\u521a\u5f00\u673a\u7684\u65f6\u5019\uff0cin\u8fdb\u7a0b\u662f\u65b0\u5efa\u72b6\u6001<\/p>\n<p>\u5f53\u6211\u4eec\u6253\u5f00\u53f3\u4e0b\u89d2WiFi\u56fe\u6807\u7684\u65f6\u5019\uff0cin\u8fdb\u7a0b\u5c31\u662f\u6267\u884c\u72b6\u6001<\/p>\n<p>\u5f53\u6211\u4eec\u8fdb\u884c\u4e86\u8db3\u591f\u591a\u5173\u4e8ewindows\u8d44\u6e90\u7ba1\u7406\u5668\u5b50\u8fdb\u7a0b\u7684\u8c03\u7528\u65f6\uff08\u975ein\u7ebf\u7a0b\uff09\uff0c\u90a3\u4e48\u8d44\u6e90\u7ba1\u7406\u5668\u5c31\u4f1a\u628ain\u8fdb\u7a0b\u7684\u4f18\u5148\u7ea7\u964d\u4f4e\uff0c\u4ece\u7ebf\u7a0b\u6c60\u4e2d\u6324\u5151\u51fa\u53bb\uff0c\u90a3\u4e48in\u7ebf\u7a0b\u5c31\u4f1a\u8fdb\u5165\u963b\u585e\u72b6\u6001\u3002<\/p>\n<p>\u6240\u4ee5in\u8fdb\u7a0b\u57fa\u672c\u4e0a\u76843\u4e2a\u72b6\u6001\u6211\u4eec\u90fd\u77e5\u9053\u4e86\uff0c\u4ece\u6253\u5f00\u65f6\u95f4\u6765\u8bf4<\/p>\n<p>\u6267\u884c\u6001>\u963b\u585e\u6001>\u65b0\u5efa\u6001<\/p>\n<p><strong>\uff083\uff09\u6211\u4eec\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0\u9519\u8bef\u7684\u539f\u7406<\/strong><br \/>\n\u6253\u5f00python\u4e2d\u76f8\u5173\u7684\u4ee3\u7801\u6bb5\uff0c\u6211\u901a\u8fc7debug\u662f\u8fd9\u91cc\u51fa\u95ee\u9898<br \/>\n<img decoding=\"async\" src=\"https:\/\/i-blog.csdnimg.cn\/direct\/8db05a56c50a4fe9a447aca71d58bc85.png\" alt=\"1\" \/><\/p>\n<p>title\u7684\u503c\u662f\u5b57\u7b26\u4e32\uff0c\u662f\u6211\u81ea\u5df1\u8bbe\u5b9a\u7684\u60f3\u627e\u5230\u7684\u6309\u94ae<\/p>\n<p>\u518dCtrl+\u5355\u51fb\u67e5\u770bconnect\u51fd\u6570\u5185\u90e8<br \/>\n<img decoding=\"async\" src=\"https:\/\/i-blog.csdnimg.cn\/direct\/6fff6ac89f8749d596ff71c568367375.png\" alt=\"2\" \/><\/p>\n<p>\u67e5\u770b\u5230\u51fd\u6570\u5185\u90e8\u4ee3\u7801\uff0c\u8fd9\u91cc\u53ef\u4ee5\u53d1\u73b0\u7aef\u502a<\/p>\n<p><strong>\uff083.1\uff09\u4ee5\u4e0b\u662fApplication.connect\u51fd\u6570<\/strong><br \/>\n    <code>def connect(self, **kwargs):<br \/>\n        \"\"\"Connect to an already running process<\/p>\n<p>        The action is performed according to only one of parameters<\/p>\n<p>        :param process: a process ID of the target<br \/>\n        :param handle: a window handle of the target<br \/>\n        :param path: a path used to launch the target<br \/>\n        :param timeout: a timeout for process start (relevant if path is specified)<\/p>\n<p>        .. seealso::<\/p>\n<p>           :func:`pywinauto.findwindows.find_elements` - the keyword arguments that<br \/>\n           are also can be used instead of **process**, **handle** or **path**<br \/>\n        \"\"\"<br \/>\n        timeout = Timings.app_connect_timeout<br \/>\n        retry_interval = Timings.app_connect_retry<br \/>\n        if 'timeout' in kwargs and kwargs['timeout'] is not None:<br \/>\n            timeout = kwargs['timeout']<br \/>\n        if 'retry_interval' in kwargs and kwargs['retry_interval'] is not None:<br \/>\n            retry_interval = kwargs['retry_interval']<\/p>\n<p>        connected = False<br \/>\n        if 'process' in kwargs:<br \/>\n            self.process = kwargs['process']<br \/>\n            try:<br \/>\n                wait_until(timeout, retry_interval, self.is_process_running, value=True)<br \/>\n            except TimeoutError:<br \/>\n                raise ProcessNotFoundError('Process with PID={} not found!'.format(self.process))<br \/>\n            connected = True<\/p>\n<p>        elif 'handle' in kwargs:<\/p>\n<p>            if not handleprops.iswindow(kwargs['handle']):<br \/>\n                message = \"Invalid handle 0x%x passed to connect()\" % (<br \/>\n                    kwargs['handle'])<br \/>\n                raise RuntimeError(message)<\/p>\n<p>            self.process = handleprops.processid(kwargs['handle'])<\/p>\n<p>            connected = True<\/p>\n<p>        elif 'path' in kwargs:<br \/>\n            try:<br \/>\n                self.process = timings.wait_until_passes(<br \/>\n                        timeout, retry_interval, process_from_module,<br \/>\n                        ProcessNotFoundError, kwargs['path'],<br \/>\n                    )<br \/>\n            except TimeoutError:<br \/>\n                raise ProcessNotFoundError('Process \"{}\" not found!'.format(kwargs['path']))<br \/>\n            connected = True<\/p>\n<p>        elif kwargs:<br \/>\n            kwargs['backend'] = self.backend.name<br \/>\n            if 'visible_only' not in kwargs:<br \/>\n                kwargs['visible_only'] = False<br \/>\n            if 'timeout' in kwargs:<br \/>\n                del kwargs['timeout']<br \/>\n                self.process = timings.wait_until_passes(<br \/>\n                        timeout, retry_interval, findwindows.find_element,<br \/>\n                        exceptions=(findwindows.ElementNotFoundError, findbestmatch.MatchError,<br \/>\n                                    controls.InvalidWindowHandle, controls.InvalidElement),<br \/>\n                        *(), **kwargs<br \/>\n                    ).process_id<br \/>\n            else:<br \/>\n                self.process = findwindows.find_element(**kwargs).process_id<br \/>\n            connected = True<\/p>\n<p>        if not connected:<br \/>\n            raise RuntimeError(<br \/>\n                \"You must specify some of process, handle, path or window search criteria.\")<\/p>\n<p>        if self.backend.name == 'win32':<br \/>\n            self.__warn_incorrect_bitness()<\/p>\n<p>            if not handleprops.has_enough_privileges(self.process):<br \/>\n                warning_text = \"Python process has no rights to make changes \" \\<br \/>\n                    \"in the target GUI (run the script as Administrator)\"<br \/>\n                warnings.warn(warning_text, UserWarning)<\/p>\n<p>        return self<\/code><br \/>\n\u6211\u4f20\u8fdb\u6765\u7684\u53c2\u6570\u6ca1\u6709\u65f6\u95f4\uff0c\u53ea\u6709\u5b57\u7b26\u4e32\uff0c\u6ca1\u6709process\uff0c\u6240\u4ee5\u662f\u8c03\u7528\u9ed8\u8ba4\u7684time\uff0c\u800c\u4e14\u975epath\u975ehandle\uff0c\u4e8e\u662f\u6570\u636e\u76f4\u63a5\u8fdb\u5165\u4e86elif kwargs\u8fd9\u91cc\uff0c\u7136\u540e\u5c31\u51fa\u73b0\u4e86\u6211\u4eec\u7684\u9519\u8bef\uff0c\u6ca1\u6709\u627e\u5230\u8be5\u63a7\u4ef6\uff0c\u4e8e\u662f\u6211\u4eec\u6000\u7591\u65f6\u95f4\u95ee\u9898<\/p>\n<p>\u4e8e\u662fCtrl+\u5355\u51fb\u67e5\u770btimings\u51fd\u6570<br \/>\n<img decoding=\"async\" src=\"https:\/\/i-blog.csdnimg.cn\/direct\/d80a0582319246a98bd6440360d6e363.png\" alt=\"3\" \/><\/p>\n<p>\uff083.2\uff09\u4ee5\u4e0b\u662fTimings<br \/>\n<img decoding=\"async\" src=\"https:\/\/i-blog.csdnimg.cn\/direct\/464ce76cc67d409a8d0ddc3d97aca941.png\" alt=\"4\" \/><\/p>\n<p>\u7ee7\u7eedCtrl+\u5355\u51fbTimeConfig\uff08\uff09<\/p>\n<p>\uff083.3\uff09\u4ee5\u4e0b\u662fTimeConfig()\u51fd\u6570<br \/>\n<code>class TimeConfig(object):<\/p>\n<p>    \"\"\"Central storage and manipulation of timing values\"\"\"<\/p>\n<p>    __default_timing = {<br \/>\n        'window_find_timeout': 5.,<br \/>\n        'window_find_retry': .09,<\/p>\n<p>        'app_start_timeout': 10.,<br \/>\n        'app_start_retry': .90,<\/p>\n<p>        'app_connect_timeout': 5.,<br \/>\n        'app_connect_retry': .1,<\/p>\n<p>        'cpu_usage_interval': .5,<br \/>\n        'cpu_usage_wait_timeout': 20.,<\/p>\n<p>        'exists_timeout': .5,<br \/>\n        'exists_retry': .3,<\/p>\n<p>        'after_click_wait': .09,<br \/>\n        'after_clickinput_wait': .09,<\/p>\n<p>        'after_menu_wait': .1,<\/p>\n<p>        'after_sendkeys_key_wait': .01,<\/p>\n<p>        'after_button_click_wait': 0,<\/p>\n<p>        'before_closeclick_wait': .1,<br \/>\n        'closeclick_retry': .05,<br \/>\n        'closeclick_dialog_close_wait': 2.,<br \/>\n        'after_closeclick_wait': .2,<\/p>\n<p>        'after_windowclose_timeout': 2,<br \/>\n        'after_windowclose_retry': .5,<\/p>\n<p>        'after_setfocus_wait': .06,<br \/>\n        'setfocus_timeout': 2,<br \/>\n        'setfocus_retry': .1,<\/p>\n<p>        'after_setcursorpos_wait': .01,<\/p>\n<p>        'sendmessagetimeout_timeout': .01,<\/p>\n<p>        'after_tabselect_wait': .05,<\/p>\n<p>        'after_listviewselect_wait': .01,<br \/>\n        'after_listviewcheck_wait': .001,<br \/>\n        'listviewitemcontrol_timeout': 1.5,<\/p>\n<p>        'after_treeviewselect_wait': .1,<\/p>\n<p>        'after_toobarpressbutton_wait': .01,<\/p>\n<p>        'after_updownchange_wait': .1,<\/p>\n<p>        'after_movewindow_wait': 0,<br \/>\n        'after_buttoncheck_wait': 0,<br \/>\n        'after_comboboxselect_wait': 0.001,<br \/>\n        'after_listboxselect_wait': 0,<br \/>\n        'after_listboxfocuschange_wait': 0,<br \/>\n        'after_editsetedittext_wait': 0,<br \/>\n        'after_editselect_wait': 0.02,<br \/>\n        'drag_n_drop_move_mouse_wait': 0.1,<br \/>\n        'before_drag_wait': 0.2,<br \/>\n        'before_drop_wait': 0.1,<br \/>\n        'after_drag_n_drop_wait': 0.1,<br \/>\n        'scroll_step_wait': 0.1,<\/p>\n<p>        'app_exit_timeout': 10.,<br \/>\n        'app_exit_retry': .1,<br \/>\n    }<\/p>\n<p>    assert(__default_timing['window_find_timeout'] >=<br \/>\n           __default_timing['window_find_retry'] * 2)<\/p>\n<p>    _timings = __default_timing.copy()<br \/>\n    _cur_speed = 1<\/p>\n<p>    def __getattribute__(self, attr):<br \/>\n        \"\"\"Get the value for a particular timing\"\"\"<br \/>\n        if attr in ['__dict__', '__members__', '__methods__', '__class__']:<br \/>\n            return object.__getattribute__(self, attr)<\/p>\n<p>        if attr in dir(TimeConfig):<br \/>\n            return object.__getattribute__(self, attr)<\/p>\n<p>        if attr in self.__default_timing:<br \/>\n            return self._timings[attr]<br \/>\n        else:<br \/>\n            raise AttributeError(\"Unknown timing setting: {0}\".format(attr))<\/p>\n<p>    def __setattr__(self, attr, value):<br \/>\n        \"\"\"Set a particular timing\"\"\"<br \/>\n        if attr == '_timings':<br \/>\n            object.__setattr__(self, attr, value)<br \/>\n        elif attr in self.__default_timing:<br \/>\n            self._timings[attr] = value<br \/>\n        else:<br \/>\n            raise AttributeError(\"Unknown timing setting: {0}\".format(attr))<\/p>\n<p>    def fast(self):<br \/>\n        \"\"\"Set fast timing values<\/p>\n<p>        Currently this changes the timing in the following ways:<br \/>\n        timeouts = 1 second<br \/>\n        waits = 0 seconds<br \/>\n        retries = .001 seconds (minimum!)<\/p>\n<p>        (if existing times are faster then keep existing times)<br \/>\n        \"\"\"<\/p>\n<p>        for setting in self.__default_timing:<br \/>\n            # set timeouts to the min of the current speed or 1 second<br \/>\n            if \"_timeout\" in setting:<br \/>\n                self._timings[setting] = \\<br \/>\n                    min(1, self._timings[setting])<\/p>\n<p>            if \"_wait\" in setting:<br \/>\n                self._timings[setting] = self._timings[setting] \/ 2<\/p>\n<p>            elif setting.endswith(\"_retry\"):<br \/>\n                self._timings[setting] = 0.001<\/p>\n<p>            #self._timings['app_start_timeout'] = .5<\/p>\n<p>    def slow(self):<br \/>\n        \"\"\"Set slow timing values<\/p>\n<p>        Currently this changes the timing in the following ways:<br \/>\n        timeouts = default timeouts * 10<br \/>\n        waits = default waits * 3<br \/>\n        retries = default retries * 3<\/p>\n<p>        (if existing times are slower then keep existing times)<br \/>\n        \"\"\"<br \/>\n        for setting in self.__default_timing:<br \/>\n            if \"_timeout\" in setting:<br \/>\n                self._timings[setting] = max(<br \/>\n                    self.__default_timing[setting] * 10,<br \/>\n                    self._timings[setting])<\/p>\n<p>            if \"_wait\" in setting:<br \/>\n                self._timings[setting] = max(<br \/>\n                    self.__default_timing[setting] * 3,<br \/>\n                    self._timings[setting])<\/p>\n<p>            elif setting.endswith(\"_retry\"):<br \/>\n                self._timings[setting] = max(<br \/>\n                    self.__default_timing[setting] * 3,<br \/>\n                    self._timings[setting])<\/p>\n<p>            if self._timings[setting] < .2:\n                self._timings[setting] = .2\n\n    def defaults(self):\n        \"\"\"Set all timings to the default time\"\"\"\n        self._timings = self.__default_timing.copy()\n\n    Fast = deprecated(fast)\n    Slow = deprecated(slow)\n    Defaults = deprecated(defaults)<\/code><br \/>\n\u8fd9\u4e2a\u51fd\u6570\u5f88\u957f\uff0c\u4f46\u662f\u6211\u4eec\u53ea\u9700\u8981\u5173\u6ce8\u4e0e\u6211\u4eec\u9879\u76ee\u76f8\u5173\u7684\u65f6\u95f4\uff08\u5177\u4f53\u770b\u4f60\u81ea\u5df1\u8981\u7528\u5230\u54ea\u4e2atieout\uff09\uff0c\u5c31\u77e5\u9053\u539f\u6765\u662f\u56e0\u4e3a\u65f6\u95f4\u8bbe\u5b9a\u592a\u77ed\uff0c\u5bfc\u81f4\u51fa\u9519\u3002<\/p>\n<p><strong>\uff084\uff09\u4e24\u4e2a\u9519\u8bef\u4e4b\u95f4\u7684\u8054\u7cfb\uff0c\u4e5f\u5c31\u662f2\u4e3a\u4ec0\u4e48\u4f1a\u5bfc\u81f43<\/strong><br \/>\n1\uff1ain\u8fdb\u7a0b\u5e76\u6ca1\u6709\u5728\u4e00\u5f00\u673a\u5c31\u8fdb\u5165\u7ebf\u7a0b\u6c60\uff0c\u800c\u662f\u88ab\u4eba\u4e3a\u6253\u5f00\u7684\u65f6\u5019\u624d\u88ab\u521b\u5efa\uff0c\u65f6\u95f4\u8d85\u957f\u52a0\u65f6\u4e86<\/p>\n<p>2\uff1ain\u7ebf\u7a0b\u5728\u5f00\u673a\u4e4b\u540e\u4e00\u76f4\u6ca1\u6709\u6253\u5f00\uff0c\u4e8e\u662f\u8fdb\u5165\u4e86\u963b\u585e\uff0c\u518d\u6b21\u88ab\u8c03\u7528\u65f6\u95f4\u76f8\u5bf9\u6162\uff0c\u4f46\u662f\u6bd4\u5f00\u673a\u8981\u5feb\uff0c\u6240\u4ee5\u8fd9\u79cd\u60c5\u51b5\u591a\u51fa\u73b0\u4e8e\u4e00\u4e9b\u7b14\u8bb0\u672c\u7535\u8111\uff0c\u4e00\u4e2a\u7ebf\u7a0b\u7684\u6267\u884c\u901f\u5ea6\u6bd4\u8f83\u6162\u3002\u6240\u4ee5\u4f1a\u51fa\u73b0\u8fd9\u4e2a\u60c5\u51b5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u200b PS\uff1aUP\u4e3b\u53ea\u662f\u67d0\u53cc\u975e\u4e00\u672c\u7684\u6d4b\u5f00\u5b9e\u4e60\u751f\uff0c\u5728\u5f00\u53d1\u811a\u672c\u7684\u65f6\u5019\u53d1\u73b0\u7684\u8fd9\u4e2a\u95ee\u9898\uff0c\u5982\u679c\u6709\u8bf4\u7684\u4e0d\u5bf9\u7684\u5730\u65b9\u548c\u5199\u6587\u7ae0\u4e0d\u597d\u7684\u5730\u65b9\u8bf7\u591a\u6307\u6559\u3002 \u6d89\u53ca &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-55","post","type-post","status-publish","format-standard","hentry","category-cs"],"_links":{"self":[{"href":"https:\/\/203929.xyz\/index.php\/wp-json\/wp\/v2\/posts\/55","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/203929.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/203929.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/203929.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/203929.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=55"}],"version-history":[{"count":2,"href":"https:\/\/203929.xyz\/index.php\/wp-json\/wp\/v2\/posts\/55\/revisions"}],"predecessor-version":[{"id":57,"href":"https:\/\/203929.xyz\/index.php\/wp-json\/wp\/v2\/posts\/55\/revisions\/57"}],"wp:attachment":[{"href":"https:\/\/203929.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/203929.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/203929.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}