Python: Added support for file_identifiers (#5123)
authorJoseph Pyott <joseph@pyott.me>
Fri, 26 Jul 2019 18:06:25 +0000 (14:06 -0400)
committerWouter van Oortmerssen <aardappel@gmail.com>
Fri, 26 Jul 2019 18:06:25 +0000 (11:06 -0700)
commit9fa8245e81a2fd8ad19f9ae8f3da3a00e796e462
treecc64e4a10c55c94fa7be0e81ac08abe08d4984fa
parenta5ca8bee4d56df1588b21d667135be351d6c0e75
Python: Added support for file_identifiers (#5123)

* Python: Added support for file_identifiers

* Added tests. Fixed file_identifier code.

* Python: Fixed excessive padding of file_identifier. Repaired tests.

* Python: Made code compatible with python2.7

* Python: Typo fix in @endcond

* whitespace normaalization

* Stylistic change from if(not X is None) to if(X is not None). Added comment to type string.

* Python: Added support for automatic code generation of file_identifiers. Added tests for said code generation.

* converted sprintf to snprintf

* Bugfix, added snprint deffinition for MSVC

* changed snprint deffinition for MSVC to sprint_s

* changed scanf to IntToStringHex. Renamed HasFileIdentifier to GenHasFileIdentifier.

* Added updated genereated code to commit

* Python bugix: flatc no longer produces HasFileIdentfier for shcemas with no file identifier

* Added tests to verify `MonsterBufferHasIdentifier` returns false on no Identifier

* Python: added tests for GetBufferIdentifier and BufferHasIdentifier
Python: removed unessasary parenethesis in if statements
Minor format changes.

* Python : correceted instances of keyword arguments being called as positional arguments

* fixed typos and grammer in comments

* Minor style fixes

* Indentation fix

* Equals style changes

* Python: Fixed Alignment Issues. Changed test code to test against atual output

* Ran make(forgot to run make last commit)

* Python: Style changes

* Style changes

* indentation and style

* readded CONTRIBUTING.md

* Formatting tweak

Mostly to make CI run again

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Formatting fix

* More formatting fixes

* Formatting

* ran generate_code.sh
15 files changed:
python/flatbuffers/builder.py
python/flatbuffers/encode.py
python/flatbuffers/util.py
src/idl_gen_python.cpp
tests/MyGame/Example/ArrayTable.py
tests/MyGame/Example/Monster.py
tests/MyGame/Example/Referrable.py
tests/MyGame/Example/Stat.py
tests/MyGame/Example/TestSimpleTableWithEnum.py
tests/MyGame/Example/TypeAliases.py
tests/MyGame/Example2/Monster.py
tests/MyGame/InParentNamespace.py
tests/MyGame/MonsterExtra.py
tests/monsterdata_python_wire.mon
tests/py_test.py