Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beim Erstellen einer neuen Runde muss der Debug-Mode aus bleiben. #182

Open
SpotlightForBugs opened this issue Aug 30, 2022 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers invalid This doesn't seem right prio:low Low Priority

Comments

@SpotlightForBugs
Copy link
Owner

Das Problem liegt hier:

webwoelfe/werwolf.py

Lines 397 to 399 in de5fb20

with open("logfile.txt", "w", encoding="UTF8") as file8:
file8.truncate(0)
file8.close()

Debug-Mode in werwolf.py:

webwoelfe/werwolf.py

Lines 397 to 398 in de5fb20

with open("logfile.txt", "w", encoding="UTF8") as file8:
file8.truncate(0)

Aktivierung und Verarbeitung des Debug-Mode:

webwoelfe/werwolf.py

Lines 606 to 646 in de5fb20

def log(debug: bool):
"""
The log function writes a string to the logfile.txt file, which is used by the
debug function to determine whether or not debug mode is on. If it's off, then
the logfile will be wiped clean so that way it doesn't interfere with any future
debugging efforts.
:param debug:bool: Decide whether or not to write a logfile
:return: A none object
"""
if debug == False:
with open("logfile.txt",'w',encoding="UTF8") as logfile_schreiben:
logfile_schreiben.write('FALSE')
else:
pass
def in_log_schreiben(a: str):
"""
The in_log_schreiben function writes a string to the logfile.txt file.
It takes one argument, which is a string.
:param a:str: Pass the message to be logged
:return: The result of the function
"""
with open("logfile.txt",'r',encoding="UTF8") as logfile_lesen:
if 'FALSE' in logfile_lesen.read():
logfile_lesen.close()
else:
with open("logfile.txt", "a", encoding="UTF8") as logfile:
now = datetime.now().strftime("%H:%M:%S")
logfile.write(str(now) + str(" >> " + a) + "\n")
logfile.close()

@SpotlightForBugs SpotlightForBugs added bug Something isn't working good first issue Good for newcomers invalid This doesn't seem right prio:low Low Priority labels Aug 30, 2022
@SpotlightForBugs
Copy link
Owner Author

An muss an bleiben und aus muss aus bleiben

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers invalid This doesn't seem right prio:low Low Priority
Projects
None yet
Development

No branches or pull requests

1 participant