当前位置: 首页>>代码示例>>Python>>正文


Python FileSystemObject.linemode_dict方法代码示例

本文整理汇总了Python中ranger.container.fsobject.FileSystemObject.linemode_dict方法的典型用法代码示例。如果您正苦于以下问题:Python FileSystemObject.linemode_dict方法的具体用法?Python FileSystemObject.linemode_dict怎么用?Python FileSystemObject.linemode_dict使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ranger.container.fsobject.FileSystemObject的用法示例。


在下文中一共展示了FileSystemObject.linemode_dict方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: execute

# 需要导入模块: from ranger.container.fsobject import FileSystemObject [as 别名]
# 或者: from ranger.container.fsobject.FileSystemObject import linemode_dict [as 别名]
def execute(self):
        import re
        from ranger.container.fsobject import FileSystemObject

        if len(self.args) < 2:
            self.fm.notify("Usage: default_linemode [path=<regexp> | tag=<tag(s)>] <linemode>", bad=True)

        # Extract options like "path=..." or "tag=..." from the command line
        arg1 = self.arg(1)
        method = "always"
        argument = None
        if arg1.startswith("path="):
            method = "path"
            argument = re.compile(arg1[5:])
            self.shift()
        elif arg1.startswith("tag="):
            method = "tag"
            argument = arg1[4:]
            self.shift()

        # Extract and validate the line mode from the command line
        linemode = self.rest(1)
        if linemode not in FileSystemObject.linemode_dict:
            self.fm.notify("Invalid linemode: %s; should be %s" %
                    (linemode, "/".join(FileSystemObject.linemode_dict)), bad=True)

        # Add the prepared entry to the fm.default_linemodes
        entry = [method, argument, linemode]
        self.fm.default_linemodes.appendleft(entry)

        # Redraw the columns
        if hasattr(self.fm.ui, "browser"):
            for col in self.fm.ui.browser.columns:
                col.need_redraw = True 
开发者ID:GuidoFe,项目名称:myDotFiles,代码行数:36,代码来源:commands_full.py

示例2: tab

# 需要导入模块: from ranger.container.fsobject import FileSystemObject [as 别名]
# 或者: from ranger.container.fsobject.FileSystemObject import linemode_dict [as 别名]
def tab(self, tabnum):
        mode = self.arg(1)
        return (self.arg(0) + " " + linemode
                for linemode in self.fm.thisfile.linemode_dict.keys()
                if linemode.startswith(self.arg(1))) 
开发者ID:GuidoFe,项目名称:myDotFiles,代码行数:7,代码来源:commands_full.py

示例3: tab

# 需要导入模块: from ranger.container.fsobject import FileSystemObject [as 别名]
# 或者: from ranger.container.fsobject.FileSystemObject import linemode_dict [as 别名]
def tab(self):
        mode = self.arg(1)
        return (self.arg(0) + " " + linemode
                for linemode in self.fm.thisfile.linemode_dict.keys()
                if linemode.startswith(self.arg(1))) 
开发者ID:quanttyo,项目名称:dotfiles,代码行数:7,代码来源:commands_full.py


注:本文中的ranger.container.fsobject.FileSystemObject.linemode_dict方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。