本文整理匯總了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)))