Commit 7ce0f863 authored by eric pellegrini's avatar eric pellegrini
Browse files

Bug fix with chain_name selector when parsing non macromolecule objects

Optimize the selection summary text flushing
parent c8cd6d98
......@@ -291,14 +291,17 @@ class AtomSelectionPlugin(UserDefinitionPlugin):
nSelectedAtoms = len(self._selection)
self._selectionSummary.AppendText("Number of selected atoms: %d\n\n" % nSelectedAtoms)
text = []
text.append("Number of selected atoms: %d\n" % nSelectedAtoms)
if nSelectedAtoms == 0:
return
self._selectionSummary.AppendText("List of selected atoms:\n")
text.append("List of selected atoms:")
for idx in self._selection:
self._selectionSummary.AppendText("\t%s (MMTK index: %d)\n" % (self._atoms[idx].fullName(),self._atoms[idx].index))
text.append("\t%s (MMTK index: %d)" % (self._atoms[idx].fullName(),self._atoms[idx].index))
self._selectionSummary.SetValue("\n".join(text))
def insert_keyword_values(self, keyword, values):
......
......@@ -72,14 +72,14 @@ class ChainName(ISelector):
else:
vals = set([v.lower() for v in names])
for obj in self._universe.objectList():
try:
for chain in obj:
chainName = chain.name.strip().lower()
if chainName in vals:
if chainName in vals:
sel.update([at for at in chain.atomList()])
except AttributeError:
pass
except (AttributeError,TypeError):
continue
return sel
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment