@@ -476,18 +476,18 @@ def pix(pixel, _resultats={}, b=pack):
476
476
This method uses of memoization.
477
477
'''
478
478
if pixel not in _resultats :
479
- _resultats [pixel ] = b (b'<B' , (pixel & rmask ) >> 16 ) + \
479
+ _resultats [pixel ] = b (b'<B' , (pixel & rmask ) >> 16 ) + \
480
480
b (b'<B' , (pixel & gmask ) >> 8 ) + b (b'<B' , pixel & bmask )
481
481
return _resultats [pixel ]
482
482
483
483
# http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/ImUtil.c#n444
484
- xrange = getattr (__builtins__ , 'xrange' , range )
485
484
rmask = ximage .contents .red_mask
486
485
gmask = ximage .contents .green_mask
487
486
bmask = ximage .contents .blue_mask
487
+ xrange = getattr (__builtins__ , 'xrange' , range )
488
488
get_pix = self .xlib .XGetPixel
489
489
pixels = [pix (get_pix (ximage , x , y ))
490
- for y in range (height ) for x in range (width )]
490
+ for y in xrange (height ) for x in xrange (width )]
491
491
self .image = b'' .join (pixels )
492
492
#"""
493
493
@@ -673,13 +673,13 @@ def on_exists(fname):
673
673
print (filename )
674
674
675
675
print ("\n A screenshot to grab them all" )
676
- for filename in screenshotter .save (output = 'full-screenshot .png' , screen = - 1 ):
676
+ for filename in screenshotter .save (output = 'fullscreen .png' , screen = - 1 ):
677
677
print (filename )
678
678
679
679
print ("\n Screenshot of the monitor 1, with callback" )
680
680
for filename in screenshotter .save (output = 'mon-%d.png' ,
681
- screen = 1 ,
682
- callback = on_exists ):
681
+ screen = 1 ,
682
+ callback = on_exists ):
683
683
print (filename )
684
684
except ScreenshotError as ex :
685
685
print (ex )
0 commit comments