22import util
33
44
5- supported_sites = [" codeforces" , " codechef" , " hackerrank" , " spoj" ]
5+ supported_sites = [' codeforces' , ' codechef' , ' hackerrank' , ' spoj' ]
66
77
88def 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 ))
1111 sys .exit (0 )
1212
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'
1515 sys .exit (0 )
16- elif args [" source" ]:
16+ elif args [' source' ]:
1717 return
1818
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'
2121 sys .exit (0 )
2222
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'
2525 sys .exit (0 )
2626
2727
@@ -30,11 +30,11 @@ def main():
3030 validate_args (args )
3131
3232 try :
33- if args [" source" ]:
33+ if args [' source' ]:
3434 # run code
35- util .Utilities .run_solution (args [" source" ])
35+ util .Utilities .run_solution (args [' source' ])
3636
37- elif args [" problem" ] is not None :
37+ elif args [' problem' ] is not None :
3838 # fetch single problem
3939 util .Utilities .download_problem_testcases (args )
4040
@@ -44,8 +44,8 @@ def main():
4444
4545 except KeyboardInterrupt :
4646 # Clean up files here
47- print " Interruped manually. Exiting gracefully."
47+ print ' Interruped manually. Exiting gracefully.'
4848
4949
50- if __name__ == " __main__" :
50+ if __name__ == ' __main__' :
5151 main ()
0 commit comments