8000 fix : codefactor issues fixed. · sadrasabouri/mafia@73e257e · GitHub
[go: up one dir, main page]

Skip to content

Commit 73e257e

Browse files
committed
fix : codefactor issues fixed.
1 parent 4956544 commit 73e257e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mafia.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from random import randrange, shuffle
33
from flask import Flask, render_template, url_for, request
44
from flask_httpauth import HTTPBasicAuth
5-
from mafia_params import *
5+
from mafia_params import ordered_roles, nRoles, role2team, descriptions, descriptions_fa, role2fa
66
from player import Player
77

88
app = Flask(__name__)
@@ -25,7 +25,7 @@ def verify_password(username, password):
2525
@app.route('/')
2626
@auth.login_required
2727
def index():
28-
global id, ip2player
28+
global player_id, ip2player
2929
username = str(auth.current_user())
3030
role = ""
3131
image_name = ""
@@ -34,16 +34,16 @@ def index():
3434
if ip in ip2player.keys():
3535
return render_template("Player.html", player=ip2player[ip])
3636
else:
37-
if id > nPlayers:
37+
if player_id > nPlayers:
3838
return render_template("404.html", is_farsi=True)
39-
role = roles[id]
39+
role = roles[player_id]
4040
image_name = role + "_" + str(randrange(1, nRoles[role] + 1))
4141
ip2player[ip] = Player(ip, username, role, image_name)
4242
print("*" * 20, "New Player","*" * 20)
43-
toGod = ip + " : " + str(id) + " : " + username + " --> " + role
43+
toGod = ip + " : " + str(player_id) + " : " + username + " --> " + role
4444
toGod += "/" + role2fa[role] #TODO: Just in Farsi Mode
4545
print(toGod)
46-
id += 1
46+
player_id += 1
4747
return render_template("index.html",
4848
image_name=image_name,
4949
role_name=role, role_name_fa=role2fa[role],
@@ -83,7 +83,7 @@ def GOD_PAGE():
8383
if request.args.get("Comment") is not None:
8484
ip = request.args.get("Comment")
8585
if ip in ip2player.keys():
86-
if ip2player[ip].get_comment() == False:
86+
if ip2player[ip].get_comment() is False:
8787
if nComments <= nPlayers // 3:
8888
ip2player[ip].set_comment(True)
8989
nComments += 1

0 commit comments

Comments
 (0)
0