def GetInjectScript(scripts):
  lines = []
  if scripts:
    if not isinstance(scripts, list):
      scripts = scripts.split(',')
    for script in scripts:
      if os.path.exists(script):
        with open(script) as f:
          lines.extend(f.read())
      elif util.resource_exists(script):
        lines.extend(util.resource_string(script))
      else:
        raise Exception('Script does not exist: %s', script)

  def MinifyScript(script):
    """Remove C-style comments and line breaks from script.
    Note: statements must be ';' terminated, and not depending on newline"""
    # Regex adapted from http://ostermiller.org/findcomment.html.
    MULTILINE_COMMENT_RE = re.compile(r'/\*.*?\*/', re.DOTALL | re.MULTILINE)
    SINGLELINE_COMMENT_RE = re.compile(r'//.*', re.MULTILINE)
    # Remove C-style comments from JS.
    script = re.sub(MULTILINE_COMMENT_RE, '', script)
    script = re.sub(SINGLELINE_COMMENT_RE, '', script)
    # Remove line breaks.
    script = script.translate(None, '\r\n')
    return script

  return MinifyScript(''.join(lines))
Rereads the old contents of the cell back into the editing buffer.
dataset/ETHPy150Open chromium/web-page-replay/script_injector.py/GetInjectScript--crossover with--dataset/ETHPy150Open Arelle/Arelle/arelle/TkTableWrapper.py/Table.reread