# -*-coding:utf-8 -*-
import json
import os
from appManager.module.global_api import ComponentHelper

DIR_PATH = os.path.split(os.path.realpath(__file__))[0]
BASE_PATH = os.path.split(DIR_PATH)[0]


# 组件停止脚本
def stop():
    with open(os.path.join(BASE_PATH, "package.json"), "r+") as f:
        pkgConfig = json.load(f)
    app_name = pkgConfig["name"]
    componentHelper = ComponentHelper(app_name)
    # 调用组件管理接口停用任务
    componentHelper.stop_task()


if __name__ == '__main__':
    stop()
