def end(self, mc): ## cp_fn, mc = fn_mc env.end_op(mc) ## if 1: #060123 ## if cp_fn: ## fn, begin_retval = cp_fn ## win = env.mainwindow() ## assy = win.assy ## assy.undo_checkpoint_after_command( begin_retval) return
def Invert(self): """ Invert the atoms of the selected chunk(s) around the chunk centers """ mc = env.begin_op("Invert") cmd = greenmsg("Invert: ") if not self.selmols: msg = redmsg("No selected chunks to invert") env.history.message(cmd + msg) return self.changed() for m in self.selmols: m.stretch(-1.0) self.o.gl_update() info = fix_plurals( "Inverted %d chunk(s)" % len(self.selmols)) env.history.message( cmd + info) env.end_op(mc) #e try/finally?
def Stretch(self): """ stretch a Chunk """ mc = env.begin_op("Stretch") try: cmd = greenmsg("Stretch: ") if not self.selmols: msg = redmsg("No selected chunks to stretch") env.history.message(cmd + msg) else: self.changed() for m in self.selmols: m.stretch(1.1) self.o.gl_update() # Added history message. Mark 050413. info = fix_plurals( "Stretched %d chunk(s)" % len(self.selmols)) env.history.message( cmd + info) finally: env.end_op(mc) return