66import pandas as pd
77import pathlib
88import sys
9- import pprint
10- from datetime import datetime
9+ # import pprint
1110# pp = pprint.PrettyPrinter(indent=4)
12- # pp.pprint
1311
1412def make_json_list (basedir :str ):
1513 ''' Walk basedir and create list of all filepaths to JSON code samples.'''
@@ -22,7 +20,6 @@ def make_json_list(basedir:str):
2220 filepath = os .path .join (root ,file )
2321 json_file_paths .append (filepath )
2422 filtered_list = [j for j in json_file_paths if not j .startswith ("./oneAPI-samples/Publications" )]
25- print (f"\n Test { filtered_list } " )
2623 return filtered_list
2724 except Exception as e :
2825 print (f"Error. Ensure root directory is oneAPI-samples repo. \n : { e } " )
@@ -50,7 +47,6 @@ def make_url_dict(branch:str,file_paths:list):
5047 if file_paths is not None :
5148 for f in file_paths :
5249 path_base = pathlib .PurePath (f )
53- # TODO: Revise filepath path SLICE => [1:-1] after migration => oneAPI-samples
5450 path_slice = '/' .join (path_base .parts [1 :- 1 ])
5551 full_url = os .path .join (baseurl ,path_slice )
5652 list_urls .append (str (full_url ))
@@ -92,10 +88,7 @@ def main():
9288 '''Orchestrate sequence of steps to output sample_db_prd.json'''
9389 rootdir = sys .argv [- 1 ]
9490 file_paths = make_json_list (rootdir )
95- print (file_paths )
96- # print("OBJ:",type(file_paths))
9791 merge_json_files (file_paths )
98- # print("Check complete...?")
9992 json_db = df_to_db (file_paths )
10093
10194 return json_db
0 commit comments