From be0b8968651f98b962a18c4e750d6396c0fdaf47 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 15 Jan 2017 19:35:30 +0100 Subject: add functions to fancify items --- gamelocker/datatypes.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'gamelocker/datatypes.py') diff --git a/gamelocker/datatypes.py b/gamelocker/datatypes.py index cf89fad..74ce965 100644 --- a/gamelocker/datatypes.py +++ b/gamelocker/datatypes.py @@ -1,9 +1,15 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # pylint: disable=missing-docstring +""" +gamelocker.datatypes + +Classes and utility functions to map API responses to objects. +""" import inspect import sys +import gamelocker.strings from gamelocker.janus import DataMessage, Attribute @@ -38,15 +44,15 @@ class Player(DataMessage): key_id = attr(str, "id") name = attr(str, "name") - stats = attr(dict, "stats") + stats = attr(gamelocker.strings.Stats, "stats") class Participant(DataMessage): type_name = "participant" key_id = attr(str, "id") - actor = attr(str, "actor") - stats = attr(dict, "stats") + actor = attr(gamelocker.strings.Hero, "actor") + stats = attr(gamelocker.strings.Stats, "stats") player = rel(Player, "player") @@ -62,7 +68,7 @@ class Roster(DataMessage): type_name = "roster" key_id = attr(str, "id") - stats = attr(dict, "stats") + stats = attr(gamelocker.strings.Stats, "stats") participants = rel(Participant, "participants") team = rel(Team, "team") @@ -77,7 +83,7 @@ class Match(DataMessage): gameMode = attr(str, "gameMode") patchVersion = attr(str, "patchVersion") region = attr(str, "region") - stats = attr(dict, "stats") + stats = attr(gamelocker.strings.Stats, "stats") rosters = rel(Roster, "rosters") -- cgit v1.3.1