當前位置: 首頁>>代碼示例>>Python>>正文


Python Manager.load_project方法代碼示例

本文整理匯總了Python中Manager.Manager.load_project方法的典型用法代碼示例。如果您正苦於以下問題:Python Manager.load_project方法的具體用法?Python Manager.load_project怎麽用?Python Manager.load_project使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Manager.Manager的用法示例。


在下文中一共展示了Manager.load_project方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: MainFrame

# 需要導入模塊: from Manager import Manager [as 別名]
# 或者: from Manager.Manager import load_project [as 別名]
class MainFrame(wx.Frame):
    def __init__(self, parent, id, title):
        self._settings = Settings()
        
        if self._settings.val('phenix'):
            import sys
                
            p = self._settings.val('phenix')
            base = p + '/Contents/' + os.path.basename(p).lower()
            if os.path.exists(base):
                sys.path.append(base + '/elbow')
                sys.path.append(base)
                libtbx.env.add_repository(base)
                libtbx.env.process_module(None, 'elbow', False)
        
        CootClient.set_start_coot(self.start_coot)
        SettingsDialog.set_settings(self._settings)
        HelpDialog.set_settings(self._settings)
        
        wx.Frame.__init__(self, parent, id, title, size=(850,540))
        self.Bind(wx.EVT_CLOSE, self._on_close)
        
        self.toolbar = wx.ToolBar(self, style=wx.TB_3DBUTTONS|wx.TB_TEXT)
        quit = self.toolbar.AddLabelTool(wx.ID_ANY, 'Quit', wxtbx.bitmaps.fetch_icon_bitmap('actions', 'exit'))
        settings = self.toolbar.AddLabelTool(wx.ID_ANY, 'Settings', wxtbx.bitmaps.fetch_icon_bitmap('actions', 'configure'))
        about = self.toolbar.AddLabelTool(wx.ID_ANY, 'About', wxtbx.bitmaps.fetch_icon_bitmap('actions', 'info'))
        help = self.toolbar.AddLabelTool(wx.ID_ANY, 'Help', wxtbx.bitmaps.fetch_icon_bitmap('actions', 'agt_support'))
        self.toolbar.AddSeparator()
        coot = self.toolbar.AddLabelTool(wx.ID_ANY, 'Coot', wx.Bitmap(self._settings.proot + 'Resources/gui_resources/coot.png'))
        ligand = self.toolbar.AddLabelTool(wx.ID_ANY, 'Ligands', wx.Bitmap(self._settings.proot + 'Resources/gui_resources/ligand_32.png'))
        self.SetToolBar(self.toolbar)
        self.toolbar.Realize()
        
        self.Bind(wx.EVT_TOOL, self._on_close, quit)
        self.Bind(wx.EVT_TOOL, self.start_coot, coot)
        self.Bind(wx.EVT_TOOL, self._show_settings, settings)
        self.Bind(wx.EVT_TOOL, self._show_about, about)
        self.Bind(wx.EVT_TOOL, self._show_help, help)
        self.Bind(wx.EVT_TOOL, self._view_ligand, ligand)
        
        self._coot_timer = None
        self._coot_process = None
        self._coot_client = CootClient()

        nb = wx.aui.AuiNotebook(self, -1, style=wx.NB_TOP)
        self.sheet1 = Manager(nb)
        
        Tab.set_settings(self._settings)
        CootClient.set_p8(self._settings.proot)
        
        Tab.set_coot_client(self._coot_client)
        Tab.set_start_coot(self.start_coot)
        Tab.set_update_sb(self.set_status)
        
        self.sheet2 = ProcessManager(nb)
        self.sheet3 = Compare(nb)
        
        Jobs.set_new_refinement(self.sheet2.new_refinement)
        Jobs.set_load_refinement(self.sheet2.load_refinement)
        Jobs.set_auto_refinement(self.sheet2.auto_refinement)

        nb.AddPage(self.sheet1, 'Manage')
        nb.AddPage(self.sheet2, 'Process')
        nb.AddPage(self.sheet3, 'Compare')

        self.sb = self.CreateStatusBar()
        self.sb.SetFieldsCount(2)
        self.sb.SetStatusWidths([-4, -1])
        self.sheet2.SetFocus()

        self.sheet1.load_project()
        self.sheet1.refresh_tabs()
        #self.sheet1.sheet2._test()
    
    def _view_ligand(self, event):
        dlg = wx.FileDialog(self, 'Select a PDB file to load', defaultDir=os.getcwd(), wildcard='PDB File|*.pdb')
    
        if dlg.ShowModal() == wx.ID_OK:
            lig = Ligand(str(dlg.GetPath()), os.path.basename(str(dlg.GetPath())))
            lig.Show(True)

        dlg.Destroy()
    
    
    def _show_settings(self, event):
        dlg = SettingsDialog(self)
        dlg.Show(True)
    
    def _show_about(self, event):
        dlg = AboutDialog(self)
        dlg.Show(True)
    
    
    def _show_help(self, event):
        dlg = HelpDialog(self)
        dlg.Show(True)
    
    def set_status(self, text, fld =0):
        self.sb.SetStatusText(text, fld)

#.........這裏部分代碼省略.........
開發者ID:stufisher,項目名稱:Proton8,代碼行數:103,代碼來源:Proton8.py


注:本文中的Manager.Manager.load_project方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。