Skip to content

Commit 10e4a24

Browse files
author
BoboTiG
committed
Update with Mac support
1 parent 61cdb31 commit 10e4a24

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,19 @@ You can pass `oneshot=True` to create one screen shot of all monitors.
3838
from platform import system
3939
from mss import *
4040

41-
this_is = system()
42-
if this_is == 'Linux':
43-
MSS = MSSLinux
44-
elif this_is == 'Windows':
45-
MSS = MSSWindows
46-
else:
47-
err = 'System "{0}" not implemented.'.format(this_is)
41+
systems = {
42+
'Linux' : MSSLinux,
43+
'Windows': MSSWindows,
44+
'Darwin' : MSSMac
45+
}
46+
try:
47+
MSS = systems[system()]
48+
except KeyError:
49+
err = 'System "{0}" not implemented.'.format(system())
4850
raise NotImplementedError(err)
4951

5052
try:
51-
mss = MSS()
53+
mss = MSS(debug=False)
5254

5355
# One screen shot per monitor
5456
for filename in mss.save():

0 commit comments

Comments
 (0)