Skip to content
This repository was archived by the owner on Oct 1, 2019. It is now read-only.

Change Image import to support Pillow #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 3 additions & 22 deletions pyrobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,10 @@ def take_screenshot(self, bounds=None):
'''

try:
import Image
from PIL import Image
except ImportError as e:
print e
print "Need to have PIL installed! See: effbot.org for download"
print "Need to have PIL or Pillow installed! See: effbot.org or pypi.python.org for download"
sys.exit()

return self._make_image_from_buffer(self._get_screen_buffer(bounds))
Expand Down Expand Up @@ -370,7 +370,7 @@ def _get_screen_buffer(self, bounds=None):
return hCaptureBitmap

def _make_image_from_buffer(self, hCaptureBitmap):
import Image
from PIL import Image
bmp_info = BITMAPINFO()
bmp_header = BITMAPFILEHEADER()
hdc = windll.user32.GetDC(None)
Expand Down Expand Up @@ -924,22 +924,3 @@ def get_cpus():
robot = Robot()
text = robot.get_clipboard_data()
print text