def test_sortOnEmptySet(): """ Testing the sort method on a empty set """ from MolKit.tree import TreeNodeSet set = TreeNodeSet([]) set.sort() del set
def get(self, event=None): if not self.lb.curselection(): res = [] else: res = TreeNodeSet() for ent in map(int, self.lb.curselection()): mol = self.nameObject[self.entries[ent][0]] res.append(mol) if self.mode == 'single' and res: res = res[0] return res
def get(self, event = None): if not self.lb.curselection(): res = [] else: res = TreeNodeSet() for ent in map( int, self.lb.curselection() ): mol= self.nameObject[self.entries[ ent ][0]] res.append(mol) if self.mode=='single' and res: res = res[0] return res
def doit(self, nodes, filename): self.log(nodes, filename) if type(nodes)==types.StringType: nodes = self.vf.Mols.NodesFromName(nodes) assert isinstance(nodes,TreeNode) or isinstance(nodes,TreeNodeSet) if isinstance(nodes,TreeNode): nodes = TreeNodeSet([nodes]) if len(nodes)==0: return atoms = nodes.findType( Atom ) molecules = atoms.top.uniq() for mol in molecules: self.writeCMsurface(mol, '%s.%s.m'%(filename, mol.name))
def doit(self, nodes, filename): self.log(nodes, filename) if type(nodes) == types.StringType: nodes = self.vf.Mols.NodesFromName(nodes) assert isinstance(nodes, TreeNode) or isinstance(nodes, TreeNodeSet) if isinstance(nodes, TreeNode): nodes = TreeNodeSet([nodes]) if len(nodes) == 0: return atoms = nodes.findType(Atom) molecules = atoms.top.uniq() for mol in molecules: self.writeCMsurface(mol, '%s.%s.m' % (filename, mol.name))
def __init__(self, objects=None, stringRepr=None, comments='', keywords=[]): TreeNodeSet.__init__(self, objects, SecondaryStructure, stringRepr, comments, keywords)
def __init__(self, objects=None, stringRepr=None, comments="", keywords=[]): TreeNodeSet.__init__(self, objects, Residue, stringRepr, comments, keywords)