diff 2.00/config.py @ 24:c23d81f4a1a3

Score returned by TestCase.__call__() is now normalized to 0..1 TestCase.__call__() now returns the fraction (a number from 0 to 1) of case.points that is to be awarded. Bug fix: %-patterns in configuration variables common to all problems are now substituted.
author Oleg Oshmyan <chortos@inbox.lv>
date Thu, 23 Sep 2010 00:11:24 +0000
parents f07b7a431ea6
children b500e117080e
line wrap: on
line diff
--- a/2.00/config.py	Wed Sep 22 23:34:51 2010 +0000
+++ b/2.00/config.py	Thu Sep 23 00:11:24 2010 +0000
@@ -118,9 +118,6 @@
 	for name in defaults_problem:
 		if not hasattr(globalconf, name):
 			setattr(module, name, getattr(module, name, defaults_problem[name]))
-	for name in patterns:
-		if hasattr(module, name):
-			setattr(module, name, getattr(module, name).replace('%', problem_name))
 	if not hasattr(module, 'path'):
 		if hasattr(module, 'name'):
 			module.path = module.name
@@ -131,7 +128,11 @@
 	if options.no_maxtime:
 		module.maxtime = 0
 	sys.dont_write_bytecode = dwb
-	return Config(module, globalconf)
+	module = Config(module, globalconf)
+	for name in patterns:
+		if hasattr(module, name):
+			setattr(module, name, getattr(module, name).replace('%', problem_name))
+	return module
 
 def load_global():
 	dwb = sys.dont_write_bytecode