Skip to content

Commit fe648f2

Browse files
committed
Updated Syntax and Values
Further updates to minimal changes found in a couple syntax and values related questions. Added a requirements text file for packaging purposes. Added a popup alert to the end of the programs run cycle to display the total number of domestic and foreign apps generated.
1 parent 6d11773 commit fe648f2

File tree

6 files changed

+58
-18
lines changed

6 files changed

+58
-18
lines changed

core/reportgen.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def handle_third_page(self, canvas: object, select_app: int, last_idx: int) -> N
376376
# canvas.setFillColor(HexColor('#FFFFFF'))
377377

378378
paragraph_start = ['Faculty Mentor ?', 'Consultant/Agency', 'Text Messaging Option',
379-
'Name Verification Notice', 'Conduct Question: Conviction',
379+
'Name Verification Notice', 'Conduct Question: Conviction', 'SSN Verification Notice',
380380
'Graduation Date', 'Consultant Agency ?', 'Alumni ?', 'Citzenship ?', "Post-Secondary Colleges/Universities",
381381
'Conduct Question: Expulsion', 'Conduct: Pending Action', 'Multi type question',
382382
'End of App']
@@ -417,7 +417,8 @@ def handle_third_page(self, canvas: object, select_app: int, last_idx: int) -> N
417417
'PHI THETA KAPPA': s.phi_theta_kappa_syntax(target),
418418
'INT CURR RESIDE IN US': s.currently_reside_syntax(target),
419419
'FAMILY OBLIGATION OTHER': s.family_obj_extra_syntax(target),
420-
'FAMILY OBLIGATION CARE': s.family_obj_extra_syntax(target)
420+
'FAMILY OBLIGATION CARE': s.family_obj_extra_syntax(target),
421+
'INT VISA STATUS CHANGE': s.int_visa_status_syntax(target),
421422
}
422423

423424
for key, value in req_syntax.items():

core/reportstructure.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def transform_page(self, val: str) -> str:
161161
'Alumni ?': 'Alumni ?',
162162
'Citzenship ?': 'Citzenship ?',
163163
'Text Messaging Option': 'Text Messaging Option',
164-
'SSN Verification Notice': 'SSN Verification Notice',
164+
'SSN Verification Notice': _list[-1],
165165
'Name Verification Notice': f'{_list[-1]}',
166166
'Conduct Question: Conviction': f'{_list[-1]}',
167167
'Conduct Question: Expulsion':'Conduct Question: Expulsion',
@@ -209,7 +209,7 @@ def transform_page(self, val: str) -> str:
209209
"Email": f"Email: {_list[-1]}",
210210
"Question Answer": _list[-2:-1],
211211
"Graduation Date": f"Expected Graduation Date: {_list[-1][:-3]}-{_list[-1][-3:]}",
212-
"High School Info": f"School Code: {_list[-1]}",
212+
"High School Info": None,
213213
"Current enrolled course": _list,
214214
"Previous Applicant": f"Previous Applicant: Yes",
215215
"VISA Info": f"Visa: {_list[-1]}",
@@ -268,6 +268,8 @@ def transform_page(self, val: str) -> str:
268268
value = v.short_msg_value(_list)
269269
elif key == 'Grade level':
270270
value = v.grade_level_value(_list)
271+
elif key == 'High School Info':
272+
value = v.high_school_value(_list)
271273

272274
converted_mark = str(value).replace("\\", "")
273275
break

core/syntax.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,21 @@ def college_work_syntax(self, _list: list) -> list:
509509
'Are your college credit hours earned (or being earned) through dual credit, concurrent',
510510
'enrollment, or an early college high school?',
511511
f'{target[0]}']
512+
513+
def int_visa_status_syntax(self, _list: list) -> list:
514+
515+
if _list[3] != 'INT VISA STATUS CHANGE':
516+
return
517+
518+
syntax = {
519+
'N\\': 'No',
520+
'Y\\': 'Yes',
521+
}
522+
523+
target = syntax.get(_list[-1], _list[-1])
524+
525+
return ['Will you require a change in your visa status?',
526+
f'{target}']
512527

513528
def family_obj_syntax(self, _list: list) -> list:
514529

@@ -570,14 +585,19 @@ def exit_us_syntax(self, _list: list) -> list:
570585

571586
syntax = {
572587
'N\\': 'No',
573-
'Y\\': 'Yes'
574588
}
575589

576-
target = syntax.get(_list[-1], _list[-1])
590+
target = syntax.get(_list[-1], "Yes")
577591

578-
return ['If you are already in the U.S., do you plan to leave the U.S. before enrolling at the',
579-
'university to which you are applying?',
580-
f'{target}', '']
592+
if target != "Yes":
593+
return ['If you are already in the U.S., do you plan to leave the U.S. before enrolling at the',
594+
'university to which you are applying? If yes, estimate the date of travel.',
595+
f'{target}', '']
596+
else:
597+
target = str(_list[-1]).replace('\\', '')
598+
return ['If you are already in the U.S., do you plan to leave the U.S. before enrolling at the',
599+
'university to which you are applying? If yes, estimate the date of travel.',
600+
f'{target[:4]}-{target[4:]}', '']
581601

582602
def residency_determ_syntax(self, _list: list) -> list:
583603

core/values.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ def short_msg_value(self, _list: list) -> str:
1212
'N': 'No',
1313
'Y\\': 'Yes',
1414
'N\\': 'No',
15+
' Y\\': 'Yes',
16+
' N\\': 'No',
1517
'NO RESIDENCY COMMENTS INCLUDED\\': None
1618
}
1719

@@ -72,7 +74,8 @@ def long_med_req_value(self, _list: list) -> str:
7274
'FAMILY OBLIGATIONS': None,
7375
'EMERGENCY CONTACT HAS NO PHONE': f'Does the listed emergency contact NOT have a phone? {output}',
7476
'NATIVE LANGUAGE': f'What languages do you speak fluently? {output}',
75-
'INTL EXIT US': None
77+
'INTL EXIT US': None,
78+
'INT VISA STATUS CHANGE': None,
7679
}
7780

7881
long_value = {
@@ -93,7 +96,8 @@ def long_med_req_value(self, _list: list) -> str:
9396
'PARENT 2 ED LEVEL RELATIONSHIP': None,
9497
'PARENT OR GUARDIAN INFO': None,
9598
'CTRY SELF': f'Country: {output}',
96-
'CTRY SPOUSE': f'Country Spouse: {output}',
99+
'CTRY SPOUSE': f'Country Spouse: {output[:3]}-{output[3:]}',
100+
'CTRY CHILD': f'Country Child: {output[:3]}-{output[3:]}',
97101
'FAMILY': None,
98102
'RES: PREVIOUS ENROLLMENT': None,
99103
'RES: RESIDENCY CLAIM': None,
@@ -333,7 +337,6 @@ def app_value(self, _list: list) -> str:
333337

334338
def ssn_value(self, _list: list) -> str:
335339

336-
337340
target = str(_list[-2:]).replace('\\', '')
338341

339342
if len(target) == 47:
@@ -359,4 +362,8 @@ def grade_level_value(self, _list: list) -> str:
359362
else:
360363
target[0] = f'Date: {target[0][:4]}-{target[0][4:]}'
361364

362-
return target
365+
return target
366+
367+
def high_school_value(self, _list: list) -> str:
368+
369+
return f"High School: {_list[-3]}-{_list[-1]}"

main.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def find_spe_folder_files() -> Union[list, list]:
5151

5252
return filePath_list, fileName_list
5353

54-
def run_target(file: str, fileName: str, key: int, apps: int) -> None:
54+
def run_target(file: str, fileName: str, key: int, apps: int) -> Union[int, int]:
5555
"""Second run method for all types of .spe files. Targets a specific
5656
type of application and student.
5757
@@ -101,7 +101,9 @@ def run_target(file: str, fileName: str, key: int, apps: int) -> None:
101101
print(report.names)
102102
ctypes.windll.user32.MessageBoxW(0, f"run_target() error encountered. {b}", (sys.exc_info()[1]), "Warning!", 16)
103103

104-
def run(file: str, fileName: str) -> None:
104+
return len(domestic), len(foreign)
105+
106+
def run(file: str, fileName: str) -> Union[int, int]:
105107
"""Main run method for all types of .spe files.
106108
107109
:param file: target file location
@@ -154,14 +156,19 @@ def run(file: str, fileName: str) -> None:
154156
print(report.names)
155157
ctypes.windll.user32.MessageBoxW(0, "run() error encountered.", (sys.exc_info()[1]), "Warning!", 16)
156158

159+
return len(domestic), len(foreign)
160+
157161

158162
if __name__ == "__main__":
159163
file, fileName = find_spe_file()
160-
run(file, fileName)
164+
domestic, foreign = run(file, fileName)
161165

162166
# file, fileName = find_spe_file()
163-
# run_target(file, fileName, 'domestic', 28)
167+
# domestic, foreign = run_target(file, fileName, 'foreign', 4)
164168

165169
# filePath_list, fileName_list = find_spe_folder_files()
166170
# for idx in range(len(filePath_list)):
167-
# run(filePath_list[idx], fileName_list[idx])
171+
# domestic, foreign += run(filePath_list[idx], fileName_list[idx])
172+
173+
174+
pymsgbox.alert(f"[{domestic}] U.S. ApplyTexas applications have been generated. [{foreign}] International ApplyTexas Applications have been generated.", "Complete!")

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pdfrw==0.4
2+
PyMsgBox==1.0.9
3+
reportlab==4.0.9

0 commit comments

Comments
 (0)