本文整理汇总了Python中ViewerFramework.VFCommand.CommandGUI类的典型用法代码示例。如果您正苦于以下问题:Python CommandGUI类的具体用法?Python CommandGUI怎么用?Python CommandGUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CommandGUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: not
}
Specs.define_field(specEntry)
else: return None
if not (Specs.DefFieldsDict.has_key('x') and
Specs.DefFieldsDict.has_key('y') and
Specs.DefFieldsDict.has_key('z')):
msg = "specs for atom coordinates (x,y,z) are missing"
self.warningMsg(msg)
return None
return Specs
genPDBReaderGuiDescr = {'widgetType':'menuRoot', 'menuBarName':'File',
'menuButtonName':'Read PDB with Gen Parser ...',
'index':0}
GenPDBReaderGUI = CommandGUI()
GenPDBReaderGUI.addMenuCommand('menuRoot', 'File',
'Read PDB with Gen Parser ...',index=0)
FieldNames = ('serial', 'name', 'altLoc', 'resName', 'chainID',
'resSeq', 'iCode', 'x', 'y', 'z', 'occupancy',
'tempFactor', 'segID', 'element', 'charge', 'other')
variableTypes = ('int', 'character', 'float', 'alphabetic', 'string')
specEntries = ('field_name', 'var_type', 'from', 'to', 'index')
class DefinePdbSpecifications(MVCommand):
""" class to define some pdb specifications in a dictionary and save them
in a file """
示例2: map
except IndexError:
warnings.warn("IndexError for %s" %textcolor)
molecules, nodeSets = self.vf.getNodesByMolecule(nodes)
for mol, nodes in map(None, molecules, nodeSets):
nodes.sort()
drawLabels(mol, nodes, materials, function , lambdaFunc, font,
location, only, negate, format)
#labelByPropertiesGuiDescr = {'widgetType':'Menu', 'menuBarName':'menuRoot',
# 'menuButtonName':'Label', 'menuEntryLabel':'by Properties'}
LabelByPropertiesGUI = CommandGUI()
LabelByPropertiesGUI.addMenuCommand('menuRoot', 'Display', 'by Properties',
cascadeName= 'Label')
LabelByExpressionGUI = CommandGUI()
LabelByExpressionGUI.addMenuCommand('menuRoot', 'Display', 'by Expression',
cascadeName= 'Label')
commandList = [
{'name':'labelByProperty','cmd': LabelByProperties(), 'gui': LabelByPropertiesGUI},
{'name':'labelByExpression','cmd': LabelByExpression(), 'gui': LabelByExpressionGUI}
]
def initModule(viewer):
for dict in commandList:
示例3: CommandGUI
'gridcfg':{'sticky':'we' }})
idf.append({ 'widgetType':StringSelectorGUI,
'parent':'mobgroup',
#'defaultValue':self.vf.Mols[1].name+", , , ",
'tooltip':'Please select the mobile nodes set. By default the mobile nodes will be the second molecule loaded in the viewer',
'name':'smobNodes',
'wcfg':{ 'molSet': self.vf.Mols,
'vf': self.vf,
'all':1,
'crColor':(0.,0.,1.),'forceEmpty':1,
},
'gridcfg':{'row':-1, 'sticky':'we' }})
return idf
SuperimposeAtomsCommandGUI = CommandGUI()
## SuperimposeAtomsGUICommandGUI.addMenuCommand('menuRoot', 'Compute',
## 'superimpose Atom Pairs',
## cascadeName = "Superimpose")
SuperimposeAtomsCommandGUI.addMenuCommand('menuRoot', 'Compute',
'Superimpose Atom Pairs')
commandList = [
{'name':'superimposeAtoms', 'cmd':SuperimposeAtomsCommand(),
'gui':None},
## {'name':'superimposeAtomsGC2', 'cmd':SuperimposeAtomsGUICommand(),
## 'gui':SuperimposeAtomsCommandGUI},
{'name':'superimposeGUI', 'cmd':SuperimposeAtomsGUICommand(),
'gui':SuperimposeAtomsCommandGUI},
示例4: ColorPalette
os.remove(os.path.join(self.vf.rcFolder,"colorByAtom_map.py"))
except:
pass
from Pmv.pmvPalettes import AtomElements
self.vf.colorByAtomType.palette = ColorPalette('Atom Elements', colorDict=AtomElements,
lookupMember='element')
geoms = self.vf.colorByAtomType.getAvailableGeoms(self.vf.Mols)
self.cleanup()
self.vf.colorByAtomType(self.vf.Mols, geoms)
def doit(self):
self.vf.colorByAtomType.palette.configure(ramp=self.paletteGUI.ramp, labels=self.paletteGUI.labels)
self.vf.colorByAtomType.palette.configureCmap()
self.vf.colorByAtomType.palette.write(os.path.join(self.vf.rcFolder,"colorByAtom_map.py"))
EditColorPaletteByAtomTypeGUI = CommandGUI()
EditColorPaletteByAtomTypeGUI.addMenuCommand('menuRoot',
'Edit',
'Edit Color by Atom Type',
cascadeName='Color Palettes')
class EditColorPaletteByResidueType(MVCommand):
def onAddCmdToViewer(self):
if not self.vf.commands.has_key('colorByResidueType'):
self.vf.loadCommand('colorCommands', 'colorByResidueType', 'Pmv', topCommand = 0)
self.vf.colorByResidueType.palette.read(os.path.join(self.vf.rcFolder,"colorByResidueType_map.py"))
def guiCallback(self):
self.paletteGUI = PaletteChooser(apply_cb=self.apply, makeDefault_cb=self.doit,
示例5: openPklData
return
if self.minZ < atom.coords[2] > self.maxZ:
return
self.ifd.entryByName['gridPointsX']['widget'].set(atom.coords[0])
self.ifd.entryByName['gridPointsY']['widget'].set(atom.coords[1])
self.ifd.entryByName['gridPointsZ']['widget'].set(atom.coords[2])
self.cross.Set(visible=1)
self.cross.Set(vertices=((atom.coords[0], atom.coords[1], atom.coords[2]),))
self.vf.GUI.VIEWER.Redraw()
def openPklData(self):
self.vf.AutoLigandMovieCommand(self.fileBaseName+'_flood.pkl')
AutoLigandCommandGUI = CommandGUI()
AutoLigandCommandGUI.addMenuCommand('menuRoot', 'Compute', 'Run AutoLigand...',
cascadeName="AutoLigand")
class OpenMovieCommand(MVCommand):
"GUI that opens saved movie of fill file."
def __init__(self, func=None):
MVCommand.__init__(self, func)
self.floodFile = None
def guiCallback(self):
file = self.vf.askFileOpen(types=[('Saved Flood File', '*.pkl'),('All Files', '*')],
title='Open Saved Flood File')
if file:
示例6: CommandGUI
* The results of the previous steps are written to a file. The user selects a filename via a filebrowser. By convention, the file should have a .dpf extension. If no macromolecule has been selected, it is not possible to write a grid parameter file and the user gets a warning message to that effect. Likewise, the types of the maps to be calculated must be set before the grid parameter file is written and a warning message to this effect appears if the types have not been set.
(A checkbutton, "DONE", allows the user to withdraw the autoTools menuBar)
"""
from ViewerFramework.VFCommand import CommandGUI
from AutoDockTools.autodpfCommands import DpfSetDpo, DpfLoadDefaults,\
Dpf4MacroSelector, Dpf4FlexResSelector, Dpf4MacroChooser,\
Dpf4InitLigand, Dpf4LigandChooser, Dpf4LigPDBQReader,\
DpfEditor, Dpf4SAWriter, Dpf4GAWriter, Dpf4LSWriter,\
Dpf4GALSWriter, Dpf4ClusterWriter, SimAnneal, GA,\
LS, SetDockingRunParms, SetAutoDock4Parameters, StopAutoDpf, menuText,\
checkHasDpo, sortKeyList, setDpoFields
DpfLoadDefaultsGUI = CommandGUI()
DpfLoadDefaultsGUI.addMenuCommand('AutoTools4Bar', menuText['AutoDpfMB'], menuText['ReadDpfMB'])
Dpf4MacroSelectorGUI=CommandGUI()
Dpf4MacroSelectorGUI.addMenuCommand('AutoTools4Bar', menuText['AutoDpfMB'],\
menuText['ReadMacro4'], cascadeName = menuText['MacromoleculeMB'])
Dpf4FlexResSelectorGUI=CommandGUI()
Dpf4FlexResSelectorGUI.addMenuCommand('AutoTools4Bar', menuText['AutoDpfMB'],\
menuText['ReadFlexRes4'], cascadeName = menuText['MacromoleculeMB'])
Dpf4MacroChooserGUI=CommandGUI()
Dpf4MacroChooserGUI.addMenuCommand('AutoTools4Bar', menuText['AutoDpfMB'],\
示例7: open
req._username = username
req._passwd = passwd
resp = gamaLoginService.loginUserMyProxy(req)
f = open(self.proxy_gama, "w")
f.write(resp._loginUserMyProxyReturn)
f.close()
if self.RememberLogin_var.get():
file = open(self.rc_ad,'w')
user = self.cmdForms['default'].descr.entryByName\
['UserName_Entry']['widget'].get()
passwd = self.cmdForms['default'].descr.entryByName\
['Password_Entry']['widget'].get()
file.write("User:%s\nPassword:%s\n"%(user,passwd))
self.login = True
WebServicesGUI=CommandGUI()
WebServicesGUI.addMenuCommand('AutoToolsBar', menuText['StartMB'], "Web Services...")
commandList = [{'name':'ADweb_services','cmd':WebServices(),'gui':WebServicesGUI}]
WebServices4GUI=CommandGUI()
WebServices4GUI.addMenuCommand('AutoTools4Bar', menuText['StartMB'], "Web Services...")
def initModule(viewer):
if not hasattr(viewer, 'ADweb_services') and hasattr(viewer, 'GUI')\
and hasattr(viewer.GUI, 'currentADTBar'):
viewer.addCommand(WebServices(),'ADweb_services',WebServices4GUI)
#else:
# for _dict in commandList:
# viewer.addCommand(_dict['cmd'],_dict['name'],_dict['gui'])
示例8: CommandGUI
"""
from ViewerFramework.VFCommand import CommandGUI
from AutoDockTools.autogpfCommands import GpfSetGpo,\
GpfMacroInit, GpfLoadDefaults, GpfEditor, GpfInitLigand, GpfWriter,\
SelectCenter, SetUpCovalentMap4, SetBoxParameters, SetOtherOptions,\
Gpf4ParameterFileSelector, Gpf4ParameterFileEditor, GpfMergeNonPolarHs,\
Gpf4SetMapTypes, Gpf4SetAtomTypes, Gpf4MacroInit, Gpf4MacroReader,\
Gpf4MacroChooser, Gpf4InitLigand, Gpf4LigandChooser, Gpf4LigReader,\
Gpf4FlexResChooser, Gpf4FlexResReader, Gpf4Writer, menuText, gridOpts,\
messages, checkHasGpo, box, cenSph, cenCross
GpfLoadDefaultsGUI = CommandGUI()
GpfLoadDefaultsGUI.addMenuCommand('AutoTools4Bar', menuText['AutoGpfMB'],\
menuText['ReadGpfMB'])
GpfEditorGUI= CommandGUI()
GpfEditorGUI.addMenuCommand('AutoTools4Bar', menuText['AutoGpfMB'],\
menuText['EditGpfMB'])
GpfWriterGUI= CommandGUI()
GpfWriterGUI.addMenuCommand('AutoTools4Bar', menuText['AutoGpfMB'], \
menuText['WriteGpfMB'], cascadeName=menuText['WriteMB'])
SetUpCovalentMap4GUI = CommandGUI()
示例9: CommandGUI
## # Save the pyShell stdin and redirect it to the main Python
## # interpreter only works if the main interpreter has been
## # started in a interactive mode.
## self.vf.pyShellstdin = sys.stdin
## sys.stdin = sys.__stdin__
## # Save the pyShell stderr and redirect it to the main Python
## # interpreter only works if the main interpreter has been
## # started in a interactive mode.
## self.vf.pyShellstderr = sys.stderr
## sys.stderr = sys.__stderr__
# HideGUI command GUI.
HideGUI = CommandGUI()
HideGUI.addMenuCommand('menuRoot', 'File', 'Hide VF GUI...',
cascadeName='Preferences')
class ShowGUICommand(Command):
"""Allow to show the ViewerFrameworkGUI at any time
\nPackage : Pmv
\nModule : customizeVFGUICommands
\nClass : ShowGUICommand
\nCommand : ShowGUI
\nSynopsis:\n
None <- ShowGUI(**kw)
"""
def __call__(self,**kw):
""" None <- ShowGUI(**kw)
示例10: guiCallback
def guiCallback(self):
"""called each time the 'read ->Grid' sequence is pressed"""
gridFile = self.vf.askFileOpen(types=[('grid data files', '*.*')],
title = 'Grid File:')
if gridFile is not None and len(gridFile):
self.doitWrapper(gridFile, redraw=0)
gridReaderGuiDescr = {'widgetType':'Menu', 'menuBarName':'menuRoot',
'menuButtonName':'Grid', 'menuEntryLabel':'Grid',
'menuCascadeName':'read'}
GridReaderGUI = CommandGUI()
GridReaderGUI.addMenuCommand('menuRoot', 'Grid', 'Grid', cascadeName='read')
class AutoGridReader(MVCommand):
""" Command to load autogrid data files, creating an 'AutoGrid' object
\nPackage : Pmv
\nModule : GridCommands
\nClass : AutoGridReader
\nCommand : readAUTOGRID
\nSynopsis:\n
None <- readAUTOGRID(gridFile, **kw)
\nRequired Arguments:\n
gridFile --- path to the autogrid data file
示例11: zip
levelLabels = ['Molecule ', 'Chain ',
'Residue ', 'Atom ']
self.levelVar.set("Molecule")
for level, levlabel in zip(levels, levelLabels):
ifd.append({'name':level,
'widgetType': Tkinter.Radiobutton,
'wcfg':{'text':levlabel,
'variable':self.levelVar,
'value':level,
'justify':'left',
'activebackground':self.levelColors[level],
'selectcolor':self.levelColors[level],
'command':self.setLevel_cb},
'gridcfg':{'sticky':'we'}})
ifd.append({'name':'dismiss',
'widgetType':Tkinter.Button,
'defaultValue':1,
'wcfg':{'text':'Dismiss',
'command':self.Close_cb},
'gridcfg':{'sticky':'we'}
})
self.form = self.vf.getUserInput(self.ifd, modal=0, blocking=0)
self.form.root.protocol('WM_DELETE_WINDOW',self.Close_cb)
MVSetSelectionLevelGUI = CommandGUI()
MVSetSelectionLevelGUI.addMenuCommand('menuRoot', 'Select','Set Selection Level')
示例12: CommandGUI
'widgetType':Tkinter.Button,
'wcfg':{'text':'Dismiss',
'command':self.dismissCB},
'gridcfg':{'column':3, 'row':10,'sticky':'ew'}})
self.form = self.vf.getUserInput(idf, modal = 0, blocking = 0)
lb = idf.entryByName['selectedGeometries']['widget'].lb
lb.bind("<ButtonRelease-1>", self.updateProps, '+')
e1 = idf.entryByName['pigment']['widget']
e1.bind("<Return>", self.bindPigment)
e2 = idf.entryByName['finish']['widget']
e2.bind("<Return>", self.bindFinish)
povrayGuiDescr = {'widgetType':'Menu', 'menuBarName':'menuRoot',
'menuButtonName':'File',
'menuEntryLabel':'Povray', 'index':0}
PovrayGUI = CommandGUI()
PovrayGUI.addMenuCommand('menuRoot', 'File', 'Povray', index = 0)
commandList = [
{'name':'povray','cmd': Povray(), 'gui': PovrayGUI},
]
def initModule(viewer):
for dict in commandList:
viewer.addCommand(dict['cmd'], dict['name'], dict['gui'])
示例13: setLevel_cb
def setLevel_cb(self, level):
col = self.vf.ICmdCaller.levelColors
c = (col[level][0]/1.5,col[level][1]/1.5,col[level][2]/1.5)
self.LevelOption._menubutton.configure(
background = TkColor(c),
activebackground = TkColor(col[level]))
if level=='Atom':
self.vf.setIcomLevel(Atom)
elif level=='Residue':
self.vf.setIcomLevel(Residue)
elif level=='Chain':
self.vf.setIcomLevel(Chain)
elif level=='Molecule':
self.vf.setIcomLevel(Molecule)
PCOMGUI = CommandGUI()
from moleculeViewer import ICONPATH
PCOMGUI.addToolBar('PCOM', icon1 = 'mouse.gif', icon_dir=ICONPATH,
balloonhelp = 'Picking COMmands', index = 0)
class MVBindCmdToKey(MVCommand):
def __init__(self, func=None):
MVCommand.__init__(self, func=None)
otherKeys = ['Escape', 'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8',
'F9', 'Tab', 'space', 'Return', 'Insert', 'Delete',
'Home', 'End', 'Prior', 'Next', 'Up', 'Down', 'Left',
'Right', 'Caps_Lock', 'Num_Lock', 'BackSpace']
self.bindings = {}
示例14: guiCallback
## def guiCallback(self,**kw):
## folderPath = dirChoose(self.vf.GUI.ROOT)
## if folderPath:
## print folderPath,type(folderPath)
## ## get all the *.vu file from folderPath,
## ## create filelist
## from glob import glob
## filelist = glob(str(folderPath)+'/*.vu')
## if filelist:
## if self.vf.userpref['expandNodeLogString']['value'] == 0:
## self.nodeLogString = "self.getSelection()"
## apply(self.doitWrapper, (self.vf.getSelection(),filelist),kw)
loadVectGUI = CommandGUI()
loadVectGUI.addMenuCommand('menuRoot', 'VectField', 'loadVect')
####### VU Field ###################
class loadVUFile(MVCommand):
""" Command to a load a VU file to display"""
def __init__(self):
MVCommand.__init__(self)
self.fileTypes =[('VU file',"*.vu")]
self.fileBrowserTitle = "Read VU File"
self.lastDir = "."
def onAddCmdToViewer(self):
if not self.vf.commands.has_key('loadVect'):
示例15: destroy
command=self.register)
reg.pack(side = 'left')
b = Tkinter.Button(self.master,text=' Close ',
command=self.destroy)
b.pack(side = 'left')
notebook.setnaturalsize()
else:
self.master.deiconify()
self.master.lift()
def destroy(self):
self.master.destroy()
self.master = None
def openurl(self, evt=None):
import webbrowser
webbrowser.open('http://mgltools.scripps.edu')
def register(self):
self.master.withdraw()
from mglutil.splashregister.register import Register_User
Register_User(self.vf.help_about.version)
AboutGUI = CommandGUI()
AboutGUI.addMenuCommand('menuRoot', 'Help', 'About',separatorAbove = 1)
commandList = [{'name':'about','cmd':About(),'gui':AboutGUI}]
def initModule(viewer):
for _dict in commandList:
viewer.addCommand(_dict['cmd'],_dict['name'],_dict['gui'])