imp_developer.py 文件源码

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

项目:ElectricImp-Sublime 作者: electricimp 项目源码 文件源码
def on_device_to_add_selected(self, index):
        # Selection was canceled, just return
        if index == -1:
            return

        model = self.env.tmp_model
        device_id = self.env.tmp_device_ids[index]

        response, code = HTTP.put(self.env.project_manager.get_build_api_key(),
                                  PL_BUILD_API_URL_V4 + "devices/" + device_id,
                                  '{"model_id": "' + model.get("id") + '"}')
        if not HTTP.is_response_code_valid(code):
            sublime.message_dialog(STR_MODEL_ADDING_DEVICE_FAILED)

        # Once the device is registered, select this device
        self.on_device_selected(index)

        sublime.message_dialog(STR_MODEL_IMP_REGISTERED)

        self.env.tmp_model = None
        self.env.tmp_device_ids = None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号