From 4a9c72dd4aa441bfa5d6327ee5453db779a570e1 Mon Sep 17 00:00:00 2001 From: Marek Baczynski Date: Sun, 8 Oct 2017 17:54:01 +0200 Subject: [PATCH] passwords --- People.json | 2 +- kuk.py | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/People.json b/People.json index 88fb5da..f2ca656 100644 --- a/People.json +++ b/People.json @@ -1 +1 @@ -[{"kukPoints": -23, "name": "Marek"}, {"kukPoints": 46, "name": "Ahmed"}, {"kukPoints": 0, "name": "David"}, {"kukPoints": -9, "name": "Sven"}, {"kukPoints": 43, "name": "Wille"}, {"kukPoints": -57, "name": "Davide"}] \ No newline at end of file +[{"kukPoints": -23, "name": "Marek", "password":"yes"}, {"kukPoints": 46, "name": "Ahmed", "password":"yes"}, {"kukPoints": 0, "name": "David", "password":"yes"}, {"kukPoints": -9, "name": "Sven", "password":"yes"}, {"kukPoints": 43, "name": "Wille", "password":"yes"}, {"kukPoints": -57, "name": "Davide", "password":"yes"}] \ No newline at end of file diff --git a/kuk.py b/kuk.py index a734f3d..c4c8682 100644 --- a/kuk.py +++ b/kuk.py @@ -1,7 +1,15 @@ import random import operator import json - +#from flask import Flask, Response, redirect, url_for, request, session, abort, render_template +#from flask_login import LoginManager, UserMixin, login_required, login_user, logout_user +#app = Flask(__name__) + +# config +#app.config.update( +# DEBUG = True, +# SECRET_KEY = 'secret_xxx' +#) configFileName = "kukconfig.json" people = {} @@ -9,13 +17,15 @@ class Person(object): global people def __init__(self, name): self.name = name - self.kukPoints = 0 + self.kukPoints = 0 + self.password = '' people[name] = self @classmethod - def fromFile(self, name, kukPoints): + def fromFile(self, name, kukPoints, password): person = Person(name) person.kukPoints = kukPoints + person.password = password @staticmethod def get(name): @@ -123,7 +133,7 @@ def load(): print "no people file!" return for person in fileData: - Person.fromFile(person['name'], person['kukPoints']) + Person.fromFile(person['name'], person['kukPoints'], person['password']) kukPointTable = {}