setup.py 文件源码

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

项目:tsaotun 作者: qazbnm456 项目源码 文件源码
def run(self):
        install.run(self)
        print "Installing auto completion of tsaotun to",
        src = os.path.join(ROOT_DIR, 'completion', 'tsaotun')
        sys = platform.system()
        try:
            if sys == 'Darwin':
                dest = os.path.join(
                    os.popen('brew --prefix').read()[:-1], 'etc', 'bash_completion.d', 'tsaotun')
                print dest
                shutil.copy(src, dest)
            elif sys == 'Linux':
                dest = os.path.join(
                    '/etc', 'bash_completion.d', 'tsaotun')
                print dest
                shutil.copy(src, dest)
            else:  # Windows, etc.
                print "... \n Warning: {} is currently not supported. Skipped.".format(sys)
        except IOError:
            print "Permission denied: You probably want to copy '{}' to '{}' manually.".format(src, dest)
        print "Tsaotun is installed successfully."
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号