Skip to content

Commit c5fdaca

Browse files
Merge pull request #197 from SpotlightForBugs/deepsource-transform-0d0b5e19
2 parents 1263e3a + 36393d5 commit c5fdaca

File tree

4 files changed

+35
-38
lines changed

4 files changed

+35
-38
lines changed

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ def wahl_stats():
976976

977977
@app.route("/test")
978978
def test():
979-
return render_template("uebersicht.html",nurNamen=werwolf.nurNamen())
979+
return render_template("uebersicht.html", nurNamen=werwolf.nurNamen())
980980

981981

982982
@app.route("/sehen/<name>/<rolle>/<auswahl>")

static/scripts/game_state.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ if (window.location.pathname != "/") {
88
if (token.includes("token=")) {
99
token = token.replace("token=", "");
1010
}
11-
//else search for token= in other cookies using a for loop
11+
//else search for token= in other cookies using a for loop
1212
else if (document.cookie.includes("token=")) {
1313
for (var i = 0; i < document.cookie.split(";").length; i++) {
1414
if (document.cookie.split(";")[i].split("=")[0] == "token") {
1515
token = document.cookie.split(";")[i].split("=")[1];
1616
}
1717
}
1818
}
19-
//save the http code of the page /{token}/zum_ziel to the variable status_code and the url to the variable url
20-
var status_code = 0;
21-
var url = "/" + token + "/zum_ziel";
22-
var xmlhttp = new XMLHttpRequest();
23-
xmlhttp.onreadystatechange = function () {
24-
if (xmlhttp.readyState == 4) {
25-
status_code = xmlhttp.status;
26-
}
27-
};
28-
xmlhttp.open("GET", url, false);
29-
xmlhttp.send();
19+
//save the http code of the page /{token}/zum_ziel to the variable status_code and the url to the variable url
20+
var status_code = 0;
21+
var url = "/" + token + "/zum_ziel";
22+
var xmlhttp = new XMLHttpRequest();
23+
xmlhttp.onreadystatechange = function () {
24+
if (xmlhttp.readyState == 4) {
25+
status_code = xmlhttp.status;
26+
}
27+
};
28+
xmlhttp.open("GET", url, false);
29+
xmlhttp.send();
3030

3131
//if the http code is 200 then perform the following
3232
if (status_code == 200) {

templates/Dashboards/status/wer_wahl_warten.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
{% block body %}
55

6-
7-
86
<div class="container-fluid" style="margin-top: 30px">
97
<h1>
108
Bitte warte bis alle Stimmberechtigten zu einem Ergebnis gekommen sind

werwolf.py

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,26 +1224,25 @@ def erhalte_ziel(token: str):
12241224
return "falscher Status"
12251225

12261226

1227-
def nurNamen()-> list:
1228-
with open("rollen_log.txt") as players_log: # open the log file
1229-
players_log = players_log.readlines() # read the log file
1230-
1231-
nurNamen = [] # create a list with the names
1232-
1233-
1234-
for line in players_log: # for every line in the log file
1235-
1236-
if "*" in line: # if the line contains a *
1237-
pass # do nothing
1238-
else: # if the line does not contain a *
1239-
line = line.split(" = ") # split the line at the =
1240-
name_line = line[0]
1241-
# set the role to the second part of the line
1242-
auswahlRolle = line[1]
1243-
1244-
# if the role is not Tot or the role is not the Erzähler
1245-
if auswahlRolle not in ("Tot", "Erzaehler"):
1246-
# append the name to the list
1247-
nurNamen.append(name_line)
1248-
1249-
return nurNamen
1227+
def nurNamen() -> list:
1228+
with open("rollen_log.txt") as players_log: # open the log file
1229+
players_log = players_log.readlines() # read the log file
1230+
1231+
nurNamen = [] # create a list with the names
1232+
1233+
for line in players_log: # for every line in the log file
1234+
1235+
if "*" in line: # if the line contains a *
1236+
pass # do nothing
1237+
else: # if the line does not contain a *
1238+
line = line.split(" = ") # split the line at the =
1239+
name_line = line[0]
1240+
# set the role to the second part of the line
1241+
auswahlRolle = line[1]
1242+
1243+
# if the role is not Tot or the role is not the Erzähler
1244+
if auswahlRolle not in ("Tot", "Erzaehler"):
1245+
# append the name to the list
1246+
nurNamen.append(name_line)
1247+
1248+
return nurNamen

0 commit comments

Comments
 (0)