summaryrefslogtreecommitdiff
path: root/scripts/dictcli.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-01-11 22:22:30 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-01-13 20:26:41 +0100
commitc970c6335521fee359c1a68c0431c612631e73fb (patch)
tree1062d9ffd9fbfcafc0753308b8e7a15a5f5f6920 /scripts/dictcli.py
parent4b7d52ae7cdf52ebef038b4a90b9fe95ab002105 (diff)
downloadqutebrowser-c970c6335521fee359c1a68c0431c612631e73fb.tar.gz
qutebrowser-c970c6335521fee359c1a68c0431c612631e73fb.zip
dataclasses: Initial switch
See #6023
Diffstat (limited to 'scripts/dictcli.py')
-rwxr-xr-xscripts/dictcli.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/dictcli.py b/scripts/dictcli.py
index 4e38727dd..7c575a641 100755
--- a/scripts/dictcli.py
+++ b/scripts/dictcli.py
@@ -31,8 +31,8 @@ import os
import sys
import re
import urllib.request
-
-import attr
+import dataclasses
+from typing import Optional
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
from qutebrowser.browser.webengine import spell
@@ -52,17 +52,17 @@ class InvalidLanguageError(Exception):
super().__init__(msg)
-@attr.s
+@dataclasses.dataclass
class Language:
"""Dictionary language specs."""
- code = attr.ib()
- name = attr.ib()
- remote_filename = attr.ib()
- local_filename = attr.ib(default=None)
+ code: str
+ name: str
+ remote_filename: str
+ local_filename: Optional[str] = None
- def __attrs_post_init__(self):
+ def __post_init__(self):
if self.local_filename is None:
self.local_filename = spell.local_filename(self.code)