Skip to content

Commit

Permalink
fix: run ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG committed Jul 30, 2024
1 parent ba53669 commit 13ae8f6
Show file tree
Hide file tree
Showing 38 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#
set -eu

python -m ruff --fix docs src
python -m ruff format docs src
python -m ruff check --fix docs src

# "--platform win32" to not fail on ctypes.windll (it does not affect the overall check on other OSes)
python -m mypy --platform win32 src docs/source/examples
1 change: 1 addition & 0 deletions docs/source/examples/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Screenshot of the monitor 1, with callback.
"""

import os
import os.path

Expand Down
1 change: 1 addition & 0 deletions docs/source/examples/custom_cls_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Screenshot of the monitor 1, using a custom class to handle the data.
"""

from typing import Any

import mss
Expand Down
1 change: 1 addition & 0 deletions docs/source/examples/fps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Simple naive benchmark to compare with:
https://pythonprogramming.net/game-frames-open-cv-python-plays-gta-v/
"""

import time

import cv2
Expand Down
1 change: 1 addition & 0 deletions docs/source/examples/fps_multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Example using the multiprocessing module to speed-up screen capture.
https://github.com/pythonlessons/TensorFlow-object-detection-tutorial
"""

from multiprocessing import Process, Queue

import mss
Expand Down
1 change: 1 addition & 0 deletions docs/source/examples/from_pil_tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Use PIL bbox style and percent values.
"""

import mss
import mss.tools

Expand Down
1 change: 1 addition & 0 deletions docs/source/examples/linux_display_keyword.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Usage example with a specific display.
"""

import mss

with mss.mss(display=":0.0") as sct:
Expand Down
1 change: 1 addition & 0 deletions docs/source/examples/opencv_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
OpenCV/Numpy example.
"""

import time

import cv2
Expand Down
1 change: 1 addition & 0 deletions docs/source/examples/part_of_screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Example to capture part of the screen.
"""

import mss
import mss.tools

Expand Down
1 change: 1 addition & 0 deletions docs/source/examples/part_of_screen_monitor_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Example to capture part of the screen of the monitor 2.
"""

import mss
import mss.tools

Expand Down
1 change: 1 addition & 0 deletions docs/source/examples/pil.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
PIL example using frombytes().
"""

import mss
from PIL import Image

Expand Down
1 change: 1 addition & 0 deletions docs/source/examples/pil_pixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
PIL examples to play with pixels.
"""

import mss
from PIL import Image

Expand Down
1 change: 1 addition & 0 deletions src/mss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
https://github.com/BoboTiG/python-mss
If that URL should fail, try contacting the author.
"""

from mss.exception import ScreenShotError
from mss.factory import mss

Expand Down
1 change: 1 addition & 0 deletions src/mss/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import os.path
import sys
from argparse import ArgumentParser
Expand Down
1 change: 1 addition & 0 deletions src/mss/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

from __future__ import annotations

from abc import ABCMeta, abstractmethod
Expand Down
1 change: 1 addition & 0 deletions src/mss/darwin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

from __future__ import annotations

import ctypes
Expand Down
1 change: 1 addition & 0 deletions src/mss/exception.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

from __future__ import annotations

from typing import Any, Dict
Expand Down
1 change: 1 addition & 0 deletions src/mss/factory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import platform
from typing import Any

Expand Down
1 change: 1 addition & 0 deletions src/mss/linux.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions src/mss/screenshot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

from __future__ import annotations

from typing import TYPE_CHECKING, Any, Dict
Expand Down
1 change: 1 addition & 0 deletions src/mss/tools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions src/mss/windows.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

from __future__ import annotations

import ctypes
Expand Down
1 change: 1 addition & 0 deletions src/tests/bench_bgra2rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
numpy_flip 25
numpy_slice 22
"""

import time

import mss
Expand Down
1 change: 1 addition & 0 deletions src/tests/bench_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
access_rgb 574 712 +24.04
output 139 188 +35.25
"""

from __future__ import annotations

from time import time
Expand Down
1 change: 1 addition & 0 deletions src/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import glob
import os
import platform
Expand Down
1 change: 1 addition & 0 deletions src/tests/test_bgra_to_rgb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import pytest
from mss.base import ScreenShot

Expand Down
1 change: 1 addition & 0 deletions src/tests/test_cls_image.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import os
from typing import Any

Expand Down
1 change: 1 addition & 0 deletions src/tests/test_find_monitors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import os

from mss import mss
Expand Down
1 change: 1 addition & 0 deletions src/tests/test_gnu_linux.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import platform
from collections.abc import Generator
from unittest.mock import Mock, patch
Expand Down
1 change: 1 addition & 0 deletions src/tests/test_implementation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions src/tests/test_issue_220.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import mss
import pytest

Expand Down
1 change: 1 addition & 0 deletions src/tests/test_leaks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import os
import platform
from typing import Callable
Expand Down
1 change: 1 addition & 0 deletions src/tests/test_macos.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import ctypes.util
import platform

Expand Down
1 change: 1 addition & 0 deletions src/tests/test_save.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import os.path
from datetime import datetime

Expand Down
1 change: 1 addition & 0 deletions src/tests/test_setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import platform
import tarfile
from subprocess import STDOUT, check_call, check_output
Expand Down
1 change: 1 addition & 0 deletions src/tests/test_third_party.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import itertools
import os
import os.path
Expand Down
1 change: 1 addition & 0 deletions src/tests/test_tools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

import hashlib
import os.path
import zlib
Expand Down
1 change: 1 addition & 0 deletions src/tests/test_windows.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
"""

from __future__ import annotations

import threading
Expand Down

0 comments on commit 13ae8f6

Please sign in to comment.