Exemplo n.º 1
0
 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))
Exemplo n.º 2
0
    def tab(self, tabnum):  # pylint: disable=too-many-return-statements

        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(self.fm))
            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(self.fm)
                          if colorscheme.startswith(value))
Exemplo n.º 3
0
 def tab(self, tabnum):  # pylint: disable=too-many-return-statements
     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(self.fm))
         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(self.fm) if colorscheme.startswith(value))