python类askokcancel()的实例源码

pijuice_gui.py 文件源码 项目:PiJuice 作者: PiSupply 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def PiJuiceGuiOnclosing():
    #if tkMessageBox.askokcancel("Quit", "Do you want to quit?"):
    if not os.path.exists(os.path.dirname(PiJuiceConfigDataPath)):
        print os.path.dirname(PiJuiceConfigDataPath)
        os.makedirs(os.path.dirname(PiJuiceConfigDataPath)) 
    #try:
    with open(PiJuiceConfigDataPath , 'w+') as outputConfig:
        json.dump(pijuiceConfigData, outputConfig, indent=2)
    #except:
        #print 
    root.destroy()
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)
pijuice_gui.py 文件源码 项目:PiJuice 作者: PiSupply 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def PiJuiceGuiOnclosing():
    #if tkMessageBox.askokcancel("Quit", "Do you want to quit?"):
    if not os.path.exists(os.path.dirname(PiJuiceConfigDataPath)):
        print os.path.dirname(PiJuiceConfigDataPath)
        os.makedirs(os.path.dirname(PiJuiceConfigDataPath)) 
    #try:
    with open(PiJuiceConfigDataPath , 'w+') as outputConfig:
        json.dump(pijuiceConfigData, outputConfig, indent=2)
    #except:
        #print 
    root.destroy()
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)
pijuice_gui.py 文件源码 项目:PiJuice 作者: PiSupply 项目源码 文件源码 阅读 20 收藏 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)
pijuice_gui.py 文件源码 项目:PiJuice 作者: PiSupply 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def PiJuiceGuiOnclosing():
    #if tkMessageBox.askokcancel("Quit", "Do you want to quit?"):
    if not os.path.exists(os.path.dirname(PiJuiceConfigDataPath)):
        print os.path.dirname(PiJuiceConfigDataPath)
        os.makedirs(os.path.dirname(PiJuiceConfigDataPath)) 
    #try:
    with open(PiJuiceConfigDataPath , 'w+') as outputConfig:
        json.dump(pijuiceConfigData, outputConfig, indent=2)
    #except:
        #print 
    root.destroy()
pijuice_gui.py 文件源码 项目:PiJuice 作者: PiSupply 项目源码 文件源码 阅读 32 收藏 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)
pijuice_gui.py 文件源码 项目:PiJuice 作者: PiSupply 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def PiJuiceGuiOnclosing():
    #if tkMessageBox.askokcancel("Quit", "Do you want to quit?"):
    if not os.path.exists(os.path.dirname(PiJuiceConfigDataPath)):
        print os.path.dirname(PiJuiceConfigDataPath)
        os.makedirs(os.path.dirname(PiJuiceConfigDataPath)) 
    #try:
    with open(PiJuiceConfigDataPath , 'w+') as outputConfig:
        json.dump(pijuiceConfigData, outputConfig, indent=2)
    #except:
        #print 
    root.destroy()
pack_signed_apk_script.py 文件源码 项目:GenChannelApks 作者: TigerBetree 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def start(self):
        print('--------------Start Gen Apk-------------------')

        # ?????
        # if os.path.exists(apks_dir):
        #     shutil.rmtree(apks_dir)

        # ??apk?temp??
        cmd_extract = r'java -jar %s\apktool\apktool_2.0.2.jar d -f -s %s\%s -o %s\temp' % (self.setupdir, self.setupdir, self.filename, self.setupdir)
        os.system(cmd_extract)

        # ??AndroidManifest.xml
        if os.path.exists('%s\AndroidManifest.xml' % self.setupdir):
            os.remove('%s\AndroidManifest.xml' % self.setupdir)
        manifest_path = r'%s\temp\AndroidManifest.xml' % self.setupdir
        shutil.copyfile(manifest_path, '%s\AndroidManifest.xml' % self.setupdir)

        # ?????
        for channel in self.channellist:
            print('[Gen Apk] channel : %s' % channel)
            self.modify_channel(channel)

        # ??????
        if os.path.exists('%s\temp' % self.setupdir):
            shutil.rmtree('%s\temp' % self.setupdir)
        if os.path.exists('%s\AndroidManifest.xml' % self.setupdir):
            os.remove('%s\AndroidManifest.xml' % self.setupdir)

        flag = tkMessageBox.askokcancel("??", "????!")
        if flag:
            os.system("explorer.exe %s" % self.apkdir)
        print('--------------Done-------------------')


    # ?????
appjar.py 文件源码 项目:BeachedWhale 作者: southpaw5271 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def okBox(self, title, message):
        self.topLevel.update_idletasks()
        return MessageBox.askokcancel(title, message)
fft_spectrum_gui_3can.py 文件源码 项目:FFT-spectrum-analyzer 作者: ariquezada 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def on_closing(self):
        if (self.f_saved==False):
            if tkMessageBox.askokcancel("Quit", "Sampled data not saved. Do you wanto to quit?"):
                root.destroy()
        else:
            root.destroy()
fft_spectrum_gui.py 文件源码 项目:FFT-spectrum-analyzer 作者: ariquezada 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def on_closing(self):
        if (self.f_saved==False):
            if tkMessageBox.askokcancel("Quit", "Sampled data not saved. Do you wanto to quit?"):
                root.destroy()
        else:
            root.destroy()
GUI.py 文件源码 项目:bemoss_gui2.1 作者: bemoss 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def del_dat(self):
        cnt = tkMessageBox.askokcancel(title='Reconfirmation',
                                       message='Are you sure to delete the data?',
                                       parent=self.frame3)
        if cnt is True:
            cas_dir = self.bemoss_dir.replace('bemoss_os/', 'cassandra/')
            path = cas_dir + 'data'
            shutil.rmtree(path)
        else:
            return
GUI.py 文件源码 项目:bemoss_gui2.1 作者: bemoss 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def del_cas(self):
        cnt = tkMessageBox.askokcancel(title='Reconfirmation',
                                       message='Are you sure to delete the file?',
                                       parent=self.frame3)
        if cnt is True:
            path = self.bemoss_dir + '/cassandra_settings.txt'
            os.remove(path)
        else:
            return
PyShell.py 文件源码 项目:ndk-python 作者: gittor 项目源码 文件源码 阅读 36 收藏 0 点赞 0 评论 0
def close(self):
        "Extend EditorWindow.close()"
        if self.executing:
            response = tkMessageBox.askokcancel(
                "Kill?",
                "The 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
        # Wait for poll_subprocess() rescheduling to stop
        self.text.after(2 * self.pollinterval, self.close2)
ScriptBinding.py 文件源码 项目:ndk-python 作者: gittor 项目源码 文件源码 阅读 18 收藏 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,
                                           master=self.editwin.text)
        return confirm
view.py 文件源码 项目:pylemanager 作者: lucasmenendez 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def execAction(self):
        if not self.action is None:
            action = getattr(self.controller, self.action)     
            location = self.current_dir

            selection = self.getSelection()
            if len(selection) > 0:
                location = selection[0]
            if len(self.items_selected) > 0:
                if tkMessageBox.askokcancel(self.action.capitalize(), "Are you sure? This action can be permanent"): 
                    if action(self.items_selected, location):
                        self.action = None
                    else:
                        tkMessageBox.showerror("Ops", "An error occurred :(")            
                    self.reloadMainList()
install_examples.py 文件源码 项目:SFC_models 作者: brianr747 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def install_examples(): # pragma: no cover
    """
    Pops up windows to allow the user to choose a directory for installation
    of sfc_models examples.

    Uses tkinter, which is installed in base Python (modern versions).
    :return:
    """
    if not mbox.askokcancel(title='sfc_models Example Installation',
                            message=validate_str):
        return
    target = fdog.askdirectory(title='Choose directory to for sfc_models examples installation')
    if target == () or target == '':
        return
    install_example_scripts.install(target)
Keynote.py 文件源码 项目:chessboard_Chinese-chess 作者: JiNianLuo 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def play(self):
        self.erase()
        self.paint_board()
        try:
            self.put_chess()
        except IndexError:
            if askokcancel('????', '???????'):
                self.file_window()
            else:
                self.root.destroy()

    # ????FEN????
Keynote.py 文件源码 项目:chessboard_Chinese-chess 作者: JiNianLuo 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def play(self):
        self.erase()
        self.paint_board()
        try:
            self.put_chess()
        except IndexError:
            if askokcancel('????', '???????'):
                self.file_window()
            else:
                self.root.destroy()

    # ????FEN????


问题


面经


文章

微信
公众号

扫码关注公众号