# HG changeset patch # User Oleg Oshmyan # Date 1268438697 0 # Node ID 28b1f48539687ad8ff348f7ee8e1856d3fdd99d0 # Parent a2c9f7cfa174faa080233c039102611e82fc0eb6 Get the latest published version from /test.py/version.txt diff -r a2c9f7cfa174 -r 28b1f4853968 test-svn.py --- a/test-svn.py Sat Mar 13 00:00:48 2010 +0000 +++ b/test-svn.py Sat Mar 13 00:04:57 2010 +0000 @@ -21,11 +21,8 @@ def update(): import urllib - homepage = urllib.urlopen('http://chortos.selfip.net/~astiob/test.py/').read() - i = homepage.find("The latest version of test.py is ") - i += len("The latest version of test.py is ") - j = homepage.find(".", i) - latest = homepage[i:j].split('.') + latesttext = urllib.urlopen('http://chortos.selfip.net/~astiob/test.py/version.txt').read() + latest = latesttext.split('.') installed = version.split('.') update = '' if latest[0] > installed[0]: @@ -44,7 +41,7 @@ return print 'A ' + update + ' update to test.py is available. Downloading...' urllib.urlretrieve('http://chortos.selfip.net/~astiob/test.py/test.py', 'test.py') - print 'Downloaded and installed. Now you are using test.py ' + homepage[i:j] + '.' + print 'Downloaded and installed. Now you are using test.py ' + latesttext + '.' if options.update: update()