@@ -39,17 +39,17 @@ def generate_data_from_folder(path):
39
39
part_data = []
40
40
for idx , file in enumerate (sorted (os .listdir (part_or_file_path ))):
41
41
if file .endswith ('.cpp' ) or file .endswith ('.c' ):
42
- problem_title = file .rsplit ('.' , 1 )[ 0 ]
42
+ [ problem_title , extension ] = file .rsplit ('.' , 1 )
43
43
problem_id = idx + 1
44
- part_data .append ({"id" : problem_id , "title" : problem_title })
44
+ part_data .append ({"id" : problem_id , "title" : problem_title , "extension" : extension })
45
45
if part_data :
46
46
chapter_data ["parts" ].append ({"part" : part_or_file , "problems" : part_data })
47
47
else :
48
48
# Handle problems directly in the chapter
49
49
if part_or_file .endswith ('.cpp' ) or part_or_file .endswith ('.c' ):
50
- problem_title = part_or_file .rsplit ('.' , 1 )[ 0 ]
50
+ [ problem_title , extension ] = part_or_file .rsplit ('.' , 1 )
51
51
problem_id = len (chapter_data ["problems" ]) + 1
52
- chapter_data ["problems" ].append ({"id" : problem_id , "title" : problem_title })
52
+ chapter_data ["problems" ].append ({"id" : problem_id , "title" : problem_title , "extension" : extension })
53
53
54
54
if chapter_data ["parts" ] or chapter_data ["problems" ]:
55
55
level_data [chapter_dir ] = chapter_data
@@ -68,7 +68,6 @@ def generate_data_from_folder(path):
68
68
# Generate the data from the folder structure
69
69
logging .info ('Starting content generation' )
70
70
data = generate_data_from_folder (FRANCE_IOI_SOLUTIONS_DIR )
71
- print (data )
72
71
73
72
# Render the README with data
74
73
logging .info ('Rendering the README' )
0 commit comments