changeset 116:e17ae4ccbc58 2.00

Removed code omitted in 2.00 releases from the 2.00 branch
author Oleg Oshmyan <chortos@inbox.lv>
date Fri, 08 Apr 2011 20:22:38 +0300
parents a28f84a8e603
children 359c79a54fd4
files compat.py upreckon-vcs
diffstat 2 files changed, 1 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/compat.py	Fri Apr 08 20:05:51 2011 +0300
+++ b/compat.py	Fri Apr 08 20:22:38 2011 +0300
@@ -130,16 +130,6 @@
 	
 	_path.relpath = relpath
 
-def import_urllib():
-	try:
-		# Python 3
-		import urllib.request
-		return urllib.request, lambda url: urllib.request.urlopen(url).read().decode('ascii')
-	except ImportError:
-		# Python 2
-		import urllib
-		return urllib, lambda url: urllib.urlopen(url).read()
-
 try:
 	from abc import ABCMeta, abstractmethod
 except ImportError:
--- a/upreckon-vcs	Fri Apr 08 20:05:51 2011 +0300
+++ b/upreckon-vcs	Fri Apr 08 20:22:38 2011 +0300
@@ -9,11 +9,10 @@
 version = '2.00.1 ($$REV$$)'
 parser = optparse.OptionParser(version='Upreckon '+version, epilog='Python 2.5 or newer is required.')
 parser.add_option('-1', dest='legacy', action='store_true', default=False, help='handle configuration files in a way more compatible with test.py 1.x')
-parser.add_option('-u', '--update', dest='update', action='store_true', default=False, help='update the installed Upreckon to the latest publicly available version')
 parser.add_option('-p', '--problem', dest='problems', metavar='PROBLEM', action='append', help='test only the PROBLEM (this option can be specified more than once with different problem names, all of which will be tested)')
 parser.add_option('-m', '--copy-io', dest='copyonly', action='store_true', default=False, help='create a copy of the input/output files of the last test case for manual testing and exit')
 parser.add_option('-x', '--auto-exit', dest='pause', action='store_false', default=True, help='do not wait for a key to be pressed after finishing testing')
-parser.add_option('-s', '--save-io', dest='erase', action='store_false', default=True, help='do not delete the copies of input/output files after the last test case; create copies of input files and store output in files even if the solution uses standard I/O; delete the stored input/output files if the solution uses standard I/O and the -c/--cleanup option is specified')
+parser.add_option('-s', '--save-io', dest='erase', action='store_false', default=True, help='do not delete the copies of input/output files after the last test case; create copies of input files and store output in files even if the solution uses standard I/O')
 parser.add_option('-t', '--detect-time', dest='autotime', action='store_true', default=False, help='spend a second detecting the most precise time measurement function')
 parser.add_option('-k', '--skim', action='store_true', default=False, help='skip test groups as soon as one test case is failed')
 parser.add_option('--no-time-limits', dest='no_maxtime', action='store_true', default=False, help='disable all time limits')
@@ -22,40 +21,6 @@
 parser.destroy()
 del parser
 
-if options.update:
-	try:
-		urllib, urlread = compat.import_urllib()
-	except ImportError:
-		sys.exit('Error: the urllib Python module is missing. Without it, an automatic update is impossible.')
-	
-	latesttext = urlread('http://chortos.selfip.net/~astiob/test.py/version.txt')
-	latest = latesttext.split('.')
-	installed = version.split('.')
-	update = None
-	
-	if latest[0] > installed[0]:
-		update = 'major'
-	elif latest[0] == installed[0]:
-		if latest[1] > installed[1]:
-			update = 'feature'
-		elif latest[1] == installed[1]:
-			if latest[2] > installed[2]:
-				update = 'bug-fixing'
-			elif latest[2] == installed[2]:
-				say('You are using the latest publicly available version of Upreckon (%s).' % latesttext)
-				sys.exit()
-	
-	if not update:
-		say('Your copy of Upreckon is newer (%s) than the publicly available version (%s).' % (version, latesttext))
-		sys.exit()
-	
-	say('A %s update to Upreckon is available (%s). Downloading...' % (update, latesttext))
-	sys.stdout.flush()
-	# FIXME: need to update all files!
-	urllib.urlretrieve('http://chortos.selfip.net/~astiob/test.py/test.py', sys.argv[0])
-	say('Downloaded and installed. Now you are using Upreckon %s.' % latesttext)
-	sys.exit()
-
 import config, itertools, os, subprocess, sys, time
 
 if options.legacy: