frontend.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:gwot-physical 作者: JanVan01 项目源码 文件源码
def config_notifications_change(self, mode, nid):
        if mode == 'add' and 'module' not in request.args:
            if request.method == 'POST':
                filename = OS().upload_file('notifiers/', 'file')
            return self._get_module_chooser("Add Notification Service", "/config/notifications/add", "notifiers", "Notifier")

        data = {
            "edit": (mode == 'edit'),
            "mode": mode,
            "notifier": None,
            "notifier_impl": None,
            "notifier_module": None,
            "modules": OS().get_classes("notifiers", "Notifier")
        }
        if mode == 'edit' and nid is not None:
            notifier = Notifiers().get(nid)
            data['notifier'] = notifier
            data['notifier_module'] = notifier.get_classpath()
            data['notifier_impl'] = notifier.get_notifier_impl()
        elif mode == 'add':
            data['notifier_module'] = request.args.get('module')
            data['notifier_impl'] = OS().create_object(data['notifier_module'])

        return self.get_view('config_notifications_change.html').data(data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号