Skip to content

Commit

Permalink
base: Set limit for LRU cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mufeedali committed Feb 12, 2024
1 parent 26eeb0c commit 0ef75dc
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Development Lead

* Mufeed Ali <mufeed[email protected]>
* Mufeed Ali <mufeed@kumo.foo>

## Contributors

Expand Down
2 changes: 1 addition & 1 deletion data/dev.mufeed.Wordbook.metainfo.xml.in.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</description>

<developer_name>Mufeed Ali</developer_name>
<update_contact>mufeed[email protected]</update_contact>
<update_contact>mufeed@kumo.foo</update_contact>

<url type="homepage">https://github.com/mufeedali/Wordbook</url>
<url type="bugtracker">https://github.com/mufeedali/Wordbook/issues</url>
Expand Down
2 changes: 1 addition & 1 deletion wordbook/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed[email protected]>
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed@kumo.foo>
# SPDX-License-Identifier: GPL-3.0-or-later

"""Top-level package for wordbook. Empty because everything is in sub-modules."""
4 changes: 2 additions & 2 deletions wordbook/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed[email protected]>
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed@kumo.foo>
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Expand Down Expand Up @@ -244,7 +244,7 @@ def get_fortune(mono=True):
return fortune_out


@lru_cache(maxsize=None)
@lru_cache(maxsize=128)
def get_pronunciation(term, accent="us"):
"""Get the pronunciation from espeak and process it."""
try:
Expand Down
2 changes: 1 addition & 1 deletion wordbook/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed[email protected]>
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed@kumo.foo>
# SPDX-License-Identifier: GPL-3.0-or-later

import gi
Expand Down
2 changes: 1 addition & 1 deletion wordbook/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed[email protected]>
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed@kumo.foo>
# SPDX-License-Identifier: GPL-3.0-or-later

import configparser
Expand Down
2 changes: 1 addition & 1 deletion wordbook/settings_window.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed[email protected]>
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed@kumo.foo>
# SPDX-License-Identifier: GPL-3.0-or-later

import os
Expand Down
2 changes: 1 addition & 1 deletion wordbook/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed[email protected]>
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed@kumo.foo>
# SPDX-License-Identifier: GPL-3.0-or-later

"""utils contains a few global variables and essential functions."""
Expand Down
5 changes: 3 additions & 2 deletions wordbook/window.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed[email protected]>
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed@kumo.foo>
# SPDX-License-Identifier: GPL-3.0-or-later

import os
Expand Down Expand Up @@ -47,7 +47,7 @@ class WordbookWindow(Adw.ApplicationWindow):

_style_manager: Adw.StyleManager | None = None

_wn_downloader = base.WordnetDownloader()
_wn_downloader: base.WordnetDownloader = base.WordnetDownloader()
_wn_future = None

_doubled = False
Expand Down Expand Up @@ -84,6 +84,7 @@ def setup_widgets(self):
self._def_ctrlr.connect("pressed", self._on_def_press_event)
self._def_ctrlr.connect("stopped", self._on_def_stop_event)
self._def_view.connect("activate-link", self._on_link_activated)

self.search_button.connect("clicked", self.on_search_clicked)
self._search_entry.connect("changed", self._on_entry_changed)
self._speak_button.connect("clicked", self._on_speak_clicked)
Expand Down
2 changes: 1 addition & 1 deletion wordbook/wordbook.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!@PYTHON@

# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed[email protected]>
# SPDX-FileCopyrightText: 2016-2024 Mufeed Ali <mufeed@kumo.foo>
# SPDX-License-Identifier: GPL-3.0-or-later

import gettext
Expand Down

0 comments on commit 0ef75dc

Please sign in to comment.