Skip to content

Commit 352493b

Browse files
committed
Updated Syntax and Values
Updated more of the syntax related questions to bring a more readable structure to the apps. Added more explanation in the values related questions and adjusted all of the inputs to reflect the proper typing.
1 parent 9be4e27 commit 352493b

File tree

6 files changed

+278
-134
lines changed

6 files changed

+278
-134
lines changed

core/process.py

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def create_data_list(self, input: list) -> Union[list, list]:
100100
return foreign, domestic
101101

102102
def uniform_data_list(self, input: list) -> list:
103-
"""NOT USED, attempt at making all data list uniform for better
103+
"""NOT USED, atcurrent_strt at making all data list uniform for better
104104
manipulations.
105105
106106
:param input: nested list of rows found
@@ -109,8 +109,8 @@ def uniform_data_list(self, input: list) -> list:
109109
:rtype: list
110110
"""
111111

112-
template_char = self.find_largest_char(input)
113-
template_list = input[template_char]
112+
current_strlate_char = self.find_largest_char(input)
113+
current_strlate_list = input[current_strlate_char]
114114

115115
# Initialize an empty result list
116116
result_nested_list = []
@@ -120,22 +120,22 @@ def uniform_data_list(self, input: list) -> list:
120120
# Create a set to store the prefixes of matched items in the given sublist
121121
matched_prefixes = set()
122122
result_list = []
123-
# Iterate through the template list for each sublist
124-
for template_item in template_list:
125-
# Extract the prefix from the template item
126-
template_prefix = template_item.split('!')[0]
123+
# Iterate through the current_strlate list for each sublist
124+
for current_strlate_item in current_strlate_list:
125+
# Extract the prefix from the current_strlate item
126+
current_strlate_prefix = current_strlate_item.split('!')[0]
127127

128-
# Check if the template prefix has already been matched
129-
if template_prefix in matched_prefixes:
128+
# Check if the current_strlate prefix has already been matched
129+
if current_strlate_prefix in matched_prefixes:
130130
result_list.append("") # Append a blank string if the prefix has been matched before
131131
else:
132132
# Iterate through the given sublist to find a match
133133
found = False
134134
for given_item in given_sublist:
135135
given_prefix = given_item.split('!')[0]
136-
if given_prefix == template_prefix:
136+
if given_prefix == current_strlate_prefix:
137137
result_list.append(given_item)
138-
matched_prefixes.add(template_prefix) # Add the matched prefix to the set
138+
matched_prefixes.add(current_strlate_prefix) # Add the matched prefix to the set
139139
found = True
140140
break
141141

@@ -189,34 +189,34 @@ def discover_dual_unique_markdown(self, input: list) -> set:
189189
return unique_values
190190

191191
def uniform_data_list_2(self, input: list) -> list:
192-
"""NOT USED, attempt at making all data list uniform for better
192+
"""NOT USED, atcurrent_strt at making all data list uniform for better
193193
manipulations.
194194
195195
:param input: nested list of rows found
196196
:type input: list
197197
:return: updated nested list of same length
198198
:rtype: list
199199
"""
200-
template_idx = self.find_largest_char(input)
201-
template_list = input[template_idx]
202-
template_markdown = []
200+
current_strlate_idx = self.find_largest_char(input)
201+
current_strlate_list = input[current_strlate_idx]
202+
current_strlate_markdown = []
203203

204-
for idx in template_list:
205-
template_markdown.append(str(idx).split('!')[0])
204+
for idx in current_strlate_list:
205+
current_strlate_markdown.append(str(idx).split('!')[0])
206206

207207
data = input[0:5]
208208

209209
for sublist in range(len(data)):
210210
insert = 0
211-
for idx in range(len(template_markdown)):
211+
for idx in range(len(current_strlate_markdown)):
212212
val = str(data[sublist][idx+insert]).split('!')[0]
213213

214-
if val != template_markdown[idx]:
215-
print("No MATCH", val, template_markdown[idx])
214+
if val != current_strlate_markdown[idx]:
215+
print("No MATCH", val, current_strlate_markdown[idx])
216216
data[sublist].insert(idx, "")
217217
insert += 1
218218
else:
219-
print("\nMATCH!", val, template_markdown[idx])
219+
print("\nMATCH!", val, current_strlate_markdown[idx])
220220

221221

222222
return data
@@ -279,6 +279,34 @@ def process_str(self, _str: str) -> list:
279279

280280
return [x for x in result if x]
281281

282+
def process_str_2(self, _str: str) -> list:
283+
284+
result = []
285+
formatted_list = []
286+
current_str = ''
287+
288+
for idx in range(len(_str)):
289+
290+
current_str += _str[idx]
291+
292+
if _str[idx] == " ":
293+
result.append(current_str)
294+
current_str = ''
295+
296+
for item in result:
297+
item = item.strip()
298+
if item:
299+
current_str += item + ' '
300+
else:
301+
if current_str:
302+
formatted_list.append(current_str.strip())
303+
current_str = ''
304+
305+
if current_str:
306+
formatted_list.append(current_str.strip())
307+
308+
return "-".join(formatted_list)
309+
282310
def process_guar(self, _list: list) -> list:
283311

284312
syntax = {
@@ -301,7 +329,7 @@ def process_guar(self, _list: list) -> list:
301329
_list.insert(2, ' '.join(_list[2:6]))
302330
del(_list[3:7])
303331
elif len(_list) == 9:
304-
if _list[2] == 'TEMPORARY':
332+
if _list[2] == 'current_strORARY':
305333
_list.insert(2, ' '.join(_list[2:5]))
306334
del(_list[3:6])
307335
else:

core/reportgen.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ def handle_first_page(self, canvas: object, select_app: int) -> int:
193193
current_idx += 1
194194

195195
if val == "App ID":
196-
xstart, ystart, yadd = self.generate_new_points(350, 0, 0)
196+
xstart, ystart, yadd = self.generate_new_points(320, 0, 0)
197197
elif val == "Start Student Contact Info":
198198
xstart, ystart, yadd = self.generate_new_points(0, -100, 0)
199199
elif val == "Start Extra Contact Info":
200200
if extra_found == 0:
201201
extra_found = 1
202-
xstart, ystart, yadd = self.generate_new_points(350, -100, 0)
202+
xstart, ystart, yadd = self.generate_new_points(320, -100, 0)
203203
else:
204204
yadd -= 10
205205
elif val == "Start Parent 1 Contact Info" or val == "Start Parent 2 Contact Info" :
@@ -315,7 +315,8 @@ def handle_second_page(self, canvas: list, select_app: int, last_idx: int) -> in
315315
'HS GED TYPE': s.hs_ged_syntax(target),
316316
'DUAL CREDIT': s.dual_syntax(target),
317317
'CONSERVATORSHIP SWITCHES': s.conservator_syntax(target),
318-
'FORMER STUDENT': s.former_syntax(target)
318+
'FORMER STUDENT': s.former_syntax(target),
319+
'INTL EXIT US': s.exit_us_syntax(target)
319320
}
320321

321322
for key, value in req_dict.items():
@@ -363,20 +364,20 @@ def handle_third_page(self, canvas: object, select_app: int, last_idx: int) -> N
363364

364365
# Starting points
365366
xstart = self.xstart
366-
ystart = self.ystart+500
367+
ystart = self.ystart+720 # Increase by 80 every 1 inch height
367368

368369
#Increment
369370
yadd = 0
370371

371372
current_idx = last_idx
372373

373374
canvas.setFont("Courier", 7)
374-
canvas.setPageSize((8.5*inch, 25*inch))
375+
canvas.setPageSize((8.5*inch, 28*inch))
375376
# canvas.setFillColor(HexColor('#FFFFFF'))
376377

377-
paragraph_start = ['Faculty Mentor ?', 'Consultant/Agency',
378+
paragraph_start = ['Faculty Mentor ?', 'Consultant/Agency', 'Text Messaging Option',
378379
'Name Verification Notice', 'Conduct Question: Conviction',
379-
'Graduation Date', 'Consultant Agency ?', 'Alumni ?', 'Citzenship ?',
380+
'Graduation Date', 'Consultant Agency ?', 'Alumni ?', 'Citzenship ?', "Post-Secondary Colleges/Universities",
380381
'Conduct Question: Expulsion', 'Conduct: Pending Action', 'Multi type question',
381382
'End of App']
382383

@@ -413,7 +414,8 @@ def handle_third_page(self, canvas: object, select_app: int, last_idx: int) -> N
413414
'RES: DETERM': s.residency_determ_syntax(target),
414415
'FAMILY OBLIGATIONS': s.family_obj_syntax(target),
415416
'APPLICATION SHARING': s.app_share_syntax(target),
416-
'PHI THETA KAPPA': s.phi_theta_kappa_syntax(target)
417+
'PHI THETA KAPPA': s.phi_theta_kappa_syntax(target),
418+
'INT CURR RESIDE IN US': s.currently_reside_syntax(target),
417419
}
418420

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

core/reportstructure.py

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,7 @@ def transform_page(self, val: str) -> str:
150150
:rtype: str
151151
"""
152152

153-
_str = str(self._str).split("!")
154-
155-
transform_dict = {
156-
'Y': 'Yes',
157-
'N': 'No',
158-
'Y\\': 'Yes',
159-
'N\\': 'No',
160-
'NO RESIDENCY COMMENTS INCLUDED\\': None
161-
}
162-
163-
output = transform_dict.get(_str[-1], _str[-1])
153+
_list = str(self._str).split("!")
164154

165155
four_mark_syntax = {
166156
"Start Parent 1 Contact Info": "First Guardian/Parent Information:",
@@ -177,74 +167,74 @@ def transform_page(self, val: str) -> str:
177167
'Conduct Question: Expulsion':'Conduct Question: Expulsion',
178168
'Conduct: Pending Action': 'Conduct: Pending Action',
179169
'Consultant/Agency': 'Consultant/Agency',
180-
'Submit/Transmit': {_str[-1]}
170+
'Submit/Transmit': {_list[-1]}
181171
}
182172

183173
three_mark_syntax = {
184174
"Start Extra Contact Info": None,
185175
"Start Student Contact Info": "Student Information:",
186-
"Extra Curricular Activities": f"{_str[-5:-4]}",
187-
"Community or Volunteer Service": f"{_str[-4:-2]}",
188-
"Award/Acheivement": f"{_str[-5:-4]}",
189-
"Employment/Internships/Summer Activities":f"{_str[-4:-3]}",
190-
'Major': f"Major: {_str[-1]}",
191-
"Area of Interest": f"Area of Interest: {_str[-1]}",
192-
'Request and/or Answer': _str[-1],
193-
'Long REQ': _str,
194-
'Short REQ': _str[-1],
195-
'Med REQ': _str,
196-
"Senior Year Course(s)": _str,
197-
"Issued Date": f"Issued: {_str[-1]}"
176+
"Extra Curricular Activities": f"{_list[-5:-4]}",
177+
"Community or Volunteer Service": f"{_list[-4:-2]}",
178+
"Award/Acheivement": f"{_list[-5:-4]}",
179+
"Employment/Internships/Summer Activities":f"{_list[-4:-3]}",
180+
'Major': f"Major: {_list[-1]}",
181+
"Area of Interest": f"Area of Interest: {_list[-1]}",
182+
'Request and/or Answer': _list[-1],
183+
'Long REQ': _list,
184+
'Short REQ': _list[-1],
185+
'Med REQ': _list,
186+
"Senior Year Course(s)": _list,
187+
"Issued Date": f"Issued: {_list[-1]}"
198188
}
199189

200190
two_mark_syntax = {
201191
"Start App": "Start of App",
202192
"TXAPP": "ApplyTexas Application",
203193
"AT": None,
204-
"App ID": _str[-1],
205-
"Date Start": f"Date Start: {_str[-1]}",
206-
"Data End": f"Date End: {_str[-1]}",
207-
"SSN": _str[-2:],
208-
"Premanent Residence status": _str[-1],
209-
"Sir Name": _str[-1],
210-
"Last Name": f"Last: {_str[-1]}",
211-
"First Name": f"First: {_str[-1]}",
212-
"Middle Name": f"Middle: {_str[-1]}",
213-
"Middle Initial": f"MIddle Initial: {_str[-1]}",
214-
"Suffix": f"Suffix: {_str[-1]}",
215-
"Representative Name": f"Rep Name: {_str[-1]}",
216-
"Preferred Name": f"Preferred: {_str[-1]}",
194+
"App ID": None,
195+
"Date Start": f"Date Start: {_list[-1]}",
196+
"Data End": f"Date End: {_list[-1]}",
197+
"SSN": None,
198+
"Premanent Residence status": _list[-1],
199+
"Sir Name": _list[-1],
200+
"Last Name": f"Last: {_list[-1]}",
201+
"First Name": f"First: {_list[-1]}",
202+
"Middle Name": f"Middle: {_list[-1]}",
203+
"Middle Initial": f"MIddle Initial: {_list[-1]}",
204+
"Suffix": f"Suffix: {_list[-1]}",
205+
"Representative Name": f"Rep Name: {_list[-1]}",
206+
"Preferred Name": f"Preferred: {_list[-1]}",
217207
"Student Gender": None,
218-
"Phone": f"Phone: {_str[-1]}",
219-
"Email": f"Email: {_str[-1]}",
220-
"Question Answer": _str[-2:-1],
221-
"Graduation Date": f"Expected Graduation Date: {_str[-1]}",
222-
"High School Info": f"School Code: {_str[-1]}",
223-
"Current enrolled course": _str,
208+
"Phone": f"Phone: {_list[-1]}",
209+
"Email": f"Email: {_list[-1]}",
210+
"Question Answer": _list[-2:-1],
211+
"Graduation Date": f"Expected Graduation Date: {_list[-1][:-3]}-{_list[-1][-3:]}",
212+
"High School Info": f"School Code: {_list[-1]}",
213+
"Current enrolled course": _list,
224214
"Previous Applicant": f"Previous Applicant: Yes",
225-
"VISA Info": f"Visa: {_str[-1]}",
226-
"VISA end date": f"End date: {_str[-1]}"
215+
"VISA Info": f"Visa: {_list[-1]}",
216+
"VISA end date": f"End date: {_list[-1]}"
227217
}
228218

229219
one_mark_syntax = {
230-
"Place of Birth": f"Place of Birth: {_str[-3:]}",
231-
"Ethnicity/Race": _str[-1],
232-
"Address One": f"Address: {_str[-1]}",
233-
"Address Two": f"{_str[1:]}",
234-
"Semester": f"Semester: {_str[-1]}",
235-
"Question statement": _str[-2:-1],
236-
"Grade level": f"Date: {_str[1]}",
237-
"Admissions Test": _str,
238-
"Post-Secondary Colleges/Universities": f"Institution: {_str[-1]}",
239-
"Hours Earned": f"Hours Earned: {_str[-1]}",
220+
"Place of Birth": f"Place of Birth: {_list[-3:]}",
221+
"Ethnicity/Race": _list[-1],
222+
"Address One": f"Address: {_list[-1]}",
223+
"Address Two": None,
224+
"Semester": f"Semester: {_list[-1]}",
225+
"Question statement": _list[-2:-1],
226+
"Grade level": None, # f"Date: {_list[1]}",
227+
"Admissions Test": _list,
228+
"Post-Secondary Colleges/Universities": f"Institution: {_list[-1]}",
229+
"Hours Earned": f"Hours Earned: {_list[-1]}",
240230
"End of App": "End of App",
241-
"Degree Earned": f"Degree: {_str[-1]}",
231+
"Degree Earned": f"Degree: {_list[-1]}",
242232
"Skip": None,
243-
'Transfer Information': _str,
244-
"Language": _str,
245-
"Old Admission Test Score": _str,
246-
"Old Admission Test": _str,
247-
"Short MSG": output
233+
'Transfer Information': _list,
234+
"Language": _list,
235+
"Old Admission Test Score": _list,
236+
"Old Admission Test": _list,
237+
"Short MSG": None
248238
}
249239

250240
converted_mark = ""
@@ -257,17 +247,27 @@ def transform_page(self, val: str) -> str:
257247
for key, value in dictionaries[idx].items():
258248
if key == val:
259249
if key == "Med REQ" or key == "Long REQ":
260-
value = v.long_med_req_value(_str)
250+
value = v.long_med_req_value(_list)
261251
elif key == "Request and/or Answer":
262-
value = v.req_and_or_answer_value(_str)
252+
value = v.req_and_or_answer_value(_list)
263253
elif key == 'Multi type question' or key == "Degree Earned" or key == 'Semester':
264-
value = v.additional_value(_str)
254+
value = v.additional_value(_list)
265255
elif key == 'Ethnicity/Race':
266-
value = v.ethnicity_race_value(_str)
256+
value = v.ethnicity_race_value(_list)
257+
elif key == 'Address Two':
258+
value = v.address_value(_list)
267259
elif key == 'Student Gender':
268-
value = v.gender_value(_str)
260+
value = v.gender_value(_list)
269261
elif key == 'Start Extra Contact Info':
270-
value = v.extra_value(_str)
262+
value = v.extra_value(_list)
263+
elif key == 'App ID':
264+
value = v.app_value(_list)
265+
elif key == 'SSN':
266+
value = v.ssn_value(_list)
267+
elif key == 'Short MSG':
268+
value = v.short_msg_value(_list)
269+
elif key == 'Grade level':
270+
value = v.grade_level_value(_list)
271271

272272
converted_mark = str(value).replace("\\", "")
273273
break

0 commit comments

Comments
 (0)