def grab_icon(self): """ Set the package icon """ pkg = self.get_current_pkg() pix = grab_icon(self) fname = os.path.join(pkg.path, "icon.png") pix.save(fname) pkg.set_icon(fname)
def grab_icon(self): """ Set the package icon """ pkg = self.get_current_pkg() if self.main_win is None: parent = self else: parent = self.main_win() pix = grab_icon(parent) fname = os.path.join(pkg.path, "icon.png") pix.save(fname) pkg.set_icon(fname) self.reinit_treeview()