2
2
import util
3
3
4
4
5
- supported_sites = [" codeforces" , " codechef" , " hackerrank" , " spoj" ]
5
+ supported_sites = [' codeforces' , ' codechef' , ' hackerrank' , ' spoj' ]
6
6
7
7
8
8
def validate_args (args ):
9
- if args [" site" ] not in supported_sites :
10
- print " Sorry. ACedIt only supports %s till now." % (", " .join (supported_sites ))
9
+ if args [' site' ] not in supported_sites :
10
+ print ' Sorry. ACedIt only supports %s till now.' % (', ' .join (supported_sites ))
11
11
sys .exit (0 )
12
12
13
- if args [" source" ] and (args [" contest" ] or args [" problem" ] or args [" force" ]):
14
- print " ACedIt run <source_file> doesn't support other flags"
13
+ if args [' source' ] and (args [' contest' ] or args [' problem' ] or args [' force' ]):
14
+ print ' ACedIt run <source_file> doesn\ ' t support other flags'
15
15
sys .exit (0 )
16
- elif args [" source" ]:
16
+ elif args [' source' ]:
17
17
return
18
18
19
- if not args [" site" ] == " spoj" and args [" contest" ] is None :
20
- print " Please specify a contest code"
19
+ if not args [' site' ] == ' spoj' and args [' contest' ] is None :
20
+ print ' Please specify a contest code'
21
21
sys .exit (0 )
22
22
23
- if args [" site" ] == " spoj" and args [" problem" ] is None :
24
- print " Please specify a problem code for Spoj"
23
+ if args [' site' ] == ' spoj' and args [' problem' ] is None :
24
+ print ' Please specify a problem code for Spoj'
25
25
sys .exit (0 )
26
26
27
27
@@ -30,11 +30,11 @@ def main():
30
30
validate_args (args )
31
31
32
32
try :
33
- if args [" source" ]:
33
+ if args [' source' ]:
34
34
# run code
35
- util .Utilities .run_solution (args [" source" ])
35
+ util .Utilities .run_solution (args [' source' ])
36
36
37
- elif args [" problem" ] is not None :
37
+ elif args [' problem' ] is not None :
38
38
# fetch single problem
39
39
util .Utilities .download_problem_testcases (args )
40
40
@@ -44,8 +44,8 @@ def main():
44
44
45
45
except KeyboardInterrupt :
46
46
# Clean up files here
47
- print " Interruped manually. Exiting gracefully."
47
+ print ' Interruped manually. Exiting gracefully.'
48
48
49
49
50
- if __name__ == " __main__" :
50
+ if __name__ == ' __main__' :
51
51
main ()
0 commit comments