def _load(request,viewName,above=None):
  if above:
    out = stdout("Loading view %s above the current view" % viewName)
  else:
    out = stdout("Loading view %s" % viewName)
  profile = getProfile(request)
  try:
    view = profile.view_set.get(name=viewName)
  except __HOLE__:
    return stderr("Unknown view %s" % viewName)
  if not above:
    out += "Windows.windows.each( function(w) {w.destroy();} );"
  for window in view.window_set.all():
    out += _create(request,window.name)
    out += "win = %s_win;" % window.name
    out += "$('%s_img').src = '%s';" % (window.name,window.url)
    out += "win.show();"
    out += "win.setLocation(%d,%d);" % (window.top,window.left)
    out += "win.setSize(%d,%d);" % (window.width,window.height)
    if window.interval:
      out += "window.%s_interval = %d;" % (window.name,window.interval)
      out += "window.%s_timer = setTimeout('window.%s_redraw()', window.%s_interval);" % ((window.name,) * 3)
  return out
dataset/ETHPy150Open tmm1/graphite/webapp/graphite/cli/commands.py/_load