Commit 7f16fbd5 authored by Odair M.'s avatar Odair M.
Browse files

arruma diretório no qual os jsons são salvos

parent a153b366
......@@ -12,14 +12,12 @@ except NameError:
to_unicode = str
def build_cache(dataframe):
def build_cache(dataframe,path):
# os.chdir("../src")
path = 'cache/curso'
ensure_path_exists(path)
for cod, df in dataframe.groupby('COD_CURSO'):
path = path + '/' + cod + '/'
path = path + '/'
generate_degree_data(path, df)
generate_student_data(path+'students/',df)
#~ generate_admission_data(path+'/'+cod+'/admission/',df)
......
......@@ -10,10 +10,10 @@ from datetime import timedelta
def analyze(submission):
start_time = time.clock()
start_time_exec = time.time()
path = submission.path()
dataframe = load_dataframes(path)
dataframe = load_dataframes(submission.path())
build_cache(dataframe)
build_cache(dataframe,path)
submission.set_done(round(time.clock() - start_time))
......
......@@ -22,7 +22,7 @@ def build_path(path):
def ensure_path_exists(complete_path):
parts = complete_path.split('/')
for i in range(len(parts)):
for i in range(1,len(parts)):
if not os.path.exists('/'.join(parts[:i+1])):
os.mkdir('/'.join(parts[:i+1]))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment