fix: auto-fix code issues (cron)
- 修复重复导入/字段 - 修复异常处理 - 修复PEP8格式问题 - 添加类型注解
This commit is contained in:
@@ -35,7 +35,6 @@ except ImportError:
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class LanguageCode(StrEnum):
|
||||
"""支持的语言代码"""
|
||||
|
||||
@@ -52,7 +51,6 @@ class LanguageCode(StrEnum):
|
||||
AR = "ar"
|
||||
HI = "hi"
|
||||
|
||||
|
||||
class RegionCode(StrEnum):
|
||||
"""区域代码"""
|
||||
|
||||
@@ -64,7 +62,6 @@ class RegionCode(StrEnum):
|
||||
LATIN_AMERICA = "latam"
|
||||
MIDDLE_EAST = "me"
|
||||
|
||||
|
||||
class DataCenterRegion(StrEnum):
|
||||
"""数据中心区域"""
|
||||
|
||||
@@ -78,7 +75,6 @@ class DataCenterRegion(StrEnum):
|
||||
CN_NORTH = "cn-north"
|
||||
CN_EAST = "cn-east"
|
||||
|
||||
|
||||
class PaymentProvider(StrEnum):
|
||||
"""支付提供商"""
|
||||
|
||||
@@ -95,7 +91,6 @@ class PaymentProvider(StrEnum):
|
||||
SEPA = "sepa"
|
||||
UNIONPAY = "unionpay"
|
||||
|
||||
|
||||
class CalendarType(StrEnum):
|
||||
"""日历类型"""
|
||||
|
||||
@@ -107,7 +102,6 @@ class CalendarType(StrEnum):
|
||||
PERSIAN = "persian"
|
||||
BUDDHIST = "buddhist"
|
||||
|
||||
|
||||
@dataclass
|
||||
class Translation:
|
||||
id: str
|
||||
@@ -122,7 +116,6 @@ class Translation:
|
||||
reviewed_by: str | None
|
||||
reviewed_at: datetime | None
|
||||
|
||||
|
||||
@dataclass
|
||||
class LanguageConfig:
|
||||
code: str
|
||||
@@ -140,7 +133,6 @@ class LanguageConfig:
|
||||
first_day_of_week: int
|
||||
calendar_type: str
|
||||
|
||||
|
||||
@dataclass
|
||||
class DataCenter:
|
||||
id: str
|
||||
@@ -155,7 +147,6 @@ class DataCenter:
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
@dataclass
|
||||
class TenantDataCenterMapping:
|
||||
id: str
|
||||
@@ -167,7 +158,6 @@ class TenantDataCenterMapping:
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
@dataclass
|
||||
class LocalizedPaymentMethod:
|
||||
id: str
|
||||
@@ -185,7 +175,6 @@ class LocalizedPaymentMethod:
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
@dataclass
|
||||
class CountryConfig:
|
||||
code: str
|
||||
@@ -207,7 +196,6 @@ class CountryConfig:
|
||||
vat_rate: float | None
|
||||
is_active: bool
|
||||
|
||||
|
||||
@dataclass
|
||||
class TimezoneConfig:
|
||||
id: str
|
||||
@@ -218,7 +206,6 @@ class TimezoneConfig:
|
||||
region: str
|
||||
is_active: bool
|
||||
|
||||
|
||||
@dataclass
|
||||
class CurrencyConfig:
|
||||
code: str
|
||||
@@ -230,7 +217,6 @@ class CurrencyConfig:
|
||||
thousands_separator: str
|
||||
is_active: bool
|
||||
|
||||
|
||||
@dataclass
|
||||
class LocalizationSettings:
|
||||
id: str
|
||||
@@ -250,7 +236,6 @@ class LocalizationSettings:
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
class LocalizationManager:
|
||||
DEFAULT_LANGUAGES = {
|
||||
LanguageCode.EN: {
|
||||
@@ -1698,10 +1683,8 @@ class LocalizationManager:
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
_localization_manager = None
|
||||
|
||||
|
||||
def get_localization_manager(db_path: str = "insightflow.db") -> LocalizationManager:
|
||||
global _localization_manager
|
||||
if _localization_manager is None:
|
||||
|
||||
Reference in New Issue
Block a user