@with_device
def getprop(name=None):
 with context.quiet:
  if name:
   return process(['getprop', name]).recvall().strip()
  result = process(['getprop']).recvall()
 expr = '\\[([^\\]]+)\\]: \\[(.*)\\]'
 props = {}
 for line in result.splitlines():
  if (not line.startswith('[')):
   continue
  (name, value) = re.search(expr, line).groups()
  if value.isdigit():
   value = int(value)
  props[name] = value
 return props

@ with_device def getprop ( name = None ) : with context . quiet : if name : return process ( [ 'getprop' , name ] ) . recvall ( ) . strip ( ) result = process ( [ 'getprop' ] ) . recvall ( ) expr = '\\[([^\\]]+)\\]: \\[(.*)\\]' props = { } for line in result . splitlines ( ) : if ( not line . startswith ( '[' ) ) : continue ( name , value ) = re . search ( expr , line ) . groups ( ) if value . isdigit ( ) : value = int ( value ) props [ name ] = value return props
reads a properties from the system property store .