Exemplo n.º 1
0
 def _setversion(self, version):
     """sets the self.appversion and self.version"""
     checkVersion = hasattr(self, '_version')  #could be reconstructing
     if checkVersion:
         checkVersion = self._getappversion()
     if IDroneModelAppVersion.providedBy(version):
         self._version = IDroneModelAppVersion(version)
     else:
         self._version = IDroneModelAppVersion(
             AppVersion.makeAppVersion(self.app.name, version))
     if checkVersion:
         data = {
             'instance': self,
             'version': self._version,
             'previous': checkVersion
         }
         if checkVersion < self._version:
             if checkVersion.major < self._version.major:
                 Event('new-major-release').fire(**data)
             else:
                 Event('new-release-version').fire(**data)
             return  #done
         Event('release-change').fire(**data)
Exemplo n.º 2
0
 def _getappversion(self):
     if not hasattr(self, '_version'):
         self._version = AppVersion.makeAppVersion(self.app.name, None)
     return IDroneModelAppVersion(self._version)