Beispiel #1
0
 def init(self):
   print "init() in BasePlasmoid"
   self.setBusy(True)
   self.kdehome = unicode(KGlobal.dirs().localkdedir())
   self.metadata = self.package().metadata()
   self.show_metadata()
   #self.icon = KIcon(u"%scontents/icons/%s.png" % (self.package().path(), self.metadata.pluginName())) #.pixmap(QSize(22,22))
   self.cfg = self.config(self.metadata.pluginName())
   
   # Check version
   old = version.LooseVersion(fixType(self.cfg.readEntry("version", "0.0.0")))
   new = version.LooseVersion(str(self.metadata.version()))
   if old < new:
     print u"Updating from version '%s' to '%s'" % (str(old), str(new))
     self.update_version()
  def init(self, needsversion=None):
    print "init() in BaseApplet"
    self.setBusy(True)
    self.kdehome = unicode(KGlobal.dirs().localkdedir())
    self.metadata = self.package().metadata()
    self.show_metadata()
    #self.icon = KIcon(u"%scontents/icons/%s.png" % (self.package().path(), self.metadata.pluginName())) #.pixmap(QSize(22,22))
    self.cfg = self.config(self.metadata.pluginName())

    if needsversion is not None:
        current = version.LooseVersion(str(versionString()))
        need = version.LooseVersion(needsversion)
        if current < need:
            self.setFailedToLaunch(True, i18n("You need at least KDE SC version " + str(needsversion)))
            exit

    # Check version
    old = version.LooseVersion(fixType(self.cfg.readEntry("version", "0.0.0")))
    new = version.LooseVersion(str(self.metadata.version()))
    if old < new:
      print u"Updating from version '%s' to '%s'" % (str(old), str(new))
      self.update_version()