-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch_parser.py
More file actions
34 lines (29 loc) · 987 Bytes
/
Copy pathpatch_parser.py
File metadata and controls
34 lines (29 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import re
with open("app/src/main/java/com/aistudio/unibuddy/qywvsp/data/HistorialParser.kt", "r") as f:
content = f.read()
old_parsed = """ data class ParsedSubject(
val code: String,
val name: String,
val credits: Double,
val grade: Double,
val status: AssessmentStatus,
val group: String,
val semester: String,
val year: String
)"""
new_parsed = """ data class ParsedSubject(
val code: String,
val name: String,
val credits: Double,
val grade: Double,
val status: AssessmentStatus,
val group: String,
val semester: String,
val year: String,
var matchedCode: String? = null,
var matchedName: String? = null,
var professorName: String = ""
)"""
content = content.replace(old_parsed, new_parsed)
with open("app/src/main/java/com/aistudio/unibuddy/qywvsp/data/HistorialParser.kt", "w") as f:
f.write(content)