Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Commit

Permalink
The Logs.txt file closes after every write operation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sklyvan committed Nov 25, 2021
1 parent 1d6d18a commit 6d4d9f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
def addLogInformation(logInformation, toStdOut=True):
with open(LOG_FILE_PATH, 'a') as logFile:
logFile.write(f"[{round(time.time() - START_PROGRAM_TIME, 5)}] {logInformation}\n")
logFile.close()
if toStdOut: print(logInformation)

def extractRND(fromSoup):
Expand Down Expand Up @@ -174,7 +175,10 @@ def RunApplication(deleteMode=False, replaceMode=True):
yield loadingStatus # 9%

if isUsingEspaiAulaFilePath(userPreferences): # If the user is using the automatic mode, we're going to read the HTML file with user data.
espaiAulaFile = HTML_LocalFile(getEspaiAulaFilePath(userPreferences), DECODE_HTML_FILE)
try: espaiAulaFile = HTML_LocalFile(getEspaiAulaFilePath(userPreferences), DECODE_HTML_FILE)
except FileNotFoundError:
addLogInformation(f"HTML file not found at {getEspaiAulaFilePath(userPreferences)}.")
return False
fromGroups, fromSubjects, userSubjectsGroups, pGroups, sGroups = extractSubjectsPreferencesFromFile(espaiAulaFile)
else: # If the user is using the manual mode, we're going to read the user groups and subjects from the user preferences file.
fromGroups, fromSubjects, userSubjectsGroups, pGroups, sGroups = extractSubjectsPreferences(userPreferences)
Expand Down

0 comments on commit 6d4d9f9

Please sign in to comment.