def on_input_name(self, filename):
        if not filename:
            message = "FileName is required, do you want to try again?"
            if not sublime.ok_cancel_dialog(message, "Yes?"): return
            sublime.active_window().show_input_panel("Gist File Name: (Required)", 
                '', self.on_input_name, None, None)
            return

        data = {
            "files": {
                filename: {
                    "content": self.selection
                }
            }
        }

        settings = util.get_settings()
        api = GistApi(settings["token"])
        thread = threading.Thread(target=api.patch, args=(self.gist["url"], data, ))
        thread.start()

        description = self.gist["description"]
        if not description:
            description = "gist:%s" % self.gist["id"]
        ThreadProgress(api, thread, 'Adding %s to Gist %s' % (filename, description),
            callback.add_file_to_gist, _callback_options={
                "fileName": filename,
                "gistName": description
            }
        )
dataset/ETHPy150Open xjsender/HaoGist/main.py/AddFileToGist.on_input_name/original