def setPackage(self, header): if len(self.pixmaps): # set to switch every N seconds if self.pixtimer is None or self.pixtimer.elapsed() > 30: if self.pixtimer is None: self.pixtimer = timer.Timer() num = self.pixcurnum if num >= len(self.pixmaps): num = 0 self.wrappedpixlist = 1 pix = gui.readImageFromFile (self.pixmaps[num], 500, 325) if pix: if self.adpix: self.adbox.remove (self.adpix) pix.set_alignment (0.5, 0.5) self.adbox.add (pix) self.adpix = pix else: log.warning("couldn't get a pix") self.adbox.show_all() self.pixcurnum = num + 1 # take screenshot if desired if flags.autoscreenshot and not self.wrappedpixlist: # let things settle down graphically?? processEvents() time.sleep(5) takeScreenShot() self.pixtimer.reset() size = size_string(header[rpm.RPMTAG_SIZE]) pkgstr = _("Installing %s-%s-%s.%s (%s)") %(header[rpm.RPMTAG_NAME], header[rpm.RPMTAG_VERSION], header[rpm.RPMTAG_RELEASE], header[rpm.RPMTAG_ARCH], size) self.curPackage["package"].set_text (pkgstr) self.curPackage["package"].set_ellipsize (pango.ELLIPSIZE_END) summary = header[rpm.RPMTAG_SUMMARY] if (summary == None): summary = "(none)" self.curPackage["summary"].set_text (summary) self.curPackage["summary"].set_ellipsize (pango.ELLIPSIZE_END)
def setPackage(self, header): if len(self.pixmaps): # set to switch every N seconds if self.pixtimer is None or self.pixtimer.elapsed() > 30: if self.pixtimer is None: self.pixtimer = timer.Timer() num = self.pixcurnum if num >= len(self.pixmaps): num = 0 self.wrappedpixlist = 1 pix = gui.readImageFromFile(self.pixmaps[num], 500, 325) if pix: if self.adpix: self.adbox.remove(self.adpix) pix.set_alignment(0.5, 0.5) self.adbox.add(pix) self.adpix = pix else: log.warning("couldn't get a pix") self.adbox.show_all() self.pixcurnum = num + 1 # take screenshot if desired if flags.autoscreenshot and not self.wrappedpixlist: # let things settle down graphically?? processEvents() time.sleep(5) takeScreenShot() self.pixtimer.reset() size = size_string(header[rpm.RPMTAG_SIZE]) pkgstr = _("Installing %s-%s-%s.%s (%s)") % ( header[rpm.RPMTAG_NAME], header[rpm.RPMTAG_VERSION], header[rpm.RPMTAG_RELEASE], header[rpm.RPMTAG_ARCH], size) self.curPackage["package"].set_text(pkgstr) self.curPackage["package"].set_ellipsize(pango.ELLIPSIZE_END) summary = header[rpm.RPMTAG_SUMMARY] if (summary == None): summary = "(none)" self.curPackage["summary"].set_text(summary) self.curPackage["summary"].set_ellipsize(pango.ELLIPSIZE_END)
def processEvents(self): gui.processEvents()