当前位置: 首页>>代码示例>>Python>>正文


Python Shell.kill方法代码示例

本文整理汇总了Python中shell.Shell.kill方法的典型用法代码示例。如果您正苦于以下问题:Python Shell.kill方法的具体用法?Python Shell.kill怎么用?Python Shell.kill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在shell.Shell的用法示例。


在下文中一共展示了Shell.kill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Plugin

# 需要导入模块: from shell import Shell [as 别名]
# 或者: from shell.Shell import kill [as 别名]

#.........这里部分代码省略.........
            ('SqlIndexes', None, "SQL _Indexes...", None, 
                "Prints the CREATE INDEX SQL statements for the given app name(s).", 
                self.on_manage_app_select_command_activate),
            ('SqlSequenceReset', None, "SQL Sequence Rese_t...", None, 
                "Prints the SQL statements for resetting sequences for the given app name(s).", 
                self.on_manage_app_select_command_activate),
            ('Validate', None, "_Validate", None, 
                "Validates all installed models.", 
                self.on_manage_command_activate),
            ('LoadData', None, "_Load Data...", None, 
                "Loads the contents of fixtures into the database.", 
                self.on_manage_load_data_activate),
            ('DumpData', None, "_Dump Data...", None, 
                "Outputs all data in the database associated with the named application(s).", 
                self.on_manage_app_select_command_activate),
        ])
        self._project_actions.add_toggle_actions([
            ('RunServer', None, "_Run Development Server", 
                "<Shift>F5", "Start/Stop the Django development server.", 
                self.on_manage_runserver_activate, False),
        ])
        self._project_actions.set_sensitive(False)
        manager.insert_action_group(self._project_actions)   
        
        self._ui_merge_id = manager.add_ui_from_file(ui_file)
        manager.ensure_update()
    
    def close_project(self):
        self._project = None
        self._server.stop()
        self._server.cwd = None
        self._server.refresh_ui()
        if self._shell:
            self._shell.kill()
        if self._dbshell:
            self._dbshell.kill()
        self._project_actions.set_sensitive(False)
        self._update_run_server_action()
    
    def confirmation_dialog(self, message):
        """ Display a very basic informative Yes/No dialog. """
        dialog = Gtk.MessageDialog(self.window,
                                   Gtk.DialogFlags.MODAL | 
                                   Gtk.DialogFlags.DESTROY_WITH_PARENT,
                                   Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO,  
                                   message)
        dialog.set_title("Confirm")
        response = dialog.run()
        dialog.destroy()
        
        if response == Gtk.ResponseType.YES: 
            return True
        else:
            return False
            
    def do_activate(self):
        logger.debug("Activating plugin.")
        self._add_ui()
        self._add_output_panel()
        self._add_server_panel()

    def do_deactivate(self):
        logger.debug("Deactivating plugin.")
        self._remove_ui()
        self._remove_output_panel()
        self._remove_server_panel()
开发者ID:Kalviy,项目名称:gedit-django-project,代码行数:70,代码来源:plugin.py


注:本文中的shell.Shell.kill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。