File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def validate_args(args):
1111 sys .exit (0 )
1212
1313 if args ['source' ] and (args ['contest' ] or args ['problem' ] or args ['force' ]):
14- print 'ACedIt run <source_file> doesn\' t support other flags'
14+ print 'ACedIt -- run <source_file> doesn\' t support other flags'
1515 sys .exit (0 )
1616 elif args ['source' ]:
1717 return
Original file line number Diff line number Diff line change @@ -85,12 +85,32 @@ def parse_flags():
8585
8686 return flags
8787
88+ @staticmethod
89+ def create_workdir_structure (site , contest ):
90+ """
91+ Method to create the working directory structure
92+ """
93+ try :
94+ with open (os .path .join (Utilities .cache_dir , 'constants.json' ), 'r' ) as f :
95+ data = f .read ()
96+ data = json .loads (data )
97+ except :
98+ pass
99+
100+ workdir = data .get ('workdir' , None )
101+
102+ if not os .path .isdir (os .path .join (workdir ,site ,contest )):
103+ os .makedirs (os .path .join (workdir ,site ,contest ))
104+
88105 @staticmethod
89106 def check_cache (site , contest , problem ):
90107 """
91108 Method to check if the test cases already exist in cache
92109 If not, create the directory structure to store test cases
93110 """
111+
112+ Utilities .create_workdir_structure (site , contest )
113+
94114 if problem is None :
95115 if not os .path .isdir (os .path .join (Utilities .cache_dir , site , contest )):
96116 os .makedirs (os .path .join (Utilities .cache_dir , site ,
You can’t perform that action at this time.
0 commit comments