mirror of
https://github.com/google/flatbuffers.git
synced 2025-04-08 09:12:14 +08:00
* Enable --gen-onefile in Python Made it possible to generate all python code in one file. Modified py_test.py so that it can switch between the multi-file code and the one-file code. Updated PythonTest.sh and py_test.py so that the multi-file code and the one-file code can be tested based on the same test code. * Sync with google/flatbuffers * Add --gen-onefile to generate_code.py
25 lines
838 B
Python
25 lines
838 B
Python
# automatically generated by the FlatBuffers compiler, do not modify
|
|
|
|
# namespace: Example
|
|
|
|
class AnyAmbiguousAliases(object):
|
|
NONE = 0
|
|
M1 = 1
|
|
M2 = 2
|
|
M3 = 3
|
|
|
|
def AnyAmbiguousAliasesCreator(unionType, table):
|
|
from flatbuffers.table import Table
|
|
if not isinstance(table, Table):
|
|
return None
|
|
if unionType == AnyAmbiguousAliases().M1:
|
|
import MyGame.Example.Monster
|
|
return MyGame.Example.Monster.MonsterT.InitFromBuf(table.Bytes, table.Pos)
|
|
if unionType == AnyAmbiguousAliases().M2:
|
|
import MyGame.Example.Monster
|
|
return MyGame.Example.Monster.MonsterT.InitFromBuf(table.Bytes, table.Pos)
|
|
if unionType == AnyAmbiguousAliases().M3:
|
|
import MyGame.Example.Monster
|
|
return MyGame.Example.Monster.MonsterT.InitFromBuf(table.Bytes, table.Pos)
|
|
return None
|