Пример #1
0
class EntityTest(entity.Entity):
    """Testing..."""
    ival = entity.Field('i', entity.IntValue(default=345))
    sval = entity.Field('s', entity.StringValue(default='svvv'))
    bval = entity.Field('b', entity.BoolValue(default=True))
    fval = entity.Field('f', entity.FloatValue(default=1.0))
    grp = entity.CompoundField('g', CompoundTest())
    grp2 = entity.CompoundField('g2', CompoundTest2())
    enumval = entity.Field('e', entity.EnumValue(EnumTest, default=None))
    enumval2 = entity.Field(
        'e2', entity.OptionalEnumValue(EnumTest, default=EnumTest.SECOND))
    slval = entity.ListField('sl', entity.StringValue())
    tval2 = entity.Field('t2', entity.DateTimeValue())
    str_int_dict = entity.DictField('sd', str, entity.IntValue())
    compoundlist = entity.CompoundListField('l', CompoundTest())
    compoundlist2 = entity.CompoundListField('l2', CompoundTest())
    compoundlist3 = entity.CompoundListField('l3', CompoundTest2())
    compounddict = entity.CompoundDictField('td', str, CompoundTest())
    compounddict2 = entity.CompoundDictField('td2', str, CompoundTest())
    compounddict3 = entity.CompoundDictField('td3', str, CompoundTest2())
    fval2 = entity.Field('f2', entity.Float3Value())
Пример #2
0
class AssetPackageBuildState(entity.Entity):
    """Contains info about an in-progress asset cloud build."""

    # Asset names still being built.
    in_progress_builds = entity.ListField('b', entity.StringValue())

    # The initial number of assets needing to be built.
    initial_build_count = entity.Field('c', entity.IntValue())

    # Build error string. If this is present, it should be presented
    # to the user and they should required to explicitly restart the build
    # in some way if desired.
    error = entity.Field('e', entity.OptionalStringValue())
Пример #3
0
class CompoundTest2(CompoundTest):
    """Testing..."""
    isubval2 = entity.Field('i2', entity.IntValue(default=3453))
Пример #4
0
class CompoundTest(entity.CompoundValue):
    """Testing..."""
    isubval = entity.Field('i', entity.IntValue(default=34532))
    compoundlist = entity.CompoundListField('l', SubCompoundTest())
Пример #5
0
 class EntityTestD2(entity.Entity):
     """Testing store_default on (the default)."""
     ival = entity.Field('i', entity.IntValue(default=3))
Пример #6
0
 class EntityTestD(entity.Entity):
     """Testing store_default off."""
     ival = entity.Field('i', entity.IntValue(default=3,
                                              store_default=False))
Пример #7
0
 class EntityKeyTest2(entity.Entity):
     """Test entity with invalid duplicate keys."""
     ival = entity.Field('i', entity.IntValue())
Пример #8
0
 class EmbCompoundTest2(entity.Entity):
     """Testing..."""
     isubval = entity.Field('i', entity.IntValue(default=12345))
     sub = entity.CompoundField('sub', EmbCompoundValTest2())
Пример #9
0
 class EmbCompoundValTest(entity.CompoundValue):
     """Testing..."""
     isubval = entity.Field('i', entity.IntValue(default=12345))
Пример #10
0
class ServerNodeEntry(entity.CompoundValue):
    """Information about a specific server."""
    region = entity.Field('r', entity.StringValue())
    address = entity.Field('a', entity.StringValue())
    port = entity.Field('p', entity.IntValue())