本文整理汇总了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
示例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)))
示例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)))