# Path: celestia/gui/currenciesframe.py
# class CurrencyFrame(ttk.Frame, object):
#     value = TkVarDescriptor(tk.StringVar)
# 
#     def __init__(self, parent, text, value, limit, offset):
#         ttk.Frame.__init__(self, parent)
#         self.parent = parent
# 
#         self.value = value
# 
#         self._label = ttk.Label(self.parent, text=text)
#         self._entry = ttk.Entry(self.parent, textvariable=CurrencyFrame.value.raw_klass(self))
#         self._limit = ttk.Label(self.parent, text="(Limit: {})".format(limit))
# 
#         options = dict(padx=10, pady=4)
#         self._label.grid(row=offset, column=0, sticky=W, **options)
#         self._entry.grid(row=offset, column=1, sticky=NSEW, **options)
#         self._limit.grid(row=offset, column=2, sticky=NSEW, **options)
# 
# Path: celestia/utility/tkvardescriptor.py
# class TkVarDescriptor(object):
#     def __init__(self, klass):
#         self.label = None
#         self.klass = klass
# 
#     def __get__(self, instance, objtype=None):
#         if instance is None:
#             return self
#         return instance.__dict__[self.label].get()
# 
#     def __set__(self, instance, value):
#         if self.label not in instance.__dict__:
#             instance.__dict__[self.label] = self.klass(instance)
#         instance.__dict__[self.label].set(value)
# 
#     def raw_klass(self, instance):
#         return instance.__dict__[self.label]
# 
# class TkVarDescriptorOwner(type):
#     def __new__(cls, name, bases, attrs):
#         for key, value in attrs.items():
#             if isinstance(value, TkVarDescriptor):
#                 value.label = key
#         return super(TkVarDescriptorOwner, cls).__new__(cls, name, bases, attrs)


import six
    import tkinter as tk
    import tkinter.ttk as ttk
    import Tkinter as tk
    import ttk
    from tkinter.constants import N, S, E, W, NSEW
    from Tkconstants import N, S, E, W, NSEW
from celestia.gui.currenciesframe import CurrencyFrame
from celestia.utility.tkvardescriptor import TkVarDescriptor, TkVarDescriptorOwner
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# File: playerframe.py
# by Arzaroth Lekva
# lekva@arzaroth.com
#

from __future__ import print_function, absolute_import, unicode_literals

try:
    # py3
except ImportError:
    # py2

@six.add_metaclass(TkVarDescriptorOwner)
class PlayerFrame(ttk.Frame, object):
    complete_quests = TkVarDescriptor(tk.BooleanVar)

    def __init__(self, parent, xml_handle):
        ttk.Frame.__init__(self, parent, height=400)
        self.grid_propagate(0)

        self._xml_handle = xml_handle
        self._player_infos = {}
        for n, (name, typ) in enumerate(xml_handle.player_infos.items()):

# Path: celestia/gui/currenciesframe.py
# class CurrencyFrame(ttk.Frame, object):
#     value = TkVarDescriptor(tk.StringVar)
# 
#     def __init__(self, parent, text, value, limit, offset):
#         ttk.Frame.__init__(self, parent)
#         self.parent = parent
# 
#         self.value = value
# 
#         self._label = ttk.Label(self.parent, text=text)
#         self._entry = ttk.Entry(self.parent, textvariable=CurrencyFrame.value.raw_klass(self))
#         self._limit = ttk.Label(self.parent, text="(Limit: {})".format(limit))
# 
#         options = dict(padx=10, pady=4)
#         self._label.grid(row=offset, column=0, sticky=W, **options)
#         self._entry.grid(row=offset, column=1, sticky=NSEW, **options)
#         self._limit.grid(row=offset, column=2, sticky=NSEW, **options)
# 
# Path: celestia/utility/tkvardescriptor.py
# class TkVarDescriptor(object):
#     def __init__(self, klass):
#         self.label = None
#         self.klass = klass
# 
#     def __get__(self, instance, objtype=None):
#         if instance is None:
#             return self
#         return instance.__dict__[self.label].get()
# 
#     def __set__(self, instance, value):
#         if self.label not in instance.__dict__:
#             instance.__dict__[self.label] = self.klass(instance)
#         instance.__dict__[self.label].set(value)
# 
#     def raw_klass(self, instance):
#         return instance.__dict__[self.label]
# 
# class TkVarDescriptorOwner(type):
#     def __new__(cls, name, bases, attrs):
#         for key, value in attrs.items():
#             if isinstance(value, TkVarDescriptor):
#                 value.label = key
#         return super(TkVarDescriptorOwner, cls).__new__(cls, name, bases, attrs)


# Path: celestia/gui/playerframe.py
import six
    import tkinter as tk
    import tkinter.ttk as ttk
    import Tkinter as tk
    import ttk
    from tkinter.constants import N, S, E, W, NSEW
    from Tkconstants import N, S, E, W, NSEW
from celestia.gui.currenciesframe import CurrencyFrame
from celestia.utility.tkvardescriptor import TkVarDescriptor, TkVarDescriptorOwner

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# File: playerframe.py
# by Arzaroth Lekva
# lekva@arzaroth.com
#

from __future__ import print_function, absolute_import, unicode_literals

try:
    # py3
except ImportError:
    # py2

@six.add_metaclass(TkVarDescriptorOwner)
class PlayerFrame(ttk.Frame, object):
    complete_quests = TkVarDescriptor(tk.BooleanVar)

    def __init__(self, parent, xml_handle):
        ttk.Frame.__init__(self, parent, height=400)
        self.grid_propagate(0)

        self._xml_handle = xml_handle
        self._player_infos = {}
        for n, (name, typ) in enumerate(xml_handle.player_infos.items()):

            self._player_infos[name] = CurrencyFrame(self, name, typ.value,