Skip to content

Commit 557894d

Browse files
committed
chore: run ruff
1 parent 36cd527 commit 557894d

18 files changed

+33
-15
lines changed

docs/source/examples/fps.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
import time
99

1010
import cv2
11-
import mss
1211
import numpy as np
1312

13+
import mss
14+
1415

1516
def screen_record() -> int:
1617
try:

docs/source/examples/opencv_numpy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
import time
88

99
import cv2
10-
import mss
1110
import numpy as np
1211

12+
import mss
13+
1314
with mss.mss() as sct:
1415
# Part of the screen to capture
1516
monitor = {"top": 40, "left": 0, "width": 800, "height": 640}

docs/source/examples/pil.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
PIL example using frombytes().
55
"""
66

7-
import mss
87
from PIL import Image
98

9+
import mss
10+
1011
with mss.mss() as sct:
1112
# Get rid of the first, as it represents the "All in One" monitor:
1213
for num, monitor in enumerate(sct.monitors[1:], 1):

docs/source/examples/pil_pixels.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
PIL examples to play with pixels.
55
"""
66

7-
import mss
87
from PIL import Image
98

9+
import mss
10+
1011
with mss.mss() as sct:
1112
# Get a screenshot of the 1st monitor
1213
sct_img = sct.grab(sct.monitors[1])

src/tests/bench_bgra2rgb.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@
3030

3131
import time
3232

33-
import mss
3433
import numpy as np
35-
from mss.screenshot import ScreenShot
3634
from PIL import Image
3735

36+
import mss
37+
from mss.screenshot import ScreenShot
38+
3839

3940
def mss_rgb(im: ScreenShot) -> bytes:
4041
return im.rgb

src/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from zipfile import ZipFile
1212

1313
import pytest
14+
1415
from mss import mss
1516

1617

src/tests/test_bgra_to_rgb.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
import pytest
6+
67
from mss.base import ScreenShot
78

89

src/tests/test_get_pixels.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os
77

88
import pytest
9+
910
from mss import mss
1011
from mss.base import ScreenShot
1112
from mss.exception import ScreenShotError

src/tests/test_gnu_linux.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
from collections.abc import Generator
77
from unittest.mock import Mock, patch
88

9+
import pytest
10+
911
import mss
1012
import mss.linux
11-
import pytest
1213
from mss.base import MSSBase
1314
from mss.exception import ScreenShotError
1415

@@ -21,7 +22,7 @@
2122
DEPTH = 24
2223

2324

24-
@pytest.fixture()
25+
@pytest.fixture
2526
def display() -> Generator:
2627
with pyvirtualdisplay.Display(size=(WIDTH, HEIGHT), color_depth=DEPTH) as vdisplay:
2728
yield vdisplay.new_display_var

src/tests/test_implementation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
from typing import TYPE_CHECKING
1313
from unittest.mock import Mock, patch
1414

15+
import pytest
16+
1517
import mss
1618
import mss.tools
17-
import pytest
1819
from mss.__main__ import main as entry_point
1920
from mss.base import MSSBase
2021
from mss.exception import ScreenShotError

0 commit comments

Comments
 (0)