def copy(self, destdir): for x in self.used: if x._freeze_usable: eggutil.copyDistribution(x, destdir) else: try: path = x._provider.path except AttributeError: print "Warning: cannot copy egg-info for", x continue print "Copying egg-info of %s from %r" % (x, path) shutil.copy2(path, destdir)
def copy(self, destdir): for x in self.used: if x._freeze_usable: eggutil.copyDistribution(x, destdir) else: try: path = getattr(x._provider, "egg_info", None) or x._provider.path except AttributeError: print "Warning: cannot copy egg-info for", x continue print "Copying egg-info of %s from %r" % (x, path) if os.path.isdir(path): basename = "%s.egg-info" % x.project_name shutil.copytree(path, os.path.join(destdir, basename)) else: shutil.copy2(path, destdir)