

def _osx_create_app(self, xul_path, path, title):
    ' Create osx app\n\n        * xul_path: path to executable of xulrunner (not the symlink)\n        * path: location of the .app directory to create.\n        * title: the title of the window *and* the process name\n        '
    if ('Contents/MacOS' not in xul_path):
        raise NotImplementedError('Cannot deal with real xulrunner yet')
    xul_app = op.dirname(op.dirname(op.dirname(xul_path)))
    if (not xul_app.endswith('.app')):
        raise TypeError('The xulrunner application must end in .app.')
    if op.isdir(path):
        shutil.rmtree(path)
    os.mkdir(path)
    os.mkdir(op.join(path, 'Contents'))
    os.mkdir(op.join(path, 'Contents', 'MacOS'))
    os.mkdir(op.join(path, 'Contents', 'Resources'))
    for (dirpath, dirnames, filenames) in os.walk(xul_app):
        relpath = op.relpath(dirpath, xul_app)
        if ('.app' in relpath):
            continue
        if (relpath.endswith('MacOS') or relpath.endswith('Resources')):
            for fname in filenames:
                filename1 = op.join(xul_app, relpath, fname)
                filename2 = op.join(path, relpath, f)
                os.symlink(filename1, filename2)
    os.symlink(op.join(xul_app, 'Contents', 'MacOS', 'firefox'), op.join(path, 'Contents', 'MacOS', 'xulrunner'))
    info = INFO_PLIST.format(name=title)
    with open(op.join(path, 'Contents', 'info.plist'), 'wb') as f:
        f.write(info.encode())
    if self._kwargs.get('icon'):
        icon = self._kwargs.get('icon')
        icon.write(op.join(path, 'Contents', 'Resources', 'app.icns'))

dataset/ETHPy150Open zoofIO/flexx/flexx/webruntime/xul.py XulRuntime._osx_create_app/VarMisuse@235/417 `fname`->`f`