Common.py 文件源码

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

项目:torrench 作者: kryptxy 项目源码 文件源码
def copy_magnet(self, link):
        """Copy magnetic link to clipboard.

        This method is different from copylink_clipboard().
        This method handles the --copy argument.

        If --copy argument is supplied, magnetic link is copied to clipboard.
        """
        from torrench.Torrench import Torrench
        tr = Torrench()
        if tr.check_copy():
            try:
                pyperclip.copy(link)
                print("(Magnetic link copied to clipboard)")
            except Exception as e:
                print("(Unable to copy magnetic link to clipboard. Is [xclip] installed?)")
                print("(See logs for details)")
                self.logger.error(e)
        else:
            print("(use --copy to copy magnet to clipboard)")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号