Skip to content

Commit

Permalink
Refactoring to fillable pdfs. Left at base state prior to changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-prog committed Aug 20, 2024
1 parent c6c8c48 commit 15a493f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 24 deletions.
30 changes: 12 additions & 18 deletions core/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,37 +316,34 @@ def new_rearrange_list(self, app_type: str, _list: list) -> list:
if app == app_type:
new_list.append(_list[idx])

pprint(new_list[-7])

for idx, apps in enumerate(new_list):
self.separate_list_section(apps, 'RQS!AQ!ZZ!FERPA CERT SWITCH!', 'RQS!AQ!ZZ!TRUTH CERT SWITCH!', 1, self.cert_list)
self.separate_list_section(apps, 'SSE!', 'RQS!AQ!ZZ!APP SUBMIT/TRANSMIT!!', 1, self.submit_list)
self.separate_list_section(apps, ('RQS!AQ!ZZ!$ 4!!', 'RQS!AQ!ZZ!$ 9!!'), 'RQS!AQ!ZZ!$ 11!!', 5, self.conduct_list)
self.separate_list_section(apps, 'RQS!AQ!ZZ!RES: PREVIOUS ENROLLMENT!!', 'RQS!AQ!ZZ!RES: DETERM!', 1, self.residency_list)
self.separate_list_section(apps, 'TST!', 'PCL', 0, self.test_list)
# self.separate_list_question(apps, idx, ('Consultant Agency\\', 'Consultant/Agency\\'), 3, self.consultant_list)
self.separate_list_question(apps, idx, ('Consultant Agency\\', 'Consultant/Agency\\'), 3, self.consultant_list)
self.separate_list_question(apps, idx, 'RQS!AQ!ZZ!$ 1!!', 4, self.concentration_list)
self.separate_list_question(apps, idx, 'Faculty Mentor\\', 4, self.faculty_list)

# if len(self.consultant_list) != len(new_list):
# self.new_consultant_list = self.merge_list_question(self.consultant_list)
if len(self.consultant_list) != len(new_list):
self.new_consultant_list = self.merge_list_question(self.consultant_list)

# print(len(self.cert_list), len(self.submit_list), len(self.conduct_list), len(self.residency_list), len(self.test_list), len(self.consultant_list), len(self.concentration_list), len(self.faculty_list))
# print(len(new_list))
print(len(self.cert_list), len(self.submit_list), len(self.conduct_list), len(self.residency_list), len(self.test_list), len(self.consultant_list), len(self.concentration_list), len(self.faculty_list))
print(len(new_list))

# pprint(self.residency_list[-7])
# print(len(self.residency_list))
# pprint(self.concentration_list)

# Relocate each item in the separated list into the proper index
for idx, apps in enumerate(new_list):
for items in range(len(self.concentration_list[idx])-1):
for internals in self.concentration_list[idx][items]:
apps.insert(0, internals)
for items in self.submit_list[idx]:
for int_idx, internals in enumerate(self.concentration_list[idx][items]):
apps.insert(0,self.concentration_list[idx][items][len(self.concentration_list[idx][items])-int_idx-1])
for sub_idx, items in enumerate(self.submit_list[idx]):
apps.insert(0, items)
# for items in range(len(self.consultant_list[idx])-1):
# for internals in self.consultant_list[idx][items]:
# apps.append(internals)
for items in range(len(self.consultant_list[idx])-1):
for internals in self.consultant_list[idx][items]:
apps.append(internals)
for items in range(len(self.faculty_list[idx])-1):
for internals in self.faculty_list[idx][items]:
apps.append(internals)
Expand All @@ -358,8 +355,5 @@ def new_rearrange_list(self, app_type: str, _list: list) -> list:
apps.append(items)
for items in self.cert_list[idx]:
apps.append(items)

# pprint(new_list[-7])
# print(len(new_list))

return new_list
3 changes: 3 additions & 0 deletions core/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@ def translate_N1(self) -> str:
'36': 'Current or most recent Employer'
}

if self.target[1] == 'TM':
return

sep = _translate.get(self.target[1], "Other")
self.error_handler('N1', sep)

Expand Down
8 changes: 4 additions & 4 deletions core/syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def CERT_SWITCH(self) -> list:

output = [f'{_type} {self.target[-1][4:6]}/{self.target[-1][6:8]}/{self.target[-1][:4]}']

if self.target[3] == 'TRUTH CERT SWITCH':
output.append('')
elif self.target[3] == 'FERPA CERT SWITCH':
output.insert(0, '')
# if self.target[3] == 'TRUTH CERT SWITCH':
# output.append('')
# elif self.target[3] == 'FERPA CERT SWITCH':
# output.insert(0, '')

return output

Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ def run(file_path: str, filename: str) -> None:
spe_list = p.read_spe_file()

clean_list = p.remove_markdown_items(spe_list)
new_list = p.new_rearrange_list('U.S. Freshman Admission', clean_list)
# new_list = p.new_rearrange_list('International Freshman Admission', clean_list)
# new_list = p.rearrange_list(clean_list)

translated_spe = []
markdown_spe = []

for idx, item in enumerate(new_list):
for idx, item in enumerate(clean_list):
s = core.Structure(item, idx)
translated_spe.append(s.translate())
markdown_spe.append(s.markdown)
Expand Down

0 comments on commit 15a493f

Please sign in to comment.