Mercurial > ~astiob > upreckon > hgweb
annotate publish.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 | a2c9f7cfa174 |
| children |
| rev | line source |
|---|---|
|
10
c87ec78f1fae
Auto-update and revision number reporting added
Oleg Oshmyan <chortos@inbox.lv>
parents:
diff
changeset
|
1 #! /usr/bin/python |
|
c87ec78f1fae
Auto-update and revision number reporting added
Oleg Oshmyan <chortos@inbox.lv>
parents:
diff
changeset
|
2 # Copyright (c) 2009-2010 Chortos-2 <chortos@inbox.lv> |
|
c87ec78f1fae
Auto-update and revision number reporting added
Oleg Oshmyan <chortos@inbox.lv>
parents:
diff
changeset
|
3 |
| 11 | 4 with open('test-svn.py') as t: |
|
10
c87ec78f1fae
Auto-update and revision number reporting added
Oleg Oshmyan <chortos@inbox.lv>
parents:
diff
changeset
|
5 f = t.read() |
|
c87ec78f1fae
Auto-update and revision number reporting added
Oleg Oshmyan <chortos@inbox.lv>
parents:
diff
changeset
|
6 i = f.find('# $Rev: ') |
|
c87ec78f1fae
Auto-update and revision number reporting added
Oleg Oshmyan <chortos@inbox.lv>
parents:
diff
changeset
|
7 j = f.find('\n', i) |
| 13 | 8 rev = f[i+8:j-2] |
|
10
c87ec78f1fae
Auto-update and revision number reporting added
Oleg Oshmyan <chortos@inbox.lv>
parents:
diff
changeset
|
9 f = f[0:i] + f[j+1:] |
|
c87ec78f1fae
Auto-update and revision number reporting added
Oleg Oshmyan <chortos@inbox.lv>
parents:
diff
changeset
|
10 f = f.replace('$$REV$$', rev) |
| 11 | 11 with open('test.py', 'wb') as t: |
|
10
c87ec78f1fae
Auto-update and revision number reporting added
Oleg Oshmyan <chortos@inbox.lv>
parents:
diff
changeset
|
12 t.write(f) |
