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

Skip to content

Commit e98012e

Browse files
author
Mickaël Schoentgen
committed
PEP8, cleanup
1 parent 17728c4 commit e98012e

24 files changed

+166
-149
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ build/
22
.cache/
33
dist/
44
*.egg-info/
5+
.idea/
56
MANIFEST*
67
.DS_Store
78
*.orig

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ python:
55
- 3.4
66
- 3.5
77
- 3.6
8-
- nightly # currently points to 3.7-dev
8+
# - nightly # currently points to 3.7-dev
99

1010
addons:
1111
apt:

CHANGELOG

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ History:
22

33
<see Git checkin messages for history>
44

5-
dev
5+
2.0.22 2017/04/29
6+
- new contributors: David Becker, redodo
67
- add an example to capture only a part of the screen
78
- better use of exception mechanism
89
- Linux: use of hasattr to prevent Exception on early exit
10+
- Mac: take into account extra black pixels added when screen with is not divisible by 16 (fix #14)
911

1012
2.0.18 2016/12/03
1113
- change license to MIT

CONTRIBUTORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ bubulle [http://indexerror.net/user/bubulle]
1515
Condé 'Eownis' Titouan <[email protected]> <[email protected]> [https://titouan.co]
1616
- MacOS X tester
1717

18+
David Becker [https://davide.me] and redodo [https://github.com/redodo]
19+
- Mac: Take into account extra black pixels added when screen with is not divisible by 16
20+
1821
Jochen 'cycomanic' Schroeder [https://github.com/cycomanic]
1922
- GNU/Linux: use errcheck instead of deprecated restype with callable, for enum_display_monitors()
2023

examples/callback.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
#!/usr/bin/env python
21
# coding: utf-8
3-
''' This is part of the MSS Python's module.
2+
""" This is part of the MSS Python's module.
43
Source: https://github.com/BoboTiG/python-mss
5-
'''
4+
"""
65

76
from os import rename
87
from os.path import isfile
@@ -13,13 +12,13 @@
1312

1413
def main():
1514
# type: () -> int
16-
''' Usage example. '''
15+
""" Usage example. """
1716

1817
def on_exists(fname):
1918
# type: (str) -> None
20-
''' Callback example when we try to overwrite an existing
19+
""" Callback example when we try to overwrite an existing
2120
screenshot.
22-
'''
21+
"""
2322

2423
if isfile(fname):
2524
newfile = fname + '.old'

examples/linux-display_keyword.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
#!/usr/bin/env python
21
# coding: utf-8
3-
''' This is part of the MSS Python's module.
2+
""" This is part of the MSS Python's module.
43
Source: https://github.com/BoboTiG/python-mss
5-
'''
4+
"""
65

76
from mss.exception import ScreenshotError
87
from mss.linux import MSS
98

109

1110
def main():
1211
# type: () -> int
13-
''' Usage example with a specific display. '''
12+
""" Usage example with a specific display. """
1413

1514
display = ':0.0'
1615
print('Screenshot of display "{0}"'.format(display))

examples/part-of-screen.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
#!/usr/bin/env python
21
# coding: utf-8
3-
''' This is part of the MSS Python's module.
2+
""" This is part of the MSS Python's module.
43
Source: https://github.com/BoboTiG/python-mss
5-
'''
4+
"""
65

76
from mss.exception import ScreenshotError
87
from mss import mss
98

109

1110
def main():
1211
# type: () -> int
13-
''' Example to capture part of the screen. '''
12+
""" Example to capture part of the screen. """
1413

1514
try:
1615
with mss() as sct:

examples/pil.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
#!/usr/bin/env python
21
# coding: utf-8
3-
''' This is part of the MSS Python's module.
2+
""" This is part of the MSS Python's module.
43
Source: https://github.com/BoboTiG/python-mss
5-
'''
4+
"""
65

76
from mss.exception import ScreenshotError
87
from mss.factory import mss
@@ -11,7 +10,7 @@
1110

1211
def main():
1312
# type: () -> int
14-
''' PIL example using frombytes(). '''
13+
""" PIL example using frombytes(). """
1514

1615
try:
1716
with mss() as sct:

mss/__init__.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
#!/usr/bin/env python
21
# coding: utf-8
3-
''' An ultra fast cross-platform multiple screenshots module in pure python
2+
""" An ultra fast cross-platform multiple screenshots module in pure python
43
using ctypes.
54
65
This module is maintained by Mickaël Schoentgen <[email protected]>.
76
87
You can always get the latest version of this module at:
98
https://github.com/BoboTiG/python-mss
109
If that URL should fail, try contacting the author.
11-
'''
10+
"""
1211

1312
from .exception import ScreenshotError
1413
from .factory import mss
1514

16-
__version__ = '2.0.21'
15+
__version__ = '2.0.22'
1716
__author__ = "Mickaël 'Tiger-222' Schoentgen"
18-
__copyright__ = '''
17+
__copyright__ = """
1918
Copyright (c) 2013-2017, Mickaël 'Tiger-222' Schoentgen
2019
2120
Permission to use, copy, modify, and distribute this software and its
@@ -24,5 +23,5 @@
2423
and that both that copyright notice and this permission notice appear
2524
in supporting documentation or portions thereof, including
2625
modifications, that you make.
27-
'''
26+
"""
2827
__all__ = ['ScreenshotError', 'mss']

mss/__main__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# coding: utf-8
2+
""" This is part of the MSS Python's module.
3+
Source: https://github.com/BoboTiG/python-mss
4+
"""
5+
6+
from __future__ import print_function
7+
8+
from .factory import mss
9+
10+
11+
def main():
12+
""" Main logic. """
13+
14+
with mss() as sct:
15+
for file_name in sct.save():
16+
print(file_name)
17+
18+
19+
if __name__ == '__main__':
20+
exit(main())

0 commit comments

Comments
 (0)