Blame view

translation/__init__.py 714 Bytes
5e4dc8e4   tangwang   翻译架构按“一个翻译服务 +
1
2
  """Translation package."""
  
0fd2f875   tangwang   translate
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  from __future__ import annotations
  
  from typing import Any
  
  __all__ = ["TranslationServiceClient", "create_translation_client", "TranslationService"]
  
  
  def __getattr__(name: str) -> Any:
      if name in {"TranslationServiceClient", "create_translation_client"}:
          from .client import TranslationServiceClient, create_translation_client
  
          exports = {
              "TranslationServiceClient": TranslationServiceClient,
              "create_translation_client": create_translation_client,
          }
          return exports[name]
      if name == "TranslationService":
          from .service import TranslationService
  
          return TranslationService
      raise AttributeError(name)