Skip to content

Commit 25a81ed

Browse files
committed
Updated Syntax
Changed the way the emergency contact information started. Accounted for child and spouse data inputs. Removed some commented out lines and tried to find a better way to inject list statements.
1 parent 72feb83 commit 25a81ed

File tree

5 files changed

+57
-25
lines changed

5 files changed

+57
-25
lines changed

core/reportgen.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,16 @@ def handle_third_page(self, canvas: object, select_app: int, last_idx: int) -> N
426426
yadd -= 10
427427

428428
_list = []
429-
# yadd -= 10
430429

431430
conv = struct.transform_page(val)
432-
# if val == 'Med REQ':
433-
# yadd -= 10
434-
431+
435432
if conv != "None":
436-
canvas.drawString(xstart, ystart+yadd, str(conv)) # prints syntax values
437-
# canvas.drawString(xstart, ystart+yadd, val + _str)
438-
yadd -= 10
433+
print(type(conv))
434+
if type(conv) == list:
435+
for x in range(len(conv)):
436+
canvas.drawString(xstart, ystart+yadd, str(conv[x]))
437+
yadd -= 10
438+
else:
439+
canvas.drawString(xstart, ystart+yadd, str(conv)) # prints syntax values
440+
# canvas.drawString(xstart, ystart+yadd, val + _str)
441+
yadd -= 10

core/reportstructure.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def transform_page(self, val: str) -> str:
181181
}
182182

183183
three_mark_syntax = {
184-
"Start Extra Contact Info": "Emergency Contact Information:",
184+
"Start Extra Contact Info": None,
185185
"Start Student Contact Info": "Student Information:",
186186
"Extra Curricular Activities": f"{_str[-5:-4]}",
187187
"Community or Volunteer Service": f"{_str[-4:-2]}",
@@ -221,7 +221,7 @@ def transform_page(self, val: str) -> str:
221221
"Graduation Date": f"Expected Graduation Date: {_str[-1]}",
222222
"High School Info": f"School Code: {_str[-1]}",
223223
"Current enrolled course": _str,
224-
"Previous Applicant": f"Previous Applicant: {_str[-1]}",
224+
"Previous Applicant": f"Previous Applicant: Yes",
225225
"VISA Info": f"Visa: {_str[-1]}",
226226
"VISA end date": f"End date: {_str[-1]}"
227227
}
@@ -266,6 +266,8 @@ def transform_page(self, val: str) -> str:
266266
value = v.ethnicity_race_value(_str)
267267
elif key == 'Student Gender':
268268
value = v.gender_value(_str)
269+
elif key == 'Start Extra Contact Info':
270+
value = v.extra_value(_str)
269271

270272
converted_mark = str(value).replace("\\", "")
271273
break

core/syntax.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,29 @@ def former_syntax(self, _list: list) -> list:
302302

303303
if _list[3] != 'FORMER STUDENT':
304304
return
305+
306+
syntax = {
307+
'Y': 'Yes',
308+
'N': 'No',
309+
'K': 'Not provided'
310+
}
305311

306312
target = "".join(_list[-1]).translate(str.maketrans("", "", "\\0"))
307313

308-
target = target.replace('NN', "No, No").replace('YY', "Yes, Yes").replace('YN', 'Yes, No').replace('NY', 'No, Yes')
314+
if len(target) != 2:
315+
target.append('K')
316+
317+
output = []
318+
319+
for idx in range(len(target)):
320+
val = syntax.get(target[idx], target[idx])
321+
output.append(val)
322+
309323

310-
return ['Are you a former student of this institution?',
324+
return ['Are you a former student of this institution?',
325+
f'{output[0]}', '',
311326
'Have you previously applied?',
312-
f'{target}']
327+
f'{output[1]}']
313328

314329
def family_obj_income_syntax(self, _list: list) -> list:
315330
"""Text fully listing the question given from family obligation income information from

core/values.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def long_med_req_value(self, _str: str) -> str:
4646
'GRADUATE AWARD': None,
4747
'TEST1 SENT': None,
4848
'TEST2 SENT': None,
49-
'CUR COLLEGE CRS': f"Present semester course to be completed: {output}",
49+
'CUR COLLEGE CRS': f"Current college course: {output}",
5050
'CUR COLLEGE ATT': f"Current college attending code: {output}",
5151
'COLLEGE WORK IN CLASSROOM': None,
5252
'FAMILY OBLIGATIONS': None,
@@ -127,14 +127,14 @@ def req_and_or_answer_value(self, _str: str) -> str:
127127
'RES: COMMENTS\\': None,
128128
'FAMILY OBLIGATION INCOME\\': None,
129129
'FAMILY OBLIGATION CARE\\': None,
130-
'FAMILY OBLIGATION OTHER\\': None, # f'{_str[-1]}',
131-
'TREX TRANSCRIPT REQUESTED\\': None, # f'Transcript sharing consent: {_str[-1]}',
130+
'FAMILY OBLIGATION OTHER\\': None,
131+
'TREX TRANSCRIPT REQUESTED\\': None,
132132
'FUNDS SUPPORT\\': "Do you have a source of financial suppport if your are, or will be, in F-1 or J-1 status?",
133133
'CONTACT AT WORK\\': None,
134134
'RES: BASIS OF CLAIM\\': None,
135135
'REVERSE TRANSFER\\': None,
136136
'APPLICATION SHARING\\': None,
137-
'FAMILY OBLIGATIONS\\': None, # f'Do you have family obligations that keep you from participating in extracurricular activities? {_str[-1]}',
137+
'FAMILY OBLIGATIONS\\': None,
138138
'OTHER FIRST NAME1\\': None,
139139
'OTHER FIRST NAME2\\': None,
140140
'OTHER MIDDLE NAME1\\': None,
@@ -217,7 +217,7 @@ def ethnicity_race_value(self, _str: str) -> str:
217217
}
218218

219219
not_hispanic_ = {
220-
"Ethnicity=W\\": "Not Hispanic or Latino. N/A.",
220+
"Ethnicity=W\\": "Not Hispanic or Latino. Ethnicity=N/A.",
221221
"Ethnicity=W;Race=S\\": "Not Hispanic or Latino. White.",
222222
"Ethnicity=W;Race=T\\": "Not Hispanic or Latino. American Indian or Alaska Native.",
223223
"Ethnicity=W;Race=Q\\": "Not Hispanic or Latino. Black or African American.",
@@ -232,8 +232,8 @@ def ethnicity_race_value(self, _str: str) -> str:
232232
}
233233

234234
other_ = {
235-
"Ethnicity=\\": "N/A. N/A.",
236-
"Ethnicity=R\\": "Hispanic or Latino. N/A.",
235+
"Ethnicity=\\": "Gender=N/A. Ethnicity=N/A.",
236+
"Ethnicity=R\\": "Hispanic or Latino. Ethnicity=N/A.",
237237
}
238238

239239
dictionaries = [hispanic_, not_hispanic_, other_]
@@ -266,4 +266,16 @@ def gender_value(self, _str: str) -> str:
266266

267267
for key, value in gender_.items():
268268
if key == target:
269-
return value
269+
return value
270+
271+
def extra_value(self, _str: str) -> str:
272+
273+
target = str(_str[-1]).replace('\\', '')
274+
275+
extra_ = {
276+
'01': 'Spouse Contact Information:',
277+
'02': 'Child Information:',
278+
'51': 'Emergency Contact Information:'
279+
}
280+
281+
return extra_[target]

main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ def run(file: str, fileName: str) -> None:
159159
# file, fileName = find_spe_file()
160160
# run(file, fileName)
161161

162-
# file, fileName = find_spe_file()
163-
# run_target(file, fileName, 'domestic', 10)
162+
file, fileName = find_spe_file()
163+
run_target(file, fileName, 'domestic', 4)
164164

165-
filePath_list, fileName_list = find_spe_folder_files()
166-
for idx in range(len(filePath_list)):
167-
run(filePath_list[idx], fileName_list[idx])
165+
# filePath_list, fileName_list = find_spe_folder_files()
166+
# for idx in range(len(filePath_list)):
167+
# run(filePath_list[idx], fileName_list[idx])

0 commit comments

Comments
 (0)