def check_lpy_update(self, silent = False): import svnmanip, os, time if svnmanip.hasSvnSupport(): import openalea.lpy.__version__ as lv testfile = os.path.dirname(lv.__file__)+'/__version__.py' if svnmanip.isSvnFile(testfile): # we are dealing with a develop version of lpy current_rev = svnmanip.svnFileInfo(testfile).revision.number if not silent or ((current_rev > self.svnLastRevisionChecked) and ((self.svnLastDateChecked + 24*60*60) < time.time())): self.svnLastDateChecked = time.time() if svnmanip.isSSHRepository(testfile): # in case of svn+ssh protocol, we do not even try to not block the process. self.svnLastRevisionChecked = current_rev if not silent: qt.QtGui.QMessageBox.information(self,"Lpy Update","You have a develop version of lpy.\nCannot check svn repository.\nProtocol 'SVN+SSH' not supported correctly by PySvn.") else: self.statusBar().showMessage("Cannot check version of svn repository of lpy. Protocol 'SVN+SSH' not supported correctly by PySvn.") else: try: if not svnmanip.svnIsUpToDate(testfile,self if not silent else None,True): qt.QtGui.QMessageBox.information(self,"Lpy Update","A new develop version of lpy seems available !\nPlease update sources of lpy, plantgl, vpltk and recompile.") self.svnLastRevisionChecked = current_rev elif not silent: qt.QtGui.QMessageBox.information(self,"Lpy Update","You have a develop version of lpy.\nYou are up-to-date.") else: self.statusBar().showMessage("L-Py is up-to-date.") except: if not silent: qt.QtGui.QMessageBox.information(self,"Lpy Update","You have a develop version of lpy.\nCannot check svn repository.") else: self.statusBar().showMessage('Cannot check version of svn repository of lpy.') else: # release version if silent: self.statusBar().showMessage("Cannot check update with release version of lpy for now.") else: qt.QtGui.QMessageBox.information(self,"Lpy Update","Cannot check update with release version of lpy for now.")
def check_lpy_update_available(self): import svnmanip, os available = False if svnmanip.hasSvnSupport() : import openalea.lpy.__version__ as lv testfile = os.path.dirname(lv.__file__)+'/__version__.py' #print testfile, svnmanip.isSvnFile(testfile) if svnmanip.isSvnFile(testfile): available = not svnmanip.isSSHRepository(testfile) if not available: self.actionCheckUpdate.setEnabled(False) return available