def init(self): self.keepgoing = True if self.sorteractive: saturation = self.sorter.spectrum_s value = self.sorter.spectrum_v width = self.sorter.swidth height = self.sorter.rheight self.sorter.quit() self.sorter = psort.Psort(n = self.count, saturation = saturation, value = value, height = height, width = width) else: self.sorter = psort.Psort(self.count) self.sorteractive = True
def init(self): self.keepgoing = True if self.sorteractive: saturation = self.sorter.spectrum_s value = self.sorter.spectrum_v self.sorter.quit(killsubpanels=False) self.sorter = psort.Psort(n=self.count, saturation=saturation, value=value, rhost=self.rhost, subdivisions=self.subdivisions, bordercolor=self.bordercolor) else: self.sorter = psort.Psort(self.count, rhost=self.rhost, subdivisions=self.subdivisions, bordercolor=self.bordercolor) self.sorteractive = True
def buttonreleased(self, e): if not self.sorteractive: return if self.lastslider == 'quit': self.stop() # self.master.unbind("<ButtonRelease-1>") if self.sorteractive: self.sorteractive = False self.sorter.quit(killsubpanels=True) self.master.destroy() return elif self.lastslider == 'rate': rate = self.rateslider.get() if self.sorter: self.sorter.cyclemult = 0.1**(rate / 10.0) elif self.lastslider == 'count': val = self.countslider.get() self.count = val if self.sorteractive: saturation = self.sorter.spectrum_s value = self.sorter.spectrum_v rhost = self.rhost self.sorter.quit(killsubpanels=False) self.sorter = psort.Psort(n=self.count, saturation=saturation, value=value, rhost=rhost, subdivisions=self.subdivisions, bordercolor=self.bordercolor) elif self.lastslider == 'saturation': val = self.sslider.get() self.sorter.set_spectrum(s=val / 100.0) elif self.lastslider == 'value': val = self.vslider.get() self.sorter.set_spectrum(v=val / 100.0) self.sorter.showsort() self.lastslider = 'none'
#!/usr/bin/python # Run sort to log step counts import psort p = psort.Psort(n=360, nodisplay=True) p.run(s=200000, log=True, time=1)
def init(self): self.keepgoing = True if self.sorteractive: self.sorter.quit() self.sorter = psort.Psort(self.count) self.sorteractive = True