ramifice 0.5.6__py3-none-any.whl → 0.5.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,12 +28,18 @@ import gettext as _gettext
28
28
  from gettext import NullTranslations
29
29
  from typing import Any
30
30
 
31
+ from .errors import PanicError
32
+
31
33
  # Language code by default.
32
34
  DEFAULT_LOCALE: str = "en"
33
35
  # Code of current language.
34
36
  CURRENT_LOCALE: str = copy.deepcopy(DEFAULT_LOCALE)
35
37
  # List of codes supported by languages.
36
- LANGUAGES: list[str] = ["en", "ru"]
38
+ LANGUAGES: frozenset[str] = frozenset(("en", "ru"))
39
+
40
+ if not DEFAULT_LOCALE in LANGUAGES:
41
+ msg = "ERROR: DEFAULT_LOCALE is not included in the LANGUAGES!"
42
+ raise PanicError(msg)
37
43
 
38
44
  # Add translations for Ramifice.
39
45
  ramifice_translations: dict[str, NullTranslations] = {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ramifice
3
- Version: 0.5.6
3
+ Version: 0.5.8
4
4
  Summary: ORM-like API MongoDB for Python language.
5
5
  Project-URL: Homepage, https://github.com/kebasyaty/ramifice
6
6
  Project-URL: Documentation, https://kebasyaty.github.io/ramifice/
@@ -58,6 +58,7 @@ Description-Content-Type: text/markdown
58
58
  <a href="https://github.com/kebasyaty/ramifice/issues"><img src="https://img.shields.io/github/issues/kebasyaty/ramifice.svg" alt="GitHub issues"></a>
59
59
  <a href="https://pepy.tech/projects/ramifice"><img src="https://static.pepy.tech/badge/ramifice" alt="PyPI Downloads"></a>
60
60
  <a href="https://github.com/kebasyaty/ramifice/blob/main/LICENSE" alt="GitHub license"><img src="https://img.shields.io/github/license/kebasyaty/ramifice" alt="GitHub license"></a>
61
+ <a href="https://docs.astral.sh/ruff/" alt="Code style: Ruff"><img src="https://img.shields.io/badge/code%20style-Ruff-FDD835.svg" alt="Code style: Ruff"></a>
61
62
  <a href="https://github.com/kebasyaty/ramifice" alt="GitHub repository"><img src="https://img.shields.io/badge/--ecebeb?logo=github&logoColor=000000" alt="GitHub repository"></a>
62
63
  </p>
63
64
  <p align="center">
@@ -80,13 +81,6 @@ _Supports MongoDB 3.6, 4.0, 4.2, 4.4, 5.0, 6.0, 7.0, and 8.0._
80
81
  <br>
81
82
  _For more information see [PyMongo](https://pypi.org/project/pymongo/ "PyMongo")_.
82
83
 
83
- <p>
84
- <a href="https://github.com/kebasyaty/ramifice" alt="Project Status">
85
- <img src="https://raw.githubusercontent.com/kebasyaty/ramifice/v0/assets/project_status/project-status-beta.svg"
86
- alt="Project Status">
87
- </a>
88
- </p>
89
-
90
84
  ## Documentation
91
85
 
92
86
  Online browsable documentation is available at [https://kebasyaty.github.io/ramifice/](https://kebasyaty.github.io/ramifice/ "Documentation").
@@ -271,7 +265,7 @@ class User:
271
265
  password = self.password.value
272
266
  сonfirm_password = self.сonfirm_password.value
273
267
 
274
- if re.match(r"^[a-zA-Z0-9_]+$", username) is None: # type: ignore[arg-type]
268
+ if re.match(r"^[a-zA-Z0-9_]+$", username) is None:
275
269
  error_map["username"] = gettext("Allowed chars: %s") % "a-z A-Z 0-9 _"
276
270
 
277
271
  if id is None and (password != сonfirm_password):
@@ -72,14 +72,14 @@ ramifice/utils/fixtures.py,sha256=qsv9cg06lc82XaRlhI1j5vftmOQTTwOcDXCg_lnpK04,31
72
72
  ramifice/utils/globals.py,sha256=uR20um3Qg_1SG1t7WyWbpq8kQD-9Mslyr_c1yh5Hw9w,1751
73
73
  ramifice/utils/migration.py,sha256=kx1JX0xSgebtNtoTm_161_MqBw5kpsqCfIsc8wXYc34,11060
74
74
  ramifice/utils/tools.py,sha256=sOKzwnvf6vdTNf9r6PKAdw6aB4undat2Z8tzS3M1GnQ,2733
75
- ramifice/utils/translations.py,sha256=GNGE0ULAA0aOY5pTxUd3MQW-nVaKvp6BeXWEcsR0s0o,4048
75
+ ramifice/utils/translations.py,sha256=rnBoFC4sFuwX5DoWa1EL5MmkfXslbGrezdiwebJ5HUk,4233
76
76
  ramifice/utils/unit.py,sha256=R34gxriT67vI6PmjMIRftNsSP036jwbnsYjxt1Wma48,2454
77
77
  ramifice/utils/mixins/__init__.py,sha256=-UxYokZSlEaqoIs0aPVGtzK2CgN88mTzyhryHEtt0Yo,181
78
78
  ramifice/utils/mixins/add_valid.py,sha256=TLOObedzXNA9eCylfAVbVCqIKE5sV-P5AdIN7avj-GA,407
79
79
  ramifice/utils/mixins/hooks.py,sha256=33jvJRhfnJeL2Hd_YFXk3M_7wjqHaByU2wRjKyboL6s,914
80
80
  ramifice/utils/mixins/indexing.py,sha256=Z0427HoaVRyNmSNN8Fx0mSICgAKV-gDdu3iR5qYUEbs,329
81
81
  ramifice/utils/mixins/json_converter.py,sha256=WhigXyDAV-FfILaZuwvRFRIk0D90Rv3dG5t-mv5fVyc,1107
82
- ramifice-0.5.6.dist-info/METADATA,sha256=SD_A9wt9FJBVZbCc2dQJFhyp4JOBlN8XT5Q-UyADP7c,22536
83
- ramifice-0.5.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
- ramifice-0.5.6.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
85
- ramifice-0.5.6.dist-info/RECORD,,
82
+ ramifice-0.5.8.dist-info/METADATA,sha256=zaxbQjoDugoMSJd4tZESvDcUOgzkhEq0HGtAN_6yDJI,22441
83
+ ramifice-0.5.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
+ ramifice-0.5.8.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
85
+ ramifice-0.5.8.dist-info/RECORD,,