def notification_factory(app_names: list, **kwargs) -> BaseNotification:
    """返回对应系统的通知类"""
    os_type = get_os_type()
    os_notification = None
    if os_type == "mac":
        os_notification = MacNotification(app_names=app_names, **kwargs)
    elif os_type == "linux":
        sys_info = exec_cmd("uname -a")
        if "deepin" in sys_info:
            os_notification = DeepInNotification(app_names=app_names, **kwargs)
        else:
            exit(
                "examiner 暂时还不支持此系统,具体可点击:https://github.com/howie6879/examiner 进行反馈"
            )
    else:
        exit(
            "examiner 暂时还不支持此系统,具体可点击:https://github.com/howie6879/examiner 进行反馈"
        )
    return os_notification
Exemple #2
0
 def _get_db_path(self):
     # cmd = "lsof -p $(ps aux | grep -m1 usernoted | awk '{ print $2 }')| awk '{ print $9 }' | grep 'db2/db$' | xargs dirname"
     _, stdout = exec_cmd(self.db_cmd)
     db_path = os.path.join(stdout, "db")
     return db_path
 def _get_db_path(self):
     _, stdout = exec_cmd(self.db_cmd)
     return stdout