From c503352c87a2c62b48ade506f82d6535fbed250b Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Fri, 28 Jul 2023 01:32:38 +0200 Subject: [PATCH] Change the still working HTTP URLs for HTTPS ones and replace some URLs with the ones they redirect to Verified exhaustiveness with: ```sh grep -r 'http:' ``` --- README.md | 2 +- docs/Makefile | 2 +- docs/conf.py | 4 ++-- docs/make.bat | 2 +- docs/simplified-chinese.ipynb | 10 +++++----- pyautogui/__init__.py | 2 +- pyautogui/_pyautogui_osx.py | 4 ++-- pyautogui/_pyautogui_win.py | 14 +++++++------- pyautogui/_pyautogui_x11.py | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 2c28417..c4e2783 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Pillow needs to be installed, and on Linux you may need to install additional li https://stackoverflow.com/questions/7648200/pip-install-pil-e-tickets-1-no-jpeg-png-support - http://ubuntuforums.org/showthread.php?t=1751455 + https://ubuntuforums.org/showthread.php?t=1751455 If you want to do development and contribute to PyAutoGUI, you will need to install these modules from PyPI: diff --git a/docs/Makefile b/docs/Makefile index 6f67292..c43896e 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -9,7 +9,7 @@ BUILDDIR = _build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://www.sphinx-doc.org/en/master/) endif # Internal variables. diff --git a/docs/conf.py b/docs/conf.py index 49324f1..ab009ec 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,7 +4,7 @@ # # This file does only contain a selection of the most common options. For a # full list see the documentation: -# http://www.sphinx-doc.org/en/master/config +# https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- @@ -155,4 +155,4 @@ (master_doc, 'PyAutoGUI', 'PyAutoGUI Documentation', author, 'PyAutoGUI', 'One line description of project.', 'Miscellaneous'), -] \ No newline at end of file +] diff --git a/docs/make.bat b/docs/make.bat index 4535a6b..5785a3d 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -56,7 +56,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/en/master/ exit /b 1 ) diff --git a/docs/simplified-chinese.ipynb b/docs/simplified-chinese.ipynb index df6cce0..feaffa5 100644 --- a/docs/simplified-chinese.ipynb +++ b/docs/simplified-chinese.ipynb @@ -11,13 +11,13 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "本教程译自大神[Al Sweigart](http://inventwithpython.com/)的[PyAutoGUI](https://pyautogui.readthedocs.org/)项目,Python自动化工具,更适合处理GUI任务,网页任务推荐:\n", + "本教程译自大神[Al Sweigart](https://inventwithpython.com/)的[PyAutoGUI](https://pyautogui.readthedocs.org/)项目,Python自动化工具,更适合处理GUI任务,网页任务推荐:\n", "- [Selenium](https://selenium-python.readthedocs.org/)+Firefox记录(Chromedriver和Phantomjs也很给力,Phantomjs虽然是无头浏览器,但有时定位不准),然后用Python写单元测试\n", "- [request](http://www.python-requests.org/en/latest/)处理get/post请求写一堆代码自动化处理,都在后台运行,不用运行浏览器,非常适合处理表单\n", "\n", - "没有[sikuli](http://www.sikuli.org/)功能多,但是Python让生活更简单,[人生苦短,Python当歌](http://cn.pycon.org/2015/)。\n", + "没有[sikuli](http://www.sikuli.org/)功能多,但是Python让生活更简单,[人生苦短,Python当歌](https://cn.pycon.org/2015/)。\n", "\n", - "同时推荐一本Python网络数据采集(图灵社区取的名字^_^)的基础书籍[Ryan Mitchell的《Web Scraping with Python》](http://shop.oreilly.com/product/0636920034391.do),可以和PyAutoGUI结合使用。\n", + "同时推荐一本Python网络数据采集(图灵社区取的名字^_^)的基础书籍[Ryan Mitchell的《Web Scraping with Python》](https://www.oreilly.com/library/view/web-scraping-with/9781491910283/),可以和PyAutoGUI结合使用。\n", "\n", "tl;dr\n", "\n", @@ -1743,7 +1743,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "由于Ubuntu上安装Pillow时缺少PNG和JPEG依赖,所以安装比较复杂,具体可以看[Ubuntu论坛](http://conda.pydata.org/miniconda.html)。不过用[miniconda](http://conda.pydata.org/miniconda.html)可以解决这些问题,如果Ubuntu或Mint上安装了miniconda,可以直接`conda install pillow`来安装。" + "由于Ubuntu上安装Pillow时缺少PNG和JPEG依赖,所以安装比较复杂,具体可以看[Ubuntu论坛](https://docs.conda.io/en/latest/miniconda.html)。不过用[miniconda](https://docs.conda.io/en/latest/miniconda.html)可以解决这些问题,如果Ubuntu或Mint上安装了miniconda,可以直接`conda install pillow`来安装。" ] }, { @@ -1757,7 +1757,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "`screenshot()`函数会返回`Image`对象(参考[Pillow或PIL模块文档](http://python-pillow.github.io/)),也可以设置文件名:" + "`screenshot()`函数会返回`Image`对象(参考[Pillow或PIL模块文档](https://python-pillow.org/)),也可以设置文件名:" ] }, { diff --git a/pyautogui/__init__.py b/pyautogui/__init__.py index 43aebd5..943ae4e 100644 --- a/pyautogui/__init__.py +++ b/pyautogui/__init__.py @@ -555,7 +555,7 @@ def isShiftCharacter(character): # the mouse. MINIMUM_DURATION = 0.1 # If sleep_amount is less than MINIMUM_DURATION, time.sleep() will be a no-op and the mouse cursor moves there instantly. -# TODO: This value should vary with the platform. http://stackoverflow.com/q/1133857 +# TODO: This value should vary with the platform. https://stackoverflow.com/q/1133857 MINIMUM_SLEEP = 0.05 # The number of seconds to pause after EVERY public function call. Useful for debugging: diff --git a/pyautogui/_pyautogui_osx.py b/pyautogui/_pyautogui_osx.py index 1a895f0..c44a66d 100644 --- a/pyautogui/_pyautogui_osx.py +++ b/pyautogui/_pyautogui_osx.py @@ -188,7 +188,7 @@ keyboardMapping[c.upper()] = keyboardMapping[c] # Taken from ev_keymap.h -# http://www.opensource.apple.com/source/IOHIDFamily/IOHIDFamily-86.1/IOHIDSystem/IOKit/hidsystem/ev_keymap.h +# https://www.opensource.apple.com/source/IOHIDFamily/IOHIDFamily-86.1/IOHIDSystem/IOKit/hidsystem/ev_keymap.h special_key_translate_table = { 'KEYTYPE_SOUND_UP': 0, 'KEYTYPE_SOUND_DOWN': 1, @@ -264,7 +264,7 @@ def _normalKeyEvent(key, upDown): def _specialKeyEvent(key, upDown): """ Helper method for special keys. - Source: http://stackoverflow.com/questions/11045814/emulate-media-key-press-on-mac + Source: https://stackoverflow.com/questions/11045814/emulate-media-key-press-on-mac """ assert upDown in ('up', 'down'), "upDown argument must be 'up' or 'down'" diff --git a/pyautogui/_pyautogui_win.py b/pyautogui/_pyautogui_win.py index f4119ac..c11fc09 100644 --- a/pyautogui/_pyautogui_win.py +++ b/pyautogui/_pyautogui_win.py @@ -22,16 +22,16 @@ """ A lot of this code is probably repeated from win32 extensions module, but I didn't want to have that dependency. -Note: According to http://msdn.microsoft.com/en-us/library/windows/desktop/ms646260(v=vs.85).aspx +Note: According to https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mouse_event?redirectedfrom=MSDN the ctypes.windll.user32.mouse_event() function has been superseded by SendInput. -SendInput() is documented here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx +SendInput() is documented here: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput?redirectedfrom=MSDN UPDATE: SendInput() doesn't seem to be working for me. I've switched back to mouse_event().""" # Event codes to be passed to the mouse_event() win32 function. -# Documented here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646273(v=vs.85).aspx +# Documented here: https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-mouseinput?redirectedfrom=MSDN MOUSEEVENTF_MOVE = 0x0001 MOUSEEVENTF_LEFTDOWN = 0x0002 MOUSEEVENTF_LEFTUP = 0x0004 @@ -47,17 +47,17 @@ MOUSEEVENTF_WHEEL = 0x0800 MOUSEEVENTF_HWHEEL = 0x01000 -# Documented here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646304(v=vs.85).aspx +# Documented here: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-keybd_event?redirectedfrom=MSDN KEYEVENTF_KEYDOWN = 0x0000 # Technically this constant doesn't exist in the MS documentation. It's the lack of KEYEVENTF_KEYUP that means pressing the key down. KEYEVENTF_KEYUP = 0x0002 -# Documented here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646270(v=vs.85).aspx +# Documented here: https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-input?redirectedfrom=MSDN INPUT_MOUSE = 0 INPUT_KEYBOARD = 1 # These ctypes structures are for Win32 INPUT, MOUSEINPUT, KEYBDINPUT, and HARDWAREINPUT structures, -# used by SendInput and documented here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646270(v=vs.85).aspx +# used by SendInput and documented here: https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-input?redirectedfrom=MSDN # Thanks to BSH for this StackOverflow answer: https://stackoverflow.com/questions/18566289/how-would-you-recreate-this-windows-api-structure-with-ctypes class MOUSEINPUT(ctypes.Structure): _fields_ = [ @@ -103,7 +103,7 @@ class _I(ctypes.Union): """ Keyboard key mapping for pyautogui: -Documented at http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx +Documented at https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes?redirectedfrom=MSDN The *KB dictionaries in pyautogui map a string that can be passed to keyDown(), keyUp(), or press() into the code used for the OS-specific keyboard function. diff --git a/pyautogui/_pyautogui_x11.py b/pyautogui/_pyautogui_x11.py index 38c8463..94db5ef 100644 --- a/pyautogui/_pyautogui_x11.py +++ b/pyautogui/_pyautogui_x11.py @@ -20,7 +20,7 @@ #from pyautogui import * """ -Much of this code is based on information gleaned from Paul Barton's PyKeyboard in PyUserInput from 2013, itself derived from Akkana Peck's pykey in 2008 ( http://www.shallowsky.com/software/crikey/pykey-0.1 ), itself derived from her "Crikey" lib. +Much of this code is based on information gleaned from Paul Barton's PyKeyboard in PyUserInput from 2013, itself derived from Akkana Peck's pykey in 2008 (https://shallowsky.com/software/crikey/pykey-0.1), itself derived from her "Crikey" lib. """ def _position():