Skip to content

Commit 9e3cee7

Browse files
committed
GUAR completed
Finished the syntax needed for GUAR related questions. Updated some other syntax values for clearer explanations. Deleted ALIEN APP/INT related questions due to lack of important information.
1 parent b7221e7 commit 9e3cee7

File tree

6 files changed

+259
-133
lines changed

6 files changed

+259
-133
lines changed

core/process.py

Lines changed: 148 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -286,23 +286,60 @@ def process_guar(self, _list: list) -> list:
286286
'Y': 'Yes',
287287
'K': 'Not provided',
288288
'H': 'Establish/Maintain a home',
289+
'W': 'Work Assignment',
290+
'E': 'Gainfully Employed',
291+
'P': 'Owns Property',
292+
'B': 'Owns Business',
293+
'0': 'Not provided',
289294
'000000': 'Not provided'
290295
}
291296

292297
if len(_list) == 11:
293298
_list.insert(2, ' '.join(_list[2:7]))
294299
del(_list[3:8])
300+
elif len(_list) == 10:
301+
_list.insert(2, ' '.join(_list[2:6]))
302+
del(_list[3:7])
303+
elif len(_list) == 9:
304+
if _list[2] == 'TEMPORARY':
305+
_list.insert(2, ' '.join(_list[2:5]))
306+
del(_list[3:6])
307+
else:
308+
_list.insert(2, ' '.join(_list[2:6]))
309+
del(_list[3:7])
310+
elif len(_list) == 8:
311+
_list.insert(2, ' '.join(_list[2:4]))
312+
del(_list[3:5])
313+
elif len(_list) == 6:
314+
_list.insert(2, 'K')
295315
elif len(_list) == 5:
296-
_list.insert(1, 'Not provided')
297-
_list.insert(2, 'Not provided')
316+
if _list[1] == 'Y' or _list[1] == 'N':
317+
_list.insert(2, 'K')
318+
else:
319+
_list.insert(1, 'K')
320+
_list.insert(2, 'K')
298321
elif len(_list) == 4:
299-
_list.insert(1, 'Not provided')
300-
_list.insert(2, 'Not provided')
322+
_list.insert(1, 'K')
323+
_list.insert(2, 'K')
301324
if len(_list[-1]) > 13:
302325
val = _list[-1]
303326
_list.insert(-1, val[:8])
304327
_list[-1] = val[8:]
305-
328+
elif len(_list) == 3:
329+
_list.insert(1, 'K')
330+
_list.insert(2, 'K')
331+
if len(_list[3]) == 23:
332+
val = _list[3]
333+
del(_list[3])
334+
_list.insert(3, val[:6])
335+
_list.insert(4, val[6:])
336+
337+
if len(_list[5]) == 14:
338+
val = _list[5]
339+
del(_list[5])
340+
_list.insert(5, val[:8])
341+
_list.insert(6, val[8:])
342+
306343
if len(_list[3]) == 5:
307344
_list[3] += 'K'
308345
elif len(_list[3]) == 19:
@@ -316,37 +353,65 @@ def process_guar(self, _list: list) -> list:
316353
del(_list[3])
317354
_list.insert(3, val[:6])
318355
_list.insert(4, val[6:])
356+
elif len(_list[3]) == 23:
357+
val = _list[3]
358+
del(_list[3])
359+
_list.insert(3, val[:6])
360+
_list.insert(4, val[6:])
319361

320362
val = _list[3]
321363
del(_list[3])
364+
322365
_list.insert(3, val[0])
323366
_list.insert(4, f'{val[3:5]} months; {val[1:3]} years')
324367
_list.insert(5, val[5])
325-
_list.insert(6, 'K')
326-
_list.insert(7, 'K')
368+
369+
if len(_list[6]) == 17:
370+
val = _list[6]
371+
del(_list[6])
372+
_list.insert(6, val[0])
373+
_list.insert(7, val[1:3])
374+
_list.insert(8, val[3:])
375+
elif len(_list[6]) == 16:
376+
val = _list[6]
377+
del(_list[6])
378+
_list.insert(6, 'K')
379+
_list.insert(7, val[:2])
380+
_list.insert(8, val[2:])
381+
elif len(_list[6]) == 14:
382+
_list.insert(6, 'K')
383+
_list.insert(7, 'K')
327384

328385
val = _list[8]
329386
del(_list[8])
330-
_list.insert(8, f'{val[0]} -- {val[1:3]}/{val[3:7]}')
387+
388+
_list.insert(8, f'{val[0]} -- {val[5:7]}/{val[1:5]}')
331389
_list.insert(9, val[7])
332390

391+
392+
if len(_list[10]) == 14:
393+
val = _list[10]
394+
del(_list[10])
395+
_list.insert(10, val[:8])
396+
_list.insert(11, val[8:])
397+
333398
val = _list[10]
334399
final = _list[11]
400+
401+
if len(final) == 5:
402+
final = '0' + final
403+
335404
del(_list[10])
336405
del(_list[10])
337-
_list.insert(10, val[-1])
406+
407+
_list.insert(10, val[-2])
338408
_list.insert(11, final[-1])
339-
_list.insert(12, val[-2])
340-
_list.insert(13, val[:-2])
341-
_list.insert(14, f'{final[2:4]} months; {final[:2]} years')
409+
_list.insert(12, val[-1])
410+
_list.insert(13, final[0])
411+
_list.insert(14, f'{final[3:5]} months; {final[1:3]} years')
342412

343413
_list.insert(2, 'K')
344414

345-
346-
347-
348-
349-
350415
for idx in range(len(_list)):
351416
for key, value in syntax.items():
352417
if key == _list[idx]:
@@ -359,48 +424,64 @@ def process_self(self, _list: list) -> list:
359424

360425
new_list = []
361426

427+
syntax = {
428+
'N': 'No',
429+
'Y': 'Yes',
430+
'K': 'Not provided',
431+
'H': 'Establish/Maintain a home',
432+
'W': 'Work Assignment',
433+
'E': 'Gainfully Employed',
434+
'C': 'Go to College',
435+
'P': 'Owns Property',
436+
'B': 'Owns Business',
437+
'0': 'Not provided',
438+
'000000': 'Not provided',
439+
'000': 'Not provided',
440+
' ': 'Not provided'
441+
}
442+
362443
if len(_list) == 8 or len(_list) == 9:
363444
new_list.append(' '.join(_list[1:5]))
364445
del(_list[1:5])
365446
elif len(_list[1]) == 23:
366447
_list.insert(2, _list[1][6:])
367448
_list[1] = _list[1][:6]
368-
new_list.append(str(_list[0]).replace(' ', 'Not provided'))
449+
new_list.append(_list[0])
369450
else:
370-
new_list.append(str(_list[0]).replace(' ', 'Not provided'))
451+
new_list.append(_list[0])
371452

372453
if len(_list) == 4:
373454
if len(_list[1]) == 5:
374-
new_list.append(str(_list[1][0]).replace('Y', 'Yes').replace('N', 'No'))
375-
new_list.append(f"{_list[1][1:3]} Years {_list[1][3:5]} Months")
455+
new_list.append(_list[1][0])
456+
new_list.append(f"{_list[1][1:3]} Years; {_list[1][3:5]} Months")
376457
new_list.append('Not provided')
377458
elif len(_list[1]) == 6:
378-
new_list.append(str(_list[1][0]).replace('Y', 'Yes').replace('N', 'No'))
379-
new_list.append(f"{_list[1][1:3]} Years {_list[1][3:5]} Months")
380-
new_list.append(str(_list[1][5]).replace('C', 'Go to College').replace('H', 'Establish/Maintain a home').replace('W', 'Work Assignment'))
459+
new_list.append(_list[1][0])
460+
new_list.append(f"{_list[1][1:3]} Years; {_list[1][3:5]} Months")
461+
new_list.append(_list[1][5])
381462
elif len(_list[1]) == 23:
382-
new_list.append(str(_list[1][0]).replace('Y', 'Yes').replace('N', 'No'))
383-
new_list.append(f"{_list[1][1:3]} Years {_list[1][3:5]} Months")
384-
new_list.append(str(_list[1][5]).replace('C', 'Go to College').replace('H', 'Establish/Maintain a home').replace('W', 'Work Assignment'))
385-
new_list.append(str(_list[1][6]).replace('Y', 'Yes').replace('N', 'No'))
463+
new_list.append(_list[1][0])
464+
new_list.append(f"{_list[1][1:3]} Years; {_list[1][3:5]} Months")
465+
new_list.append(_list[1][5])
466+
new_list.append(_list[1][6])
386467
new_list.append(str(_list[1][7:9]))
387468
new_list.append(f'{_list[1][9]}--acquired: {_list[1][14:16]}, {_list[1][10:14]}')
388-
new_list.append(str(_list[1][16]).replace('Y', 'Yes').replace('N', 'No'))
469+
new_list.append(_list[1][16])
389470

390471
if len(_list[2]) == 8:
391-
new_list.append(str(_list[2][-2]).replace('Y', 'Yes').replace('N', 'No'))
392-
new_list.append(str(_list[2][-1]).replace('Y', 'Yes').replace('N', 'No'))
472+
new_list.append(_list[2][-2])
473+
new_list.append(_list[2][-1])
393474
elif len(_list[2]) == 14:
394475
if _list[2][1:7] == '000000':
395476
new_list.append('Not provided')
396477
new_list.append('Not provided')
397-
new_list.append(str(_list[2][0]).replace('Y', 'Yes').replace('N', 'No'))
478+
new_list.append(_list[2][0])
398479
new_list.append(f'{_list[2][7]}--acquired: {_list[2][12:]}, {_list[2][8:12]}')
399480
elif _list[2][8:] == '000000':
400481
new_list.append('Not provided')
401482
new_list.append('Not provided')
402483
new_list.append(f'{_list[2][0]}--acquired: {_list[2][5:7]}, {_list[2][1:5]}')
403-
new_list.append(str(_list[2][7]).replace('Y', 'Yes').replace('N', 'No'))
484+
new_list.append(_list[2][7])
404485
else:
405486
new_list.append('Not provided')
406487
new_list.append('Not provided')
@@ -410,58 +491,64 @@ def process_self(self, _list: list) -> list:
410491
new_list.append('Not provided')
411492
new_list.append(_list[2][0:2])
412493
new_list.append(f"{_list[2][2]}--acquired: {_list[2][3:7]}, {_list[2][7:9]}")
413-
new_list.append(str(_list[2][9]).replace('Y', 'Yes').replace('N', 'No'))
494+
new_list.append(_list[2][9])
414495
elif len(_list[2]) == 17:
415-
new_list.append(str(_list[2][0]).replace('Y', 'Yes').replace('N', 'No'))
416-
new_list.append(str(_list[2][1:3]))
496+
new_list.append(_list[2][0])
497+
new_list.append(_list[2][1:3])
417498
new_list.append(f'{_list[2][3]}--acquired: {_list[2][8:10]}, {_list[2][4:8]}')
418-
new_list.append(str(_list[2][10]).replace('Y', 'Yes').replace('N', 'No'))
499+
new_list.append(_list[2][10])
419500

420501
if len(_list[3]) == 5:
421-
new_list.append(str(_list[3][-1]).replace('Y', 'Yes').replace('N', 'No'))
502+
new_list.append(_list[3][-1])
422503
new_list.append("Not provided")
423-
new_list.append(f"{_list[3][0:2]} Years {_list[3][2:4]} Months")
504+
new_list.append(f"{_list[3][0:2]} Years; {_list[3][2:4]} Months")
424505
elif len(_list[3]) == 14:
425-
new_list.append(str(_list[3][6]).replace('Y', 'Yes').replace('N', 'No'))
426-
new_list.append(str(_list[3][-1]).replace('Y', 'Yes').replace('N', 'No'))
427-
new_list.append(str(_list[3][7]).replace('Y', 'Yes').replace('N', 'No'))
428-
new_list.append(str(_list[3][8]).replace('E', 'Gainfully employed').replace('P', 'Owns Property'))
506+
new_list.append(_list[3][6])
507+
new_list.append(_list[3][-1])
508+
new_list.append(_list[3][7])
509+
new_list.append(_list[3][8])
429510
new_list.append(f"{_list[3][9:11]} Years {_list[3][11:13]} Months")
430511

431512
elif len(_list) == 5:
432513

433514
if len(_list[1]) == 5:
434-
new_list.append(str(_list[1][0]).replace('Y', 'Yes').replace('N', 'No'))
435-
new_list.append(f"{_list[1][1:3]} Years {_list[1][3:5]} Months")
515+
new_list.append(_list[1][0])
516+
new_list.append(f"{_list[1][1:3]} Years; {_list[1][3:5]} Months")
436517
new_list.append('Not provided')
437518
elif len(_list[1]) == 6:
438-
new_list.append(str(_list[1][0]).replace('Y', 'Yes').replace('N', 'No'))
439-
new_list.append(f"{_list[1][1:3]} Years {_list[1][3:5]} Months")
440-
new_list.append(str(_list[1][5]).replace('C', 'Go to College').replace('H', 'Establish/Maintain a home').replace('W', 'Work Assignment'))
519+
new_list.append(_list[1][0])
520+
new_list.append(f"{_list[1][1:3]} Years; {_list[1][3:5]} Months")
521+
new_list.append(_list[1][5])
441522

442523
if len(_list[2]) == 14:
443-
new_list.append(str(_list[2][-3:]).replace('000', 'Not provided'))
444-
new_list.append(str(_list[2][-6:-3]).replace('000', 'Not provided'))
524+
new_list.append(_list[2][-3:])
525+
new_list.append(_list[2][-6:-3])
445526
new_list.append(f'{_list[2][0]}--acquired: {_list[2][5:7]}, {_list[2][1:5]}')
446-
new_list.append(str(_list[2][7]).replace('Y', 'Yes').replace('N', 'No'))
527+
new_list.append(_list[2][7])
447528
elif len(_list[2]) == 16:
448529
new_list.append('Not provided')
449-
new_list.append(str(_list[2][0:2]))
530+
new_list.append(_list[2][0:2])
450531
new_list.append(f'{_list[2][2]}--acquired: {_list[2][7:9]}, {_list[2][3:7]}')
451-
new_list.append(str(_list[2][9]).replace('Y', 'Yes').replace('N', 'No'))
532+
new_list.append(_list[2][9])
452533
elif len(_list[2]) == 17:
453-
new_list.append(str(_list[2][0]).replace('Y', 'Yes').replace('N', 'No'))
454-
new_list.append(str(_list[2][1:3]))
534+
new_list.append(_list[2][0])
535+
new_list.append(_list[2][1:3])
455536
new_list.append(f'{_list[2][3]}--acquired: {_list[2][8:10]}, {_list[2][4:8]}')
456-
new_list.append(str(_list[2][10]).replace('Y', 'Yes').replace('N', 'No'))
537+
new_list.append(_list[2][10])
457538

458539
if len(_list[3]) == 8:
459-
new_list.append(str(_list[3][-2]).replace('Y', 'Yes').replace('N', 'No'))
460-
new_list.append(str(_list[4][-1]).replace('Y', 'Yes').replace('N', 'No'))
461-
new_list.append(str(_list[3][:6]).replace('000000', 'No'))
540+
new_list.append(_list[3][-2])
541+
new_list.append(_list[4][-1])
542+
new_list.append(_list[3][:6])
462543

463544
if len(_list[4]) == 5:
464-
new_list.append(str(_list[3][-1]).replace('N', 'Not provided'))
465-
new_list.append(f"{_list[4][:2]} Years {_list[4][2:4]} Months")
545+
new_list.append(_list[3][-1])
546+
new_list.append(f"{_list[4][:2]} Years; {_list[4][2:4]} Months")
547+
548+
549+
for idx in range(len(new_list)):
550+
for key, value in syntax.items():
551+
if key == new_list[idx]:
552+
new_list[idx] == value
466553

467554
return new_list

core/reportgen.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ def handle_second_page(self, canvas: list, select_app: int, last_idx: int) -> in
293293
'PERM COUNTRY INFO': "Mailing/Permanent Address:",
294294
'CURR COUNTY INFO': "Physical Address:",
295295
'CURR COUNTRY INFO': "Physical Address:",
296-
'ALIEN APP/INT\\': "",
297296
'CUR COLLEGE ATT': 'Educational Information (Colleges Attended):',
298297
'CONSERVATORSHIP SWITCHES': "",
299298
'FORMER STUDENT': "",
@@ -316,7 +315,6 @@ def handle_second_page(self, canvas: list, select_app: int, last_idx: int) -> in
316315
'HS GED TYPE': s.hs_ged_syntax(target),
317316
'DUAL CREDIT': s.dual_syntax(target),
318317
'CONSERVATORSHIP SWITCHES': s.conservator_syntax(target),
319-
'ALIEN APP/INT\\': s.alien_syntax(target),
320318
'FORMER STUDENT': s.former_syntax(target)
321319
}
322320

@@ -365,15 +363,15 @@ def handle_third_page(self, canvas: object, select_app: int, last_idx: int) -> N
365363

366364
# Starting points
367365
xstart = self.xstart
368-
ystart = self.ystart+450
366+
ystart = self.ystart+500
369367

370368
#Increment
371369
yadd = 0
372370

373371
current_idx = last_idx
374372

375373
canvas.setFont("Courier", 7)
376-
canvas.setPageSize((8.5*inch, 24*inch))
374+
canvas.setPageSize((8.5*inch, 25*inch))
377375
# canvas.setFillColor(HexColor('#FFFFFF'))
378376

379377
paragraph_start = ['Faculty Mentor ?', 'Consultant/Agency',
@@ -400,10 +398,11 @@ def handle_third_page(self, canvas: object, select_app: int, last_idx: int) -> N
400398
'RES: PREVIOUS ENROLLMENT': s.prev_syntax(target),
401399
'RES: BASIS OF CLAIM': s.basis_syntax(target),
402400
'RES: HS DIPLOMA OR GED': s.hs_diploma_syntax(target),
403-
'RES: SELF': s.residency_self_syntax(target, self.names),
404-
'RES: GUAR': s.residency_guar_syntax(target, self.names),
401+
'RES: SELF': s.residency_self_syntax(target),
402+
'RES: GUAR': s.residency_guar_syntax(target),
405403
'CTRY SELF': s.country_syntax(target),
406-
'FAMILY OBLIGATION INCOME': s.family_obj_income_syntax(target)
404+
'FAMILY OBLIGATION INCOME': s.family_obj_income_syntax(target),
405+
'VET STATUS': s.vet_syntax(target)
407406
}
408407

409408
for key, value in long_syntax.items():

core/reportstructure.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ def transform_page(self, val: str) -> str:
156156
'Y': 'Yes',
157157
'N': 'No',
158158
'Y\\': 'Yes',
159-
'N\\': 'No'
159+
'N\\': 'No',
160+
'NO RESIDENCY COMMENTS INCLUDED\\': None
160161
}
161162

162163
output = transform_dict.get(_str[-1], _str[-1])

0 commit comments

Comments
 (0)