本文整理汇总了Python中Settings.Settings.val方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.val方法的具体用法?Python Settings.val怎么用?Python Settings.val使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings.Settings
的用法示例。
在下文中一共展示了Settings.val方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainFrame
# 需要导入模块: from Settings import Settings [as 别名]
# 或者: from Settings.Settings import val [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)
#.........这里部分代码省略.........