File tree Expand file tree Collapse file tree
src/com/dtmilano/android/adb Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33from setuptools import setup , find_packages
44
55setup (name = 'androidviewclient' ,
6- version = '7.1.1 ' ,
6+ version = '7.1.2 ' ,
77 description = '''AndroidViewClient is a 100% pure python tool that
88 simplifies test script creation providing higher level operations and the ability of
99 obtaining the tree of Views present at any given moment on the device or emulator screen.
Original file line number Diff line number Diff line change @@ -285,11 +285,18 @@ def shell(self, cmd=None):
285285 def getRestrictedScreen (self ):
286286 ''' Gets C{mRestrictedScreen} values from dumpsys. This is a method to obtain display dimensions '''
287287
288+ outlines = self .shell ('dumpsys window' ).splitlines ()
288289 rsRE = re .compile ('\s*mRestrictedScreen=\((?P<x>\d+),(?P<y>\d+)\) (?P<w>\d+)x(?P<h>\d+)' )
289- for line in self . shell ( 'dumpsys window' ). splitlines () :
290+ for line in outlines :
290291 m = rsRE .match (line )
291292 if m :
292293 return m .groups ()
294+ # in order to competiable with android-2.3.5
295+ dsRE = re .compile ('\s*DisplayWidth=(?P<x>\d+) DisplayHeight=(?P<y>\d+)' )
296+ for line in outlines :
297+ m = dsRE .match (line )
298+ if m :
299+ return ('0' , '0' ) + m .groups ()
293300 raise RuntimeError ("Couldn't find mRestrictedScreen in dumpsys" )
294301
295302 def __getProp (self , key , strip = True ):
You can’t perform that action at this time.
0 commit comments