feat(subscription): add membership access preflight
This commit is contained in:
@@ -23,6 +23,7 @@ from .. import (
|
||||
image_studio_generation,
|
||||
image_studio_images,
|
||||
product_status,
|
||||
subscription,
|
||||
)
|
||||
from ..collect_skip import ALIAS_UNMATCHED, LOGIN_REQUIRED, empty_skip_reason_counts
|
||||
from .widgets import *
|
||||
@@ -34,6 +35,22 @@ _USER_LOG_PATH_RE = re.compile(
|
||||
)
|
||||
|
||||
|
||||
class SubscriptionCheckWorker(BaseWorker):
|
||||
"""Fetch the current cmshopee account subscription away from the GUI thread."""
|
||||
|
||||
def __init__(self, *, config=None, cmhub_config_path=None):
|
||||
super().__init__()
|
||||
self.config = config
|
||||
self.cmhub_config_path = cmhub_config_path
|
||||
|
||||
def execute(self):
|
||||
result = subscription.check_status(
|
||||
self.config,
|
||||
cmhub_config_path=self.cmhub_config_path,
|
||||
)
|
||||
return {"subscription": result}
|
||||
|
||||
|
||||
def _image_studio_step_label(step):
|
||||
return {
|
||||
"ensure_chrome": "准备账号浏览器",
|
||||
|
||||
Reference in New Issue
Block a user