commands_full.py 文件源码

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

项目:myDotFiles 作者: GuidoFe 项目源码 文件源码
def execute(self):
        mode = self.rest(1)
        if not mode:
            mode = str(self.quantifier)

        try:
            mode = int(mode, 8)
            if mode < 0 or mode > 0o777:
                raise ValueError
        except ValueError:
            self.fm.notify("Need an octal number between 0 and 777!", bad=True)
            return

        for file in self.fm.thistab.get_selection():
            try:
                os.chmod(file.path, mode)
            except Exception as ex:
                self.fm.notify(ex)

        try:
            # reloading directory.  maybe its better to reload the selected
            # files only.
            self.fm.thisdir.load_content()
        except Exception:
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号