master
Marek Baczynski 7 years ago
parent e51ec1edc2
commit 4a9c72dd4a

@ -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"}] [{"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"}]

@ -1,7 +1,15 @@
import random import random
import operator import operator
import json 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" configFileName = "kukconfig.json"
people = {} people = {}
@ -10,12 +18,14 @@ class Person(object):
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
self.kukPoints = 0 self.kukPoints = 0
self.password = ''
people[name] = self people[name] = self
@classmethod @classmethod
def fromFile(self, name, kukPoints): def fromFile(self, name, kukPoints, password):
person = Person(name) person = Person(name)
person.kukPoints = kukPoints person.kukPoints = kukPoints
person.password = password
@staticmethod @staticmethod
def get(name): def get(name):
@ -123,7 +133,7 @@ def load():
print "no people file!" print "no people file!"
return return
for person in fileData: for person in fileData:
Person.fromFile(person['name'], person['kukPoints']) Person.fromFile(person['name'], person['kukPoints'], person['password'])
kukPointTable = {} kukPointTable = {}

Loading…
Cancel
Save