1
1
# -*- coding: utf-8 -*-
2
2
3
+ from __future__ import print_function
3
4
from optparse import OptionParser
4
5
import glob
5
6
import os
@@ -17,12 +18,12 @@ def update(problemdir):
17
18
yaml_changed = False
18
19
19
20
if 'name' in config :
20
- print 'Move problem name "%s" to these problem statement files: %s' % (config ['name' ], stmts )
21
+ print ( 'Move problem name "%s" to these problem statement files: %s' % (config ['name' ], stmts ) )
21
22
22
23
for f in stmts :
23
24
stmt = open (f , 'r' ).read ()
24
25
if stmt .find ('\\ problemname{' ) != - 1 :
25
- print ' Statement %s already has a problemname, skipping' % f
26
+ print ( ' Statement %s already has a problemname, skipping' % f )
26
27
continue
27
28
newstmt = '\problemname{%s}\n \n %s' % (config ['name' ], stmt )
28
29
open (f , 'w' ).write (newstmt )
@@ -36,7 +37,7 @@ def update(problemdir):
36
37
validation = 'custom'
37
38
validator_flags = validator_flags [1 :]
38
39
validator_flags = ' ' .join (validator_flags )
39
- print 'Old validator option exists, moving to validation: %s, validator_flags: %s' % (validation , validator_flags )
40
+ print ( 'Old validator option exists, moving to validation: %s, validator_flags: %s' % (validation , validator_flags ) )
40
41
config ['validation' ] = validation
41
42
if validator_flags != '' :
42
43
config ['validator_flags' ] = validator_flags
@@ -55,8 +56,8 @@ def update(problemdir):
55
56
56
57
for dir in args :
57
58
try :
58
- print 'Updating %s' % dir
59
+ print ( 'Updating %s' % dir )
59
60
update (dir )
60
61
except Exception as e :
61
- print 'Update FAILED: %s' % e
62
+ print ( 'Update FAILED: %s' % e )
62
63
0 commit comments