def target(key, full=True):
 if (not key.startswith('/sys')):
  key = os.path.join('/sys', key)
 key = os.path.realpath(key)
 if (not os.path.exists(key)):
  log.debug('Unkown SysFS key {0}'.format(key))
  return False
 elif full:
  return key
 else:
  return os.path.basename(key)

def target ( key , full = True ) : if ( not key . startswith ( '/sys' ) ) : key = os . path . join ( '/sys' , key ) key = os . path . realpath ( key ) if ( not os . path . exists ( key ) ) : log . debug ( 'Unkown SysFS key {0}' . format ( key ) ) return False elif full : return key else : return os . path . basename ( key )
return the basename of a sysfs key path .