Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_pluginbundle(destdir, name, extension='.plugin', module=py2app.bundletemplate,
platform='MacOS', copy=mergecopy, mergetree=mergetree,
condition=skipscm, plist={}, arch=None):
kw = module.plist_template.infoPlistDict(
plist.get('CFBundleExecutable', name), plist)
plugin = os.path.join(destdir, kw['CFBundleName'] + extension)
if os.path.exists(plugin):
# Remove any existing build artifacts to ensure
# we're getting a clean build
shutil.rmtree(plugin)
contents = os.path.join(plugin, 'Contents')
resources = os.path.join(contents, 'Resources')
platdir = os.path.join(contents, platform)
dirs = [contents, resources, platdir]
plist = plistlib.Plist()
plist.update(kw)
plistPath = os.path.join(contents, 'Info.plist')
if os.path.exists(plistPath):
if plist != plistlib.Plist.fromFile(plistPath):
def framework_copy_condition(src):
# Skip Headers, .svn, and CVS dirs
return skipscm(src) and os.path.basename(src) != 'Headers'
def create_appbundle(destdir, name, extension='.app', module=py2app.apptemplate,
platform='MacOS', copy=mergecopy, mergetree=mergetree,
condition=skipscm, plist={}, arch=None):
kw = module.plist_template.infoPlistDict(
plist.get('CFBundleExecutable', name), plist)
app = os.path.join(destdir, kw['CFBundleName'] + extension)
if os.path.exists(app):
# Remove any existing build artifacts to ensure that
# we're getting a clean build
shutil.rmtree(app)
contents = os.path.join(app, 'Contents')
resources = os.path.join(contents, 'Resources')
platdir = os.path.join(contents, platform)
dirs = [contents, resources, platdir]
plist = plistlib.Plist()
plist.update(kw)
plistPath = os.path.join(contents, 'Info.plist')
if os.path.exists(plistPath):
if plist != plistlib.Plist.fromFile(plistPath):