1
+ from typing import Union
1
2
2
3
class Process :
3
4
4
5
def __init__ (self , file_path : str = None ):
5
6
self .file_path = file_path
7
+ self .list = []
6
8
7
9
def read_spe_file (self ) -> list :
8
10
@@ -119,6 +121,14 @@ def remove_markdown_items(self, _list: list) -> list:
119
121
_translate = ['ATV' ,'BGN' ,'SE' ,'LUI' ,'GE' ,'IEA' ,
120
122
'ISA' ,'GS' ,'SBT' ,'SRE' ]
121
123
124
+ # Adding because it wasn't specified if needed
125
+ _translate .append ('CRS' )
126
+ _translate .append ('RQS!AQ!ZZ!PARENT' )
127
+ _translate .append ('DTP!196!' )
128
+ _translate .append ('DTP!197!' )
129
+ _translate .append ('REF!PSM!' )
130
+ _translate .append ('IN2!18!' )
131
+
122
132
for sublist in _list :
123
133
sublist [:] = [item for item in sublist if not any (str (item ).startswith (remove ) for remove in _translate )]
124
134
@@ -213,4 +223,69 @@ def rearrange_list(self, _list: list) -> list:
213
223
from pprint import pprint
214
224
pprint (_list )
215
225
print (len (_list ))
216
- return _list
226
+ return _list
227
+
228
+ def new_rearrange_list (self , _list : list , app_type : str ) -> list :
229
+
230
+ new_list = []
231
+
232
+ cert_list_holder = []
233
+ conduct_list_holder = []
234
+ submit_transmit_app = []
235
+ residency_list_holder = []
236
+
237
+ _types = self .find_app_types (_list )
238
+
239
+ # Focuses on only one app_type at a time
240
+ for idx , app in enumerate (_types ):
241
+ if app == app_type :
242
+ new_list .append (_list [idx ])
243
+
244
+ # Remove the sections of each list to move easily relocate later
245
+ for idx , apps in enumerate (new_list ):
246
+ cert_idx = 0
247
+ conduct_idx = 0
248
+ semester_idx = 0
249
+ for idx , items in enumerate (apps ):
250
+ # Capturing Cert Questions
251
+ if str (items ).startswith ('RQS!AQ!ZZ!FERPA CERT SWITCH!' ):
252
+ cert_idx = idx
253
+ elif str (items ).startswith ('RQS!AQ!ZZ!TRUTH CERT SWITCH!' ):
254
+ cert_list_holder .append (apps [cert_idx : idx + 1 ])
255
+ for idx in range ((idx + 1 )- cert_idx ):
256
+ apps .pop (cert_idx )
257
+ # Capturing Conduct Questions
258
+ elif str (items ).startswith ('RQS!AQ!ZZ!$ 4!!' ):
259
+ conduct_idx = idx
260
+ elif str (items ).startswith ('RQS!AQ!ZZ!$ 11!!' ):
261
+ conduct_list_holder .append (apps [conduct_idx :idx + 5 ])
262
+ for idx in range ((idx + 5 )- conduct_idx ):
263
+ apps .pop (conduct_idx )
264
+ # Capturing SUBMIT/TRANSMIT times and Major|Term Information
265
+ elif str (items ).startswith ('SSE!' ):
266
+ semester_idx = idx
267
+ elif str (items ).startswith ('RQS!AQ!ZZ!APP SUBMIT/TRANSMIT!!' ):
268
+ submit_transmit_app .append (apps [semester_idx :idx + 1 ])
269
+ for idx in range ((idx + 1 )- semester_idx ):
270
+ apps .pop (semester_idx )
271
+ # Capturing Residency Questions
272
+ elif str (items ).startswith ('RQS!AQ!ZZ!RES:' ):
273
+ print (items )
274
+ residency_list_holder .append (items )
275
+
276
+ # Relocate each item in the separated list into the proper index
277
+ for idx , apps in enumerate (new_list ):
278
+ for items in submit_transmit_app [idx ]:
279
+ apps .insert (0 , items )
280
+ # for items in residency_list_holder[idx]:
281
+ # apps.append(items)
282
+ for items in conduct_list_holder [idx ]:
283
+ apps .append (items )
284
+ for items in cert_list_holder [idx ]:
285
+ apps .append (items )
286
+
287
+ from pprint import pprint
288
+ #pprint(residency_list_holder)
289
+ pprint (new_list )
290
+
291
+ return new_list
0 commit comments