Python should download this, place it in the directory where the program is running, read the file to see what x.x is (say the program version is 1.0, and the latest is 1.1, it should read till 1.1)
A messagebox should pop up saying: "A more recent version of Pivot: Revolution is available. Please go to (url)"
Here is my current code for it:
import urllib appversion = "v0.1" def updateDlg(self, event): updateplace = "https://sourceforge.net/projects/pivotrevolution/files/" updatefile = "updaterelease.txt" """Copy the contents of a file from a given URL to a local file. """ webFile = urllib.urlopen(updateplace + updatefile) localFile = open((updateplace + updatefile).split('/')[-1], 'w') localFile.write(webFile.read()) webFile.close() dlfile = str(localFile) file = open(dlfile) version = file.read() if version > appversion: updateMsgBox = wx.MessageBox("A more recent version of Pivot: Revolution is available! Please go to" + updateplace + "developement_release/" + version + "/download to download", "Update available!", style = wx.OK) localFile.close()
I get the following error:
Traceback (most recent call last):
File "/home/cody/Pivot: Revolution/RunMe.py", line 130, in updateDlg
file = open(dlfile)
IOError: [Errno 2] No such file or directory: "<open file 'updaterelease.txt', mode 'w' at 0x9b68230>"
This post has been edited by CodyD: 27 March 2011 - 11:44 AM