def Copy(self): vals=self.GetAllSelectedCellValues() cellSep=", " rowSep="\n" if vals: txt=rowSep.join(map(lambda row:cellSep.join(row), vals)) adm.SetClipboard(txt)
def OnCopy(self, evt): lines = [] for i in self.control.GetSelection(): txt = self.control.GetItemText(i, 1) tb = self.control.GetItemText(i, 2) if tb: lines.append("%s:\n%s" % (txt, tb)) else: lines.append(txt) adm.SetClipboard("\n".join(lines))
def OnCopy(self, evt): lines = self.control.GetSelection() if lines: sio = cStringIO.StringIO() cwr = csv.writer(sio, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL) cwr.writerow(self.logColNames) for i in lines: cwr.writerow(self.log[i]) data = sio.getvalue().decode('utf-8') adm.SetClipboard(data)
def OnCopy(self, evt): lines = [] for i in self.control.GetSelection(): txt = self.control.GetItemText(i, 1) lines.append(txt) adm.SetClipboard("\n".join(lines))