Skip to content

Commit ce8507c

Browse files
committed
Culebron: Take screenshot using UiAutomatorHelper if available
- Version 11.0.9
1 parent 3335d1f commit ce8507c

9 files changed

Lines changed: 19 additions & 10 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from setuptools import setup, find_packages
44

55
setup(name='androidviewclient',
6-
version='11.0.8',
6+
version='11.0.9',
77
description='''AndroidViewClient is a 100% pure python library and tools
88
that simplifies test script creation providing higher level
99
operations and the ability of obtaining the tree of Views present at

src/com/dtmilano/android/adb/adbclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
'''
1919
import threading
2020

21-
__version__ = '11.0.8'
21+
__version__ = '11.0.9'
2222

2323
import sys
2424
import warnings

src/com/dtmilano/android/concertina.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import time
2626

2727
__author__ = 'diego'
28-
__version__ = '11.0.8'
28+
__version__ = '11.0.9'
2929

3030
DEBUG = True
3131

src/com/dtmilano/android/controlpanel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@author: Ahmed Kasem
2020
'''
2121

22-
__version__ = '11.0.8'
22+
__version__ = '11.0.9'
2323

2424
import sys, os
2525
import Tkinter, tkFileDialog, ttk

src/com/dtmilano/android/culebron.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818
@author: Diego Torres Milano
1919
2020
'''
21+
import StringIO
2122
import random
2223
import time
2324
import re
2425
from com.dtmilano.android.common import profileStart
2526
from com.dtmilano.android.common import profileEnd
2627
from com.dtmilano.android.concertina import Concertina
2728

28-
__version__ = '11.0.8'
29+
__version__ = '11.0.9'
2930

3031
import sys
3132
import threading
@@ -236,6 +237,9 @@ def __init__(self, vc, device, serialno, printOperation, scale=1, concertina=Fal
236237
self.isTouchingPoint = self.vc is None
237238
self.coordinatesUnit = Unit.DIP
238239
self.permanentlyDisableEvents = False
240+
self.unscaledScreenshot = None
241+
self.image = None
242+
self.screenshot = None
239243
if DEBUG:
240244
try:
241245
self.printGridInfo()
@@ -272,7 +276,12 @@ def takeScreenshotAndShowItOnWindow(self):
272276

273277
if DEBUG:
274278
print >> sys.stderr, "takeScreenshotAndShowItOnWindow()"
275-
self.unscaledScreenshot = self.device.takeSnapshot(reconnect=True)
279+
if self.vc and self.vc.uiAutomatorHelper:
280+
received = self.vc.uiAutomatorHelper.takeScreenshot()
281+
stream = StringIO.StringIO(received)
282+
self.unscaledScreenshot = Image.open(stream)
283+
else:
284+
self.unscaledScreenshot = self.device.takeSnapshot(reconnect=True)
276285
self.image = self.unscaledScreenshot
277286
(width, height) = self.image.size
278287
if self.scale != 1:

src/com/dtmilano/android/robotframework/viewclientwrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@author: Diego Torres Milano
1919
'''
2020

21-
__version__ = '11.0.8'
21+
__version__ = '11.0.9'
2222
__author__ = 'diego'
2323

2424
import sys

src/com/dtmilano/android/uiautomator/uiautomatorhelper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@author: Diego Torres Milano
1919
'''
2020

21-
__version__ = '11.0.8'
21+
__version__ = '11.0.9'
2222

2323
import os
2424
import subprocess

tools/culebra

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ___________________/ /__/ /__/ /__/ /________________________________
2020
2121
'''
2222

23-
__version__ = '11.0.8'
23+
__version__ = '11.0.9'
2424

2525
import re
2626
import sys

tools/dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Created on Feb 3, 2012
66
@author: diego
77
'''
88

9-
__version__ = '11.0.8'
9+
__version__ = '11.0.9'
1010

1111
import sys
1212
import os

0 commit comments

Comments
 (0)