From d4c86486b21d8f797049003aecd60eb908cd2509 Mon Sep 17 00:00:00 2001 From: ruppert Date: Mon, 17 Sep 2012 14:00:21 +0000 Subject: [PATCH] FIX: update fixed but still commented on control.py --- invesalius/control.py | 9 ++++----- invesalius/gui/dialogs.py | 15 --------------- invesalius/utils.py | 22 ---------------------- 3 files changed, 4 insertions(+), 42 deletions(-) diff --git a/invesalius/control.py b/invesalius/control.py index d552f3e..630a8f8 100755 --- a/invesalius/control.py +++ b/invesalius/control.py @@ -39,6 +39,8 @@ import session as ses import utils import gui.dialogs as dialogs +import subprocess +import sys DEFAULT_THRESH_MODE = 0 @@ -57,8 +59,8 @@ class Controller(): Publisher.sendMessage('Load Preferences') - #utils.CheckForUpdate() - + # Check for updates + #subprocess.Popen([sys.executable, 'update.py' ,ses.Session().language]) def __bind_events(self): Publisher.subscribe(self.OnImportMedicalImages, 'Import directory') @@ -82,7 +84,6 @@ class Controller(): Publisher.subscribe(self.OnOpenProject, 'Open project') Publisher.subscribe(self.OnOpenRecentProject, 'Open recent project') Publisher.subscribe(self.OnShowAnalyzeFile, 'Show analyze dialog') - #Publisher.subscribe(self.OnShowUpdateDialog, 'Show update dialog') def OnCancelImport(self, pubsub_evt): @@ -628,6 +629,4 @@ class Controller(): - def OnShowUpdateDialog(self, pubsub_evt): - dialogs.UpdateDialog(pubsub_evt.data[0], pubsub_evt.data[1]) diff --git a/invesalius/gui/dialogs.py b/invesalius/gui/dialogs.py index 5bba2a6..960e13e 100644 --- a/invesalius/gui/dialogs.py +++ b/invesalius/gui/dialogs.py @@ -1276,21 +1276,6 @@ class SurfaceMethodPanel(wx.Panel): - - -def UpdateDialog(last,url): - """ - Show update dialog - """ - #try: - msg=_("A new version of InVesalius is available. Do you want to open the download website now?") - title=_("Invesalius Update") - msgdlg = wx.MessageDialog(None,msg,title, wx.YES_NO | wx.ICON_INFORMATION) - if (msgdlg.ShowModal()==wx.ID_YES): - wx.LaunchDefaultBrowser(url) - msgdlg.Destroy() - #except: - # return diff --git a/invesalius/utils.py b/invesalius/utils.py index eba387b..65ec6ee 100755 --- a/invesalius/utils.py +++ b/invesalius/utils.py @@ -365,27 +365,5 @@ def get_system_encoding(): return 'utf-8' -def CheckForUpdate(): - from threading import Thread - thr=Thread(target=UpdateChecker, args=()) - thr.start() - - -def UpdateChecker(): - import urllib2 - #try: - URL = "http://www.cti.gov.br/dt3d/invesalius/update/checkupdate_"+sys.platform+"_"+platform.architecture()[0]+".php" - response = urllib2.urlopen(URL,timeout=5) - last = response.readline().rstrip() - url = response.readline().rstrip() - print last, url - if (last!="3.0 beta 32"): - print "New update found!!! -> version:", last, ", url=",url - from time import sleep - sleep(5) - from wx.lib.pubsub import pub as Publisher - Publisher.sendMessage("Show update dialog", (last,url)) - #except: - #return -- libgit2 0.21.2