Beispiel #1
0
 def iter_data_files(self):
     dist = self.distribution
     allres = chain(getattr(dist, 'data_files', ()) or (), self.resources)
     for (path, files) in imap(normalize_data_file, allres):
         path = fsencoding(path)
         for fn in files:
             fn = fsencoding(fn)
             yield fn, os.path.join(path, os.path.basename(fn))
Beispiel #2
0
 def iter_data_files(self):
     dist = self.distribution
     allres = chain(getattr(dist, 'data_files', ()) or (), self.resources)
     for (path, files) in imap(normalize_data_file, allres):
         path = fsencoding(path)
         for fn in files:
             fn = fsencoding(fn)
             yield fn, os.path.join(path, os.path.basename(fn))
Beispiel #3
0
 def iter_mappingmodels(self, resdir):
     for (path, files) in imap(normalize_data_file, self.mappingmodels or ()):
         path = fsencoding(path)
         for fn in files:
             fn = fsencoding(fn)
             basefn, ext = os.path.splitext(fn)
             if ext != '.xcmappingmodel':
                 basefn = fn
                 fn += '.xcmappingmodel'
             destfn = os.path.basename(basefn) + '.cdm'
             yield fn, os.path.join(resdir, path, destfn)
Beispiel #4
0
 def iter_datamodels(self, resdir):
     for (path, files) in imap(normalize_data_file, self.datamodels or ()):
         path = fsencoding(path)
         for fn in files:
             fn = fsencoding(fn)
             basefn, ext = os.path.splitext(fn)
             if ext != '.xcdatamodel':
                 basefn = fn
                 fn += '.xcdatamodel'
             destfn = os.path.basename(basefn) + '.mom'
             yield fn, os.path.join(resdir, path, destfn)
Beispiel #5
0
 def create_pluginbundle(self, target, script, use_runtime_preference=True):
     base = target.get_dest_base()
     appdir = os.path.join(self.dist_dir, os.path.dirname(base))
     appname = self.get_appname()
     print "*** creating plugin bundle: %s ***" % (appname,)
     if self.runtime_preferences and use_runtime_preference:
         self.plist.setdefault(
             'PyRuntimeLocations', self.runtime_preferences)
     appdir, plist = create_pluginbundle(
         appdir,
         appname,
         plist=self.plist,
         extension=self.extension,
     )
     appdir = fsencoding(appdir)
     resdir = os.path.join(appdir, 'Contents', 'Resources')
     return appdir, resdir, plist
Beispiel #6
0
 def create_pluginbundle(self, target, script, use_runtime_preference=True):
     base = target.get_dest_base()
     appdir = os.path.join(self.dist_dir, os.path.dirname(base))
     appname = self.get_appname()
     print "*** creating plugin bundle: %s ***" % (appname, )
     if self.runtime_preferences and use_runtime_preference:
         self.plist.setdefault('PyRuntimeLocations',
                               self.runtime_preferences)
     appdir, plist = create_pluginbundle(
         appdir,
         appname,
         plist=self.plist,
         extension=self.extension,
     )
     appdir = fsencoding(appdir)
     resdir = os.path.join(appdir, 'Contents', 'Resources')
     return appdir, resdir, plist
Beispiel #7
0
 def create_appbundle(self, target, script, use_runtime_preference=True):
     base = target.get_dest_base()
     appdir = os.path.join(self.dist_dir, os.path.dirname(base))
     appname = self.get_appname()
     print "*** creating application bundle: %s ***" % (appname, )
     if self.runtime_preferences and use_runtime_preference:
         self.plist.setdefault('PyRuntimeLocations',
                               self.runtime_preferences)
     pythonInfo = self.plist.setdefault(u'PythonInfoDict', {})
     py2appInfo = pythonInfo.setdefault(u'py2app', {}).update(
         dict(alias=bool(self.alias), ))
     appdir, plist = create_appbundle(
         appdir,
         appname,
         plist=self.plist,
         extension=self.extension,
     )
     appdir = fsencoding(appdir)
     resdir = os.path.join(appdir, 'Contents', 'Resources')
     return appdir, resdir, plist
Beispiel #8
0
 def create_appbundle(self, target, script, use_runtime_preference=True):
     base = target.get_dest_base()
     appdir = os.path.join(self.dist_dir, os.path.dirname(base))
     appname = self.get_appname()
     print "*** creating application bundle: %s ***" % (appname,)
     if self.runtime_preferences and use_runtime_preference:
         self.plist.setdefault(
             'PyRuntimeLocations', self.runtime_preferences)
     pythonInfo = self.plist.setdefault(u'PythonInfoDict', {})
     py2appInfo = pythonInfo.setdefault(u'py2app', {}).update(dict(
         alias=bool(self.alias),
     ))
     appdir, plist = create_appbundle(
         appdir,
         appname,
         plist=self.plist,
         extension=self.extension,
     )
     appdir = fsencoding(appdir)
     resdir = os.path.join(appdir, 'Contents', 'Resources')
     return appdir, resdir, plist