diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-02-22 18:11:35 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-02-23 01:36:11 +0800 |
commit | 34704b2090c48d9ab9e7458475fd701a38706ae7 (patch) | |
tree | 2aff2885ecfbef32095daf205bf2ebb32a7f2c34 /services/manager/__init__.py | |
parent | 594691a66ceb00536e133ece321846f7ba49f881 (diff) | |
download | crupest-34704b2090c48d9ab9e7458475fd701a38706ae7.tar.gz crupest-34704b2090c48d9ab9e7458475fd701a38706ae7.tar.bz2 crupest-34704b2090c48d9ab9e7458475fd701a38706ae7.zip |
feat(services): refactor structure.
Diffstat (limited to 'services/manager/__init__.py')
-rw-r--r-- | services/manager/__init__.py | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/services/manager/__init__.py b/services/manager/__init__.py new file mode 100644 index 0000000..17799a9 --- /dev/null +++ b/services/manager/__init__.py @@ -0,0 +1,60 @@ +import sys + +from ._base import CRU, CruNamespaceError, CRU_NAME_PREFIXES +from ._error import ( + CruException, + CruLogicError, + CruInternalError, + CruUnreachableError, + cru_unreachable, +) +from ._const import ( + CruConstantBase, + CruDontChange, + CruNotFound, + CruNoValue, + CruPlaceholder, + CruUseDefault, +) +from ._func import CruFunction +from ._iter import CruIterable, CruIterator +from ._event import CruEvent, CruEventHandlerToken +from ._type import CruTypeSet, CruTypeCheckError + + +class CruInitError(CruException): + pass + + +def check_python_version(required_version=(3, 11)): + if sys.version_info < required_version: + raise CruInitError(f"Python version must be >= {required_version}!") + + +check_python_version() + +__all__ = [ + "CRU", + "CruNamespaceError", + "CRU_NAME_PREFIXES", + "check_python_version", + "CruException", + "CruInternalError", + "CruLogicError", + "CruUnreachableError", + "cru_unreachable", + "CruInitError", + "CruConstantBase", + "CruDontChange", + "CruNotFound", + "CruNoValue", + "CruPlaceholder", + "CruUseDefault", + "CruFunction", + "CruIterable", + "CruIterator", + "CruEvent", + "CruEventHandlerToken", + "CruTypeSet", + "CruTypeCheckError", +] |