diff --git a/README b/README index 18e3f9b..7ea7719 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ Le serveur a besoin des droits en écriture sur la base SQLite3 et le répertoire la contenant. -Histoire : bbc -> lhark -> guimoz +Histoire : bbc -> lhark -> guimoz -> Klafyvel + volgarr + Yoann diff --git a/assholes b/assholes index 4c41dba..b27aed7 100644 --- a/assholes +++ b/assholes @@ -1,2 +1,4 @@ Luc Absil -Louis-Guillaume Dubois +Matthieu Michelet +Clara Husson +Melchior Garapin diff --git a/import_bdd.py b/import_bdd.py index 772d6a7..0746318 100644 --- a/import_bdd.py +++ b/import_bdd.py @@ -8,28 +8,37 @@ def connect_sql(): passwd="q5kBLchS6ooAZDSxMeJG2gdf4gmJcfS5", # your password db="roulette") # name of the data base - -# Connexion à la base SQLite locale -con = connect_sql() -cur = con.cursor() -# cur.execute('''create table players (id,prenom,nom, etat)''') -# cur.execute('''create table machines (id,uid_user,ip)''') -cur.execute("""select id from players""") -players = cur.fetchall() -players = [player[0] for player in players] - -cur.execute("""select ip from machines""") -machines = cur.fetchall() -machines = [machine[0] for machine in machines] - -for user in User.objects.filter(school=1): - if user.has_access() and (user.is_adherent() or user.end_adhesion()): - if user.uid_number not in players: - cur.execute("""insert into players values (?,?,?,?)""",(user.uid_number, user.name, user.surname, 0)) - print(user.surname+' '+user.name) - for m in Machine.objects.filter(user= user): - for i in Interface.objects.filter(machine = m): - if i.ipv4.ipv4 not in machines: - cur.execute("""insert into machines values (?,?,?) """,(i.id, user.uid_number, i.ipv4.ipv4)) - -con.close() +def process(): + # Connexion à la base SQLite locale + con = connect_sql() + cur = con.cursor() + print("Drop tables") + cur.execute('''drop table if exists players''') + cur.execute('''drop table if exists machines''') + print("create tables") + cur.execute('''create table players (id int,firstname text,name text, ban_end float)''') + cur.execute('''create table machines (id int,player_id int,ip text)''') + print("select players") + cur.execute("""select id from players""") + players = cur.fetchall() + players = [player[0] for player in players] + + print("select machines") + cur.execute("""select ip from machines""") + machines = cur.fetchall() + machines = [machine[0] for machine in machines] + u = User.objects.filter(school=1) + print("Let's go !!!") + for x,user in enumerate(u): + print("Avancement : {}%".format(round(x/len(u)*100, 2)), end="\r") + if user.has_access() and (user.is_adherent() or user.end_adhesion()): + if user.uid_number not in players: + s = """insert into players values ({},"{}","{}",{});""".format(user.uid_number, user.name, user.surname, 0) + cur.execute(s) + for m in Machine.objects.filter(user= user): + for i in Interface.objects.filter(machine = m): + if i.ipv4.ipv4 not in machines: + s = """insert into machines values ({},{},"{}") ;""".format(i.id, user.uid_number, i.ipv4.ipv4) + cur.execute(s) + con.commit() + con.close() diff --git a/roulette.py b/roulette.py index fa398e2..6517881 100644 --- a/roulette.py +++ b/roulette.py @@ -171,8 +171,8 @@ def get_players_not_banned(): def cheat(player_id, target_id): success = random.choice([True, False]) try: - # ok = [line.strip().partition(' ') for line in IMMUNITY] - # ok = [get_player_from_full_name(names[0], names[2])['id'] for names in ok] + ok = [line.strip().partition(' ') for line in IMMUNITY] + ok = [get_player_from_full_name(names[0], names[2])['id'] for names in ok] ko = [line.strip().partition(' ') for line in ASSHOLES] ko = [get_player_from_full_name(names[0], names[2])['id'] for names in ko] @@ -181,8 +181,8 @@ def cheat(player_id, target_id): success = True elif player_id in ko: success = False - # elif target_id in ok: - # success = False + elif target_id in ok: + success = False except TypeError: pass diff --git a/state b/state index eb0e904..e31ee94 100644 --- a/state +++ b/state @@ -1 +1 @@ -down +up diff --git a/static/img/asocial_metzwork_v1.png b/static/img/asocial_metzwork_v1.png deleted file mode 100644 index 1f643cb..0000000 Binary files a/static/img/asocial_metzwork_v1.png and /dev/null differ diff --git a/static/img/banner.svg b/static/img/banner.svg new file mode 100644 index 0000000..b543efc --- /dev/null +++ b/static/img/banner.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/img/corner_bottomleft.png b/static/img/corner_bottomleft.png deleted file mode 100644 index fd03428..0000000 Binary files a/static/img/corner_bottomleft.png and /dev/null differ diff --git a/static/img/corner_bottomright.png b/static/img/corner_bottomright.png deleted file mode 100644 index 1cde1b7..0000000 Binary files a/static/img/corner_bottomright.png and /dev/null differ diff --git a/static/img/corner_topleft.png b/static/img/corner_topleft.png deleted file mode 100644 index 9d16b63..0000000 Binary files a/static/img/corner_topleft.png and /dev/null differ diff --git a/static/img/corner_topright.png b/static/img/corner_topright.png deleted file mode 100644 index 2fccb2e..0000000 Binary files a/static/img/corner_topright.png and /dev/null differ diff --git a/static/img/k6lqsh.png b/static/img/k6lqsh.png deleted file mode 100644 index 66d0468..0000000 Binary files a/static/img/k6lqsh.png and /dev/null differ diff --git a/static/img/metzquetaires_or.png b/static/img/metzquetaires_or.png deleted file mode 100644 index 17b2661..0000000 Binary files a/static/img/metzquetaires_or.png and /dev/null differ diff --git a/static/img_red/asocial_metzwork_v1.png b/static/img_red/asocial_metzwork_v1.png deleted file mode 100644 index 1f643cb..0000000 Binary files a/static/img_red/asocial_metzwork_v1.png and /dev/null differ diff --git a/static/img_red/corner_bottomleft.png b/static/img_red/corner_bottomleft.png deleted file mode 100644 index 02c9b30..0000000 Binary files a/static/img_red/corner_bottomleft.png and /dev/null differ diff --git a/static/img_red/corner_bottomright.png b/static/img_red/corner_bottomright.png deleted file mode 100644 index 7205d0f..0000000 Binary files a/static/img_red/corner_bottomright.png and /dev/null differ diff --git a/static/img_red/corner_topleft.png b/static/img_red/corner_topleft.png deleted file mode 100644 index 6004abd..0000000 Binary files a/static/img_red/corner_topleft.png and /dev/null differ diff --git a/static/img_red/corner_topright.png b/static/img_red/corner_topright.png deleted file mode 100644 index 402e0cf..0000000 Binary files a/static/img_red/corner_topright.png and /dev/null differ diff --git a/static/img_red/k6lqsh.png b/static/img_red/k6lqsh.png deleted file mode 100644 index 51d8119..0000000 Binary files a/static/img_red/k6lqsh.png and /dev/null differ diff --git a/static/img_red/metzquetaires_or.png b/static/img_red/metzquetaires_or.png deleted file mode 100644 index f741bf8..0000000 Binary files a/static/img_red/metzquetaires_or.png and /dev/null differ diff --git a/static/style.cs b/static/style.cs new file mode 100644 index 0000000..e69de29 diff --git a/static/style.css b/static/style.css index 1a08446..d6e0590 100644 --- a/static/style.css +++ b/static/style.css @@ -1,5 +1,5 @@ body { - background: #3b5998; + background: #2ecc71; color: white; text-align: center; font-family: helvetica, sans; @@ -19,8 +19,8 @@ a { } #banner { - height: 301px; - background: center center url('img/metzquetaires_or.png') no-repeat; + height: 100px; + background: center center url('img/banner.svg') no-repeat; padding: 10px 10px; } @@ -34,45 +34,7 @@ a { padding-right: 12px; padding-top: 10px; padding-bottom: 10px; -} - -#content_container div.corner { - height: 70px; - width: 70px; - background-repeat: no-repeat; - position: absolute; -} - -#content_topleft { - top: 0px; - left: 0px; - background-image: url('img/corner_topleft.png'); - background-color: #3b5998; - z-index: 1; -} - -#content_topright { - top: 0px; - right: 0px; - background-image: url('img/corner_topright.png'); - background-color: #3b5998; - z-index: 2; -} - -#content_bottomleft { - bottom: 0px; - left: 0px; - background-image: url('img/corner_bottomleft.png'); - background-color: #3b5998; - z-index: 3; -} - -#content_bottomright { - bottom: 0px; - right: 0px; - background-image: url('img/corner_bottomright.png'); - background-color: #3b5998; - z-index: 4; + border-radius:10px; } #content { diff --git a/templates/banned.html b/templates/banned.html index 651a526..834aa56 100644 --- a/templates/banned.html +++ b/templates/banned.html @@ -29,7 +29,7 @@ $(function () { plotShadow: false }, title: { - text: 'Etat du Rezo', + text: 'État du Rézo', align: 'center', verticalAlign: 'middle', y: 60 @@ -54,7 +54,7 @@ $(function () { }, series: [{ type: 'pie', - name: 'Pourcentage', + name: 'État du Rézo', innerSize: '50%', data: [ { diff --git a/templates/down.html b/templates/down.html index 350900b..146cae8 100644 --- a/templates/down.html +++ b/templates/down.html @@ -2,11 +2,7 @@ {% block content %}
- La rezo-roulette metzquetaire vous offre un répit temporaire. Profite bien {{ user['firstname']+' '+user['name'] }} ;-) -
- -- Rétablissement de la roulette vers midi. + La Rézoroulette Metzthernet vous offre un répit temporaire. Profite bien {{ user['firstname']+' '+user['name'] }} ;-)
@@ -35,7 +31,7 @@ $(function () { plotShadow: false }, title: { - text: 'Etat du Rezo', + text: 'État du Rézo', align: 'center', verticalAlign: 'middle', y: 60 @@ -60,7 +56,7 @@ $(function () { }, series: [{ type: 'pie', - name: 'Pourcentage', + name: 'État du Rézo', innerSize: '50%', data: [ { diff --git a/templates/home.html b/templates/home.html index 43e9715..970f646 100644 --- a/templates/home.html +++ b/templates/home.html @@ -1,7 +1,7 @@ {% extends "layout.html" %} {% block content %}- Reviens plus tard {{ user['firstname']+' '+user['name'] }} pour jouer à la rezo-roulette + Reviens plus tard {{ user['firstname']+' '+user['name'] }} pour jouer à la Rézoroulette.