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 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 = {}

Loading…
Cancel
Save