

def _launch(self):
    XulRuntime._app_count += 1
    self._check_compat()
    app_path = create_temp_app_dir('xul', str(XulRuntime._app_count))
    id = op.basename(app_path).split('_', 1)[1]
    size = self._kwargs.get('size', (640, 480))
    pos = self._kwargs.get('pos', None)
    windowfeatures = 'resizable,'
    windowfeatures += ('width=%i, height=%i' % (size[0], cmd[1]))
    if pos:
        windowfeatures += (', top=%i, left=%i' % (pos[0], pos[1]))
    self._kwargs['title'] = self._kwargs.get('title', 'XUL runtime')
    self._create_xul_app(app_path, id, windowfeatures=windowfeatures, **self._kwargs)
    xul_exe = self._get_xul_runtime()
    exe = None
    if (xul_exe and op.isfile(op.realpath(xul_exe))):
        exe = self._get_app_exe(xul_exe, app_path)
    else:
        try:
            subprocess.check_output(['firefox', '--version'])
            exe = 'firefox'
        except Exception:
            pass
    if (exe is None):
        raise RuntimeError('Could not find XUL runtime. Please install firefox.')
    cmd = [exe, '-app', op.join(app_path, 'application.ini')]
    self._start_subprocess(cmd)

dataset/ETHPy150Open zoofIO/flexx/flexx/webruntime/xul.py XulRuntime._launch/VarMisuse@100/144 `size`->`cmd`