setup.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:docgen 作者: jpwarren 项目源码 文件源码
def copy_scripts(self):
        """
        Override the default distutils copy_scripts to
        call replace_tags if it's marked as a Python
        script.
        """
        self.mkpath(self.build_dir)
        outfiles = []
        for script in self.scripts:
            adjust = 0
            script = convert_path(script)
            outfile = os.path.join(self.build_dir, os.path.basename(script))
            outfiles.append(outfile)

            if not self.force and not newer(script, outfile):
                log.debug("not copying %s (up-to-date)", script)
                continue

            self.copy_file(script, outfile, self.dry_run)

        if os.name == 'posix':
            for file in outfiles:
                if self.dry_run:
                    log.info("changing mode of %s", file)
                else:
                    oldmode = os.stat(file)[ST_MODE] & 07777
                    newmode = (oldmode | 0555) & 07777
                    if newmode != oldmode:
                        log.info("changing mode of %s from %o to %o",
                                 file, oldmode, newmode)
                        os.chmod(file, newmode)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号