Complete commands

This commit is contained in:
Florian Bruhin 2014-04-22 15:19:18 +02:00
parent 1638823fb3
commit a87163b213

View File

@ -19,6 +19,8 @@
from PyQt5.QtGui import QColor from PyQt5.QtGui import QColor
import qutebrowser.commands.utils as cmdutils
class ValidationError(ValueError): class ValidationError(ValueError):
@ -398,21 +400,17 @@ class Command(BaseType):
"""Base class for a command value with arguments.""" """Base class for a command value with arguments."""
# FIXME we need to use this without having problems with circular imports.
typestr = 'command' typestr = 'command'
#valid_values = ValidValues(*cmdutils.cmd_dict.items())
def validate(self, value): def validate(self, value):
#from qutebrowser.commands.parsers import (CommandParser, if value.split()[0] not in cmdutils.cmd_dict:
# NoSuchCommandError) raise ValidationError(value, "must be a valid command!")
#cp = CommandParser()
#try: def complete(self):
# cp.parse(value) out = []
#except NoSuchCommandError: for cmdname, obj in cmdutils.cmd_dict.items():
# raise ValidationError(value, "must be a valid command!") out.append((cmdname, obj.desc))
pass return out
class CssColor(BaseType): class CssColor(BaseType):