本文整理汇总了Python中ranger.gui.colorscheme.get_all_colorschemes方法的典型用法代码示例。如果您正苦于以下问题:Python colorscheme.get_all_colorschemes方法的具体用法?Python colorscheme.get_all_colorschemes怎么用?Python colorscheme.get_all_colorschemes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ranger.gui.colorscheme
的用法示例。
在下文中一共展示了colorscheme.get_all_colorschemes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tab
# 需要导入模块: from ranger.gui import colorscheme [as 别名]
# 或者: from ranger.gui.colorscheme import get_all_colorschemes [as 别名]
def tab(self, tabnum):
from ranger.gui.colorscheme import get_all_colorschemes
name, value, name_done = self.parse_setting_line()
settings = self.fm.settings
if not name:
return sorted(self.firstpart + setting for setting in settings)
if not value and not name_done:
return sorted(self.firstpart + setting for setting in settings
if setting.startswith(name))
if not value:
# Cycle through colorschemes when name, but no value is specified
if name == "colorscheme":
return sorted(self.firstpart + colorscheme for colorscheme
in get_all_colorschemes())
return self.firstpart + str(settings[name])
if bool in settings.types_of(name):
if 'true'.startswith(value.lower()):
return self.firstpart + 'True'
if 'false'.startswith(value.lower()):
return self.firstpart + 'False'
# Tab complete colorscheme values if incomplete value is present
if name == "colorscheme":
return sorted(self.firstpart + colorscheme for colorscheme
in get_all_colorschemes() if colorscheme.startswith(value))
示例2: tab
# 需要导入模块: from ranger.gui import colorscheme [as 别名]
# 或者: from ranger.gui.colorscheme import get_all_colorschemes [as 别名]
def tab(self, tabnum):
from ranger.gui.colorscheme import get_all_colorschemes
name, value, name_done = self.parse_setting_line()
settings = self.fm.settings
if not name:
return sorted(self.firstpart + setting for setting in settings)
if not value and not name_done:
return sorted(self.firstpart + setting for setting in settings \
if setting.startswith(name))
if not value:
# Cycle through colorschemes when name, but no value is specified
if name == "colorscheme":
return sorted(self.firstpart + colorscheme for colorscheme \
in get_all_colorschemes())
return self.firstpart + str(settings[name])
if bool in settings.types_of(name):
if 'true'.startswith(value.lower()):
return self.firstpart + 'True'
if 'false'.startswith(value.lower()):
return self.firstpart + 'False'
# Tab complete colorscheme values if incomplete value is present
if name == "colorscheme":
return sorted(self.firstpart + colorscheme for colorscheme \
in get_all_colorschemes() if colorscheme.startswith(value))
示例3: tab
# 需要导入模块: from ranger.gui import colorscheme [as 别名]
# 或者: from ranger.gui.colorscheme import get_all_colorschemes [as 别名]
def tab(self):
from ranger.gui.colorscheme import get_all_colorschemes
name, value, name_done = self.parse_setting_line()
settings = self.fm.settings
if not name:
return sorted(self.firstpart + setting for setting in settings)
if not value and not name_done:
return (self.firstpart + setting for setting in settings \
if setting.startswith(name))
if not value:
# Cycle through colorschemes when name, but no value is specified
if name == "colorscheme":
return (self.firstpart + colorscheme for colorscheme \
in get_all_colorschemes())
return self.firstpart + str(settings[name])
if bool in settings.types_of(name):
if 'true'.startswith(value.lower()):
return self.firstpart + 'True'
if 'false'.startswith(value.lower()):
return self.firstpart + 'False'
# Tab complete colorscheme values if incomplete value is present
if name == "colorscheme":
return (self.firstpart + colorscheme for colorscheme \
in get_all_colorschemes() if colorscheme.startswith(value))