Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e19632

Browse files
committed
MSS: fix several Flake8 warnings
- C408: Unnecessary dict call - rewrite as a literal - I100: Import statements are in the wrong order - I201: Missing newline before sections or imports
1 parent 3bc0921 commit 0e19632

16 files changed

+33
-21
lines changed

CHANGELOG

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ History:
22

33
<see Git checking messages for history>
44

5-
4.0.0 2018/12/23
5+
4.0.0 201x/xx/xx
66
- MSS: renamed MSSBase to MSSMixin in base.py
7+
- MSS: fix Flake8 C408: Unnecessary dict call - rewrite as a literal, in exceptions.py
8+
- MSS: fix Flake8 I100: Import statements are in the wrong order
9+
- MSS: fix Flake8 I201: Missing newline before sections or imports
710

811
3.3.2 2018/11/20
912
- new contributors: hugovk, Andreas Buhr

docs/source/examples/fps.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
import time
1313

1414
import cv2
15+
1516
import mss
17+
1618
import numpy
1719

1820

docs/source/examples/opencv_numpy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
import time
1010

1111
import cv2
12+
1213
import mss
14+
1315
import numpy
1416

1517

docs/source/examples/pil.py

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

9-
import mss
109
from PIL import Image
1110

11+
import mss
12+
1213

1314
with mss.mss() as sct:
1415
# Get rid of the first, as it represents the "All in One" monitor:

docs/source/examples/pil_pixels.py

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

9-
import mss
109
from PIL import Image
1110

11+
import mss
12+
1213

1314
with mss.mss() as sct:
1415
# Get a screenshot of the 1st monitor

mss/exception.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ class ScreenShotError(Exception):
1111
def __init__(self, message, details=None):
1212
# type: (Dict[str, Any]) -> None
1313
super(Exception, self).__init__(message)
14-
self.details = details or dict()
14+
self.details = details or {}

tests/bench_bgra2rgb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@
3131

3232
import time
3333

34-
import numpy
3534
from PIL import Image
3635

3736
import mss
3837

38+
import numpy
39+
3940

4041
def mss_rgb(im):
4142
return im.rgb

tests/bench_general.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"""
2626

2727
from time import time
28+
2829
import mss
2930
import mss.tools
3031

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import glob
66
import os
77

8-
import pytest
9-
108
import mss
119

10+
import pytest
11+
1212

1313
def pytest_addoption(parser):
1414
txt = 'Display to use (examples: ":0.1", ":0" [default])'

tests/test_bgra_to_rgb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# coding: utf-8
22

3-
import pytest
4-
53
from mss.base import ScreenShot
64

5+
import pytest
6+
77

88
def test_bad_length():
99
data = bytearray(b"789c626001000000ffff030000060005")

0 commit comments

Comments
 (0)