python类askokcancel()的实例源码

GUI.py 文件源码 项目:bemoss_gui2.1 作者: bemoss 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def detect_bemoss(self):
        cwd = os.getcwd()
        ui_path = cwd.replace('bemoss_gui','bemoss_web_ui')
        cassandra_path = cwd.replace('bemoss_gui','cassandra')
        env_path = cwd.replace('bemoss_gui','bemoss_os/env/bin')
        bemoss_is_installed = os.path.isdir(ui_path) and os.path.isdir(cassandra_path) and os.path.isdir(env_path)

        if bemoss_is_installed is False:
            tmp = tkMessageBox.askokcancel(title='Please install BEMOSS at first',
                                           message='You computer does not have BEMOSS installed, do you want to install BEMOSS right now?',
                                           parent=root)
            if tmp is True:
                self.install_bemoss()
                return
            else:
                return False
        else:
            return True
Keynote.py 文件源码 项目:chessboard_Chinese-chess 作者: JiNianLuo 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def file_window(self):
        file_name = askopenfilename(parent=self.root, title='????', \
                                    filetypes=[('FEN Records', '*.fen'), ('Text Files', '*.txt'), ('All Files', '*.*')],
                                    initialdir='Resourses/', \
                                    initialfile='example.fen')
        # self.file = open(file_name, 'r')
        # self.play()
        # '''
        try:
            self.file = open(file_name, 'r')
            self.play()
        except IOError:
            if askokcancel('?????', '???????'):
                self.file_window()
            else:
                self.root.destroy()
                # '''
Keynote.py 文件源码 项目:chessboard_Chinese-chess 作者: JiNianLuo 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def file_window(self):
        file_name = askopenfilename(parent=self.root, title='????', \
                                    filetypes=[('FEN Records', '*.fen'), ('Text Files', '*.txt'), ('All Files', '*.*')],
                                    initialdir='Resourses/', \
                                    initialfile='example.fen')
        # self.file = open(file_name, 'r')
        # self.play()
        # '''
        try:
            self.file = open(file_name, 'r')
            self.play()
        except IOError:
            if askokcancel('?????', '???????'):
                self.file_window()
            else:
                self.root.destroy()
                # '''
appjar.py 文件源码 项目:SceneDensity 作者: ImOmid 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def okBox(self, title, message):
        self.topLevel.update_idletasks()
        return MessageBox.askokcancel(title, message)
recipe-578568.py 文件源码 项目:code 作者: ActiveState 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def quit(self):
        ans = askokcancel('Verify exit', "Really quit?")
        if ans: Frame.quit(self)
appjar.py 文件源码 项目:Cryptokey_Generator 作者: 8BitCookie 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def okBox(self, title, message):
        self.topLevel.update_idletasks()
        return MessageBox.askokcancel(title, message)
gui.py 文件源码 项目:nao_slam_amcl 作者: hu7241 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def MsgBox(title, text, style):
    box = [
        msg.showinfo,       msg.showwarning,    msg.showerror,
        msg.askquestion,    msg.askyesno,       msg.askokcancel,        msg.askretrycancel,
    ];
    tk.Tk().withdraw(); #Hide Main Window.
    if style in range(7):
        return box[style](title, text)
gui.py 文件源码 项目:nao_slam_amcl 作者: hu7241 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def on_closing():
    if msg.askokcancel("Warning", "Do you want to quit?"):
        background.destroy()
        rospy.signal_shutdown("")
gui.py 文件源码 项目:nao_slam_amcl 作者: hu7241 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def MsgBox(title, text, style):
    box = [
        msg.showinfo,       msg.showwarning,    msg.showerror,
        msg.askquestion,    msg.askyesno,       msg.askokcancel,        msg.askretrycancel,
    ];
    tk.Tk().withdraw(); #Hide Main Window.
    if style in range(7):
        return box[style](title, text)
spgl.py 文件源码 项目:SPGL 作者: wynand1004 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def ask_ok_cancel(self, title, message):
        return messagebox.askokcancel(title, message)
spgl.py 文件源码 项目:SPGL 作者: wynand1004 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def ask_ok_cancel(self, title, message):
        return messagebox.askokcancel(title, message)
heartbreaker.py 文件源码 项目:heartbreaker 作者: lokori 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def ask_quit():
    global proc
    if tkMessageBox.askokcancel("Quit", "You want to leave me? *sniff*"):
        try:
            proc.terminate()
        except:
            pass
        sys.exit()
        #root.destroy()

#-----------------------------------------
k40_whisperer.py 文件源码 项目:K40-Whisperer 作者: jkramarz 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def message_ask_ok_cancel(title, mess):
    if VERSION == 3:
        result=tkinter.messagebox.askokcancel(title, mess)
    else:
        result=tkMessageBox.askokcancel(title, mess)
    return result


################################################################################
#                          Startup Application                                 #
################################################################################
edit.py 文件源码 项目:Circadia 作者: hooyah 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def menu_newTheme(self):
        """ callback for new_theme menu item """

        sure = tkMessageBox.askokcancel(title='New Theme', message='sure?')
        if sure:
            self.newTheme()
edit.py 文件源码 项目:Circadia 作者: hooyah 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def menu_loadTheme(self):
        """ callback for load_theme menu item """

        newTheme = tkFileDialog.askopenfilename(initialdir=self.themeRootPath, filetypes=[('Theme', '*.json')], title='Open Theme')
        if newTheme and not newTheme.startswith(self.themeRootPath):
            tkMessageBox.showerror(message='Theme not in root folder: '+self.themeRootPath)
            print newTheme, self.themeRootPath
            return

        if not newTheme or (self.theme and not tkMessageBox.askokcancel(title='Loading theme', message='current theme will be lost. continue?')):
            return

        pathname, filename = os.path.split(newTheme)
        basename, themename = os.path.split(pathname)
        self.loadTheme(themename)
PyShell.py 文件源码 项目:oil 作者: oilshell 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def close(self):
        "Extend EditorWindow.close()"
        if self.executing:
            response = tkMessageBox.askokcancel(
                "Kill?",
                "Your program is still running!\n Do you want to kill it?",
                default="ok",
                parent=self.text)
            if response is False:
                return "cancel"
        self.stop_readline()
        self.canceled = True
        self.closing = True
        return EditorWindow.close(self)
ScriptBinding.py 文件源码 项目:oil 作者: oilshell 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def ask_save_dialog(self):
        msg = "Source Must Be Saved\n" + 5*' ' + "OK to Save?"
        confirm = tkMessageBox.askokcancel(title="Save Before Run or Check",
                                           message=msg,
                                           default=tkMessageBox.OK,
                                           parent=self.editwin.text)
        return confirm
PyShell.py 文件源码 项目:python2-tracer 作者: extremecoders-re 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def close(self):
        "Extend EditorWindow.close()"
        if self.executing:
            response = tkMessageBox.askokcancel(
                "Kill?",
                "Your program is still running!\n Do you want to kill it?",
                default="ok",
                parent=self.text)
            if response is False:
                return "cancel"
        self.stop_readline()
        self.canceled = True
        self.closing = True
        return EditorWindow.close(self)
ScriptBinding.py 文件源码 项目:python2-tracer 作者: extremecoders-re 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def ask_save_dialog(self):
        msg = "Source Must Be Saved\n" + 5*' ' + "OK to Save?"
        confirm = tkMessageBox.askokcancel(title="Save Before Run or Check",
                                           message=msg,
                                           default=tkMessageBox.OK,
                                           parent=self.editwin.text)
        return confirm
tkgui.py 文件源码 项目:MACE-AL 作者: julmaxi 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def request_next_annotation(self, *arg):
        value = self.user_tag_value.get()

        if value == "":
            self.root.bell()
            return

        if value not in self.annotation_state.parser_predictions.value_set:
            res = tkMessageBox.askokcancel(
                "New Tag",
                "You are about to introduce the new tag '{}'. Proceed?".format(value))
            if res is False:
                return
            else:
                self.combobox.configure(values=sorted(
                    list(self.annotation_state.parser_predictions.value_set) + [value]))

        self.annotation_state.process_annotation(self.current_request, value)

        comment_value = self.comment_box.get("1.0", END).strip()
        if len(comment_value) > 0:
            self.write_comment(self.current_request.token,
                               comment_value, value)
            self.comment_box.delete("1.0", END)

        if self.autosave:
            self.save_state()

        self.get_next_request()
f-engrave-162.py 文件源码 项目:f-engrave 作者: stephenhouser 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def message_ask_ok_cancel(title, mess):
    if VERSION == 3:
        result=tkinter.messagebox.askokcancel(title, mess)
    else:
        result=tkMessageBox.askokcancel(title, mess)
    return result

############################################################################
# routine takes an x and a y coords and does a coordinate transformation   #
# to a new coordinate system at angle from the initial coordinate system   #
# Returns new x,y tuple                                                    #
############################################################################
f-engrave-158.py 文件源码 项目:f-engrave 作者: stephenhouser 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def message_ask_ok_cancel(title, mess):
    if VERSION == 3:
        result=tkinter.messagebox.askokcancel(title, mess)
    else:
        result=tkMessageBox.askokcancel(title, mess)
    return result

############################################################################
# routine takes an x and a y coords and does a coordinate transformation   #
# to a new coordinate system at angle from the initial coordinate system   #
# Returns new x,y tuple                                                    #
############################################################################
f-engrave-156.py 文件源码 项目:f-engrave 作者: stephenhouser 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def message_ask_ok_cancel(title, mess):
    if VERSION == 3:
        result=tkinter.messagebox.askokcancel(title, mess)
    else:
        result=tkMessageBox.askokcancel(title, mess)
    return result

############################################################################
# routine takes an x and a y coords and does a coordinate transformation   #
# to a new coordinate system at angle from the initial coordinate system   #
# Returns new x,y tuple                                                    #
############################################################################
f-engrave-154.py 文件源码 项目:f-engrave 作者: stephenhouser 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def message_ask_ok_cancel(title, mess):
    if VERSION == 3:
        result=tkinter.messagebox.askokcancel(title, mess)
    else:
        result=tkMessageBox.askokcancel(title, mess)
    return result

############################################################################
# routine takes an x and a y coords and does a coordinate transformation   #
# to a new coordinate system at angle from the initial coordinate system   #
# Returns new x,y tuple                                                    #
############################################################################
f-engrave-157.py 文件源码 项目:f-engrave 作者: stephenhouser 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def message_ask_ok_cancel(title, mess):
    if VERSION == 3:
        result=tkinter.messagebox.askokcancel(title, mess)
    else:
        result=tkMessageBox.askokcancel(title, mess)
    return result

############################################################################
# routine takes an x and a y coords and does a coordinate transformation   #
# to a new coordinate system at angle from the initial coordinate system   #
# Returns new x,y tuple                                                    #
############################################################################
f-engrave-160.py 文件源码 项目:f-engrave 作者: stephenhouser 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def message_ask_ok_cancel(title, mess):
    if VERSION == 3:
        result=tkinter.messagebox.askokcancel(title, mess)
    else:
        result=tkMessageBox.askokcancel(title, mess)
    return result

############################################################################
# routine takes an x and a y coords and does a coordinate transformation   #
# to a new coordinate system at angle from the initial coordinate system   #
# Returns new x,y tuple                                                    #
############################################################################
f-engrave-155.py 文件源码 项目:f-engrave 作者: stephenhouser 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def message_ask_ok_cancel(title, mess):
    if VERSION == 3:
        result=tkinter.messagebox.askokcancel(title, mess)
    else:
        result=tkMessageBox.askokcancel(title, mess)
    return result

############################################################################
# routine takes an x and a y coords and does a coordinate transformation   #
# to a new coordinate system at angle from the initial coordinate system   #
# Returns new x,y tuple                                                    #
############################################################################
f-engrave-161.py 文件源码 项目:f-engrave 作者: stephenhouser 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def message_ask_ok_cancel(title, mess):
    if VERSION == 3:
        result=tkinter.messagebox.askokcancel(title, mess)
    else:
        result=tkMessageBox.askokcancel(title, mess)
    return result

############################################################################
# routine takes an x and a y coords and does a coordinate transformation   #
# to a new coordinate system at angle from the initial coordinate system   #
# Returns new x,y tuple                                                    #
############################################################################
f-engrave.py 文件源码 项目:f-engrave 作者: stephenhouser 项目源码 文件源码 阅读 35 收藏 0 点赞 0 评论 0
def message_ask_ok_cancel(title, mess):
    if VERSION == 3:
        result=tkinter.messagebox.askokcancel(title, mess)
    else:
        result=tkMessageBox.askokcancel(title, mess)
    return result

############################################################################
# routine takes an x and a y coords and does a coordinate transformation   #
# to a new coordinate system at angle from the initial coordinate system   #
# Returns new x,y tuple                                                    #
############################################################################
pijuice_gui.py 文件源码 项目:PiJuice 作者: PiSupply 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def _ResetToDefaultConfigCmd(self):
        q = tkMessageBox.askokcancel('Reset Configuration','Warning! This action will reset PiJuice HAT configuration to default settings.', parent=self.frame)
        if q:
            status = pijuice.config.SetDefaultConfiguration()
            if status['error'] != 'NO_ERROR':
                tkMessageBox.showerror('Reset to default configuration', status['error'], parent=self.frame)


问题


面经


文章

微信
公众号

扫码关注公众号