-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move deprecation warning to constructor
The class is always defined and that is not really reason to emit the warning.
- Loading branch information
Showing
1 changed file
with
12 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
# Copyright © Michal Čihař <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
from __future__ import annotations | ||
|
||
import warnings | ||
from typing import TYPE_CHECKING | ||
|
||
from django.utils.translation import gettext_lazy | ||
|
||
from weblate.addons.base import BaseAddon | ||
from weblate.addons.events import AddonEvent | ||
from weblate.addons.tasks import language_consistency | ||
|
||
if TYPE_CHECKING: | ||
from weblate.addons.models import Addon | ||
|
||
|
||
class LanguageConsistencyAddon(BaseAddon): | ||
events: set[AddonEvent] = {AddonEvent.EVENT_DAILY, AddonEvent.EVENT_POST_ADD} | ||
|
@@ -40,8 +45,10 @@ def post_add(self, translation) -> None: | |
|
||
|
||
class LangaugeConsistencyAddon(LanguageConsistencyAddon): | ||
warnings.warn( | ||
"LangaugeConsistencyAddon is deprecated, use LanguageConsistencyAddon", | ||
DeprecationWarning, | ||
stacklevel=1, | ||
) | ||
def __init__(self, storage: Addon) -> None: | ||
super().__init__(storage) | ||
warnings.warn( | ||
"LangaugeConsistencyAddon is deprecated, use LanguageConsistencyAddon", | ||
DeprecationWarning, | ||
stacklevel=1, | ||
) |