Style fixes
This commit is contained in:
parent
6d9f04355c
commit
fd9a5fa334
@ -31,8 +31,10 @@ import sys
|
|||||||
import re
|
import re
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
|
|
||||||
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
|
||||||
from qutebrowser.browser.webengine import spell
|
from qutebrowser.browser.webengine import spell
|
||||||
from qutebrowser.config import configdata
|
from qutebrowser.config import configdata
|
||||||
|
|
||||||
@ -41,15 +43,17 @@ API_URL = 'https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries
|
|||||||
|
|
||||||
|
|
||||||
class InvalidLanguageError(Exception):
|
class InvalidLanguageError(Exception):
|
||||||
"""Raised when requested invalid languages."""
|
|
||||||
|
"""Raised when requesting invalid languages."""
|
||||||
|
|
||||||
def __init__(self, invalid_langs):
|
def __init__(self, invalid_langs):
|
||||||
msg = 'invalid languages: {}'.format(', '.join(invalid_langs))
|
msg = 'invalid languages: {}'.format(', '.join(invalid_langs))
|
||||||
super(InvalidLanguageError, self).__init__(msg)
|
super().__init__(msg)
|
||||||
|
|
||||||
|
|
||||||
@attr.s
|
@attr.s
|
||||||
class Language:
|
class Language:
|
||||||
|
|
||||||
"""Dictionary language specs."""
|
"""Dictionary language specs."""
|
||||||
|
|
||||||
code = attr.ib(None)
|
code = attr.ib(None)
|
||||||
@ -161,6 +165,7 @@ def install(languages):
|
|||||||
install_lang(lang)
|
install_lang(lang)
|
||||||
except PermissionError as e:
|
except PermissionError as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -551,4 +551,4 @@ Feature: Various utility commands.
|
|||||||
@qtwebkit_skip @qt>=5.8 @must_have_dict=en-US
|
@qtwebkit_skip @qt>=5.8 @must_have_dict=en-US
|
||||||
Scenario: Set valid and installed language
|
Scenario: Set valid and installed language
|
||||||
When I run :set spellcheck.languages ["en-US"]
|
When I run :set spellcheck.languages ["en-US"]
|
||||||
Then the option spellcheck.languages should be set to ["en-US"]
|
Then the option spellcheck.languages should be set to ["en-US"]
|
||||||
|
Loading…
Reference in New Issue
Block a user