# -*- coding: utf-8 -*-
from werobot.utils import to_text


class BaseEntry(object):
    def __init__(self, entry, default=None):
        self.entry = entry
        self.default = default


class IntEntry(BaseEntry):
    def __get__(self, instance, owner):
        try:
            v = int(instance.__dict__.get(self.entry, self.default))
        except TypeError:
            v = None
        return v


class FloatEntry(BaseEntry):
    def __get__(self, instance, owner):
        try:
            v = float(instance.__dict__.get(self.entry, self.default))
        except TypeError:
            v = None
        return v


class StringEntry(BaseEntry):
    def __get__(self, instance, owner):
        v = instance.__dict__.get(self.entry, self.default)
        if v is not None:
            return to_text(v)
        return v


class DictEntry(BaseEntry):
    def __get__(self, instance, owner):
        v = instance.__dict__.get(self.entry, self.default)
        return v

4dc4445b9a58210f9e66e58330be819b05b18c12
<mask token>


class FloatEntry(BaseEntry):

    def __get__(self, instance, owner):
        try:
            v = float(instance.__dict__.get(self.entry, self.default))
        except TypeError:
            v = None
        return v


class StringEntry(BaseEntry):

    def __get__(self, instance, owner):
        v = instance.__dict__.get(self.entry, self.default)
        if v is not None:
            return to_text(v)
        return v


class DictEntry(BaseEntry):

    def __get__(self, instance, owner):
        v = instance.__dict__.get(self.entry, self.default)
        return v

<mask token>


class IntEntry(BaseEntry):

    def __get__(self, instance, owner):
        try:
            v = int(instance.__dict__.get(self.entry, self.default))
        except TypeError:
            v = None
        return v


class FloatEntry(BaseEntry):

    def __get__(self, instance, owner):
        try:
            v = float(instance.__dict__.get(self.entry, self.default))
        except TypeError:
            v = None
        return v


class StringEntry(BaseEntry):

    def __get__(self, instance, owner):
        v = instance.__dict__.get(self.entry, self.default)
        if v is not None:
            return to_text(v)
        return v


class DictEntry(BaseEntry):

    def __get__(self, instance, owner):
        v = instance.__dict__.get(self.entry, self.default)
        return v

<mask token>


class BaseEntry(object):
    <mask token>


class IntEntry(BaseEntry):

    def __get__(self, instance, owner):
        try:
            v = int(instance.__dict__.get(self.entry, self.default))
        except TypeError:
            v = None
        return v


class FloatEntry(BaseEntry):

    def __get__(self, instance, owner):
        try:
            v = float(instance.__dict__.get(self.entry, self.default))
        except TypeError:
            v = None
        return v


class StringEntry(BaseEntry):

    def __get__(self, instance, owner):
        v = instance.__dict__.get(self.entry, self.default)
        if v is not None:
            return to_text(v)
        return v


class DictEntry(BaseEntry):

    def __get__(self, instance, owner):
        v = instance.__dict__.get(self.entry, self.default)
        return v

from werobot.utils import to_text


class BaseEntry(object):

    def __init__(self, entry, default=None):
        self.entry = entry
        self.default = default


class IntEntry(BaseEntry):

    def __get__(self, instance, owner):
        try:
            v = int(instance.__dict__.get(self.entry, self.default))
        except TypeError:
            v = None
        return v


class FloatEntry(BaseEntry):

    def __get__(self, instance, owner):
        try:
            v = float(instance.__dict__.get(self.entry, self.default))
        except TypeError:
            v = None
        return v


class StringEntry(BaseEntry):

    def __get__(self, instance, owner):
        v = instance.__dict__.get(self.entry, self.default)
        if v is not None:
            return to_text(v)
        return v


class DictEntry(BaseEntry):

    def __get__(self, instance, owner):
        v = instance.__dict__.get(self.entry, self.default)
        return v

# -*- coding: utf-8 -*-
from werobot.utils import to_text


class BaseEntry(object):
    def __init__(self, entry, default=None):
        self.entry = entry
        self.default = default


class IntEntry(BaseEntry):
    def __get__(self, instance, owner):
        try:
            v = int(instance.__dict__.get(self.entry, self.default))
        except TypeError:
            v = None
        return v


class FloatEntry(BaseEntry):
    def __get__(self, instance, owner):
        try:
            v = float(instance.__dict__.get(self.entry, self.default))
        except TypeError:
            v = None
        return v


class StringEntry(BaseEntry):
    def __get__(self, instance, owner):
        v = instance.__dict__.get(self.entry, self.default)
        if v is not None:
            return to_text(v)
        return v


class DictEntry(BaseEntry):
    def __get__(self, instance, owner):
        v = instance.__dict__.get(self.entry, self.default)
        return v
