{"action":"created","issue":{"url":"https://api.github.com/repos/SFTtech/openage/issues/288","labels_url":"https://api.github.com/repos/SFTtech/openage/issues/288/labels{/name}","comments_url":"https://api.github.com/repos/SFTtech/openage/issues/288/comments","events_url":"https://api.github.com/repos/SFTtech/openage/issues/288/events","html_url":"https://github.com/SFTtech/openage/pull/288","id":69881592,"number":288,"title":"cython-based C++-/Python interface","user":{"login":"mic-e","id":796624,"avatar_url":"https://avatars.githubusercontent.com/u/796624?v=3","gravatar_id":"","url":"https://api.github.com/users/mic-e","html_url":"https://github.com/mic-e","followers_url":"https://api.github.com/users/mic-e/followers","following_url":"https://api.github.com/users/mic-e/following{/other_user}","gists_url":"https://api.github.com/users/mic-e/gists{/gist_id}","starred_url":"https://api.github.com/users/mic-e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mic-e/subscriptions","organizations_url":"https://api.github.com/users/mic-e/orgs","repos_url":"https://api.github.com/users/mic-e/repos","events_url":"https://api.github.com/users/mic-e/events{/privacy}","received_events_url":"https://api.github.com/users/mic-e/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SFTtech/openage/labels/buildsystem","name":"buildsystem","color":"eb6420"},{"url":"https://api.github.com/repos/SFTtech/openage/labels/c++","name":"c++","color":"000000"},{"url":"https://api.github.com/repos/SFTtech/openage/labels/nice%20new%20thing","name":"nice new thing","color":"009800"},{"url":"https://api.github.com/repos/SFTtech/openage/labels/python","name":"python","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-21T15:48:46Z","updated_at":"2015-07-28T11:06:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SFTtech/openage/pulls/288","html_url":"https://github.com/SFTtech/openage/pull/288","diff_url":"https://github.com/SFTtech/openage/pull/288.diff","patch_url":"https://github.com/SFTtech/openage/pull/288.patch"},"body":" - openage is now a shared library\r\n - moved `py/openage` -> `openage`\r\n - moved `py/openage/codecompliance` -> `buildsystem/codecompliance`\r\n - moved `cpp/` -> `libopenage/`\r\n - moved `doc/implementation/` -> `doc/code`\r\n - integrated Cython into buildsystem\r\n - C++ -> Py function calling\r\n  - C++ API is specified in PXD annotations in `.h` files\r\n  - cpp/pyinterface/pyfunc.h\r\n   - Func<returntype, arg0type, arg1type, ...>\r\n   - Callable objects\r\n   - Designed to be filled with pointers to cdef functions\r\n   - __don't use raw function pointers in the interface__\r\n  - openage/cppinterface/setup.py\r\n   - setup() Fills the PyFunc pointers\r\n   - must be called before using libopenage functionality\r\n - Exception translation\r\n  - cpp/pyinterface/exctranslate.h\r\n   - translate_exc_cpp_to_py\r\n   - translate_exc_py_to_cpp\r\n  - py/cppinterface/exctranslate.py\r\n   - describe_exception\r\n   - raise_cpp_error\r\n  - C++ functions that are declared 'except +' if they may throw\r\n  - Python functions that are declared 'except *' if they may raise\r\n  - GIL-safe\r\n  - everything is translated back and forth\r\n   - metadata\r\n   - message\r\n   - backtrace\r\n - Documentation\r\n\r\nC++:\r\n\r\n - Overhauled exception code\r\n  - now lives in `error/error.h`\r\n  - exceptions automatically store their cause exception\r\n  - exceptions can collect backtraces\r\n  - see demo in `cpp/error/demo.cpp`\r\n  - Hierarchies may now be used\r\n  - `doc/code/exceptions`\r\n - Moved util/error.h to error/error\r\n - Added error/handlers.cpp, which provides a SIGSEGV and terminate handler\r\n - refactored LZXD code\r\n  - removed many C-isms and micro-optimizations\r\n  - simplified codeflow, split methods into smaller ones\r\n  - file split into multiple smaller ones (`cpp/util/compress`)\r\n  - `decompress` replaced by `decompress_frame`, which decompresses just\r\n    32768 bytes at a time instead of everything at once.\r\n  - exposed to Python using the PyInterface\r\n - Simplified C++ logging\r\n  - ExternalStringStream: like stringstream, but appends to a custom buffer\r\n - Modernized C++ testing\r\n  - now uses TestError (e.g. via the `TESTFAIL` macro) instead of return values.\r\n - C++ exceptions can collect backtraces\r\n - `SIGSEGV` and `std::terminate` handlers\r\n - Enum class that allows adding new members at runtime, and associated data.\r\n  - used by `log::lvl`\r\n - `util/init.h`: `OnInit` and `OnDeInit`: to call functions on dynamic initialization\r\n - fixed a bug with Timer\r\n\r\nPython:\r\n\r\n - Bumped Python version requirement to 3.4\r\n - Massive clean-up\r\n  - Unified all utility modules into the openage.util package\r\n  - Removed some code that got obsoleted in the process\r\n  - Made stuff more pylint-compliant\r\n  - Replaced home-brewn Enum and NamedObject implementations by enum.Enum\r\n - Implemented some utilities\r\n  - openage/util/fslike.py\r\n   - FileSystemLikeObject abstract base class\r\n   - Directory FileSystemLikeObject\r\n  - openage/util/filelike.py\r\n   - FileLikeObject abstract base class\r\n   - StreamSeekBuffer FileLikeObject\r\n   - StreamFragment FileLikeObject\r\n   - FIFO FileLikeObject\r\n  - FSLikeObject used by convert and codegen\r\n - Overhauled testing system\r\n  - openage.testing.testing.assert_result\r\n  - openage.testing.testing.assert_raises\r\n  - openage.testing.testing.TestError\r\n  - now done without CTest\r\n  - C++ and Python tests and demos all called via Python\r\n - Integrated cabextract/cab.py with the rest of the project\r\n  - now a FileSystemLikeObject\r\n  - takes a FileLikeObject as an argument\r\n  - added tests\r\n - PEFile has been refactored\r\n  - resource strings are now resolved\r\n  - the code uses NamedStructs\r\n - The Python logger now forwards to the C++ logger if the interface has been\r\n   initialized\r\n  - Central management of current loglevel\r\n   - `--verbose`, `--quiet`\r\n - Program has one single entry point: `openage.__main__.main()`\r\n  - run with `python3 -m openage`\r\n  - alternatively: `./run`\r\n  - subcommands: `game`, `test`, `codegen`\r\n - Media file conversion is now done when launching the game.\r\n\r\nBuildsystem:\r\n\r\n - added valgrind-python.supp, a valgrind suppression file.\r\n - added basic whitespace compliance checking for textfiles\r\n - added pylint code compliance checking\r\n  - Many files are not yet pylint-compliant; those have a header\r\n    '# TODO pylint: disable=C,R,whatever categories'\r\n - added selective code compliance checking (closes #229)\r\n - re-worked Makefile targets\r\n\r\ncloses #217 \r\n\r\nSee the various doc files, including [pyinterface](https://github.com/mic-e/openage/blob/pyinterface/doc/code/pyinterface.md), [testing](https://github.com/mic-e/openage/blob/pyinterface/doc/code/testing.md)\r\n\r\nSome things are still remaining to do, but they in no way prevent merging:\r\n\r\n - write interface for `FSLikeObject`\r\n  - use that interface for all asset handling (in C++)\r\n  - add `inotify` support to `FSLikeObject`\r\n - support for other sources for `openage.convert` (setup disk/.iso #82)\r\n\r\nNote: If you wish to start work that derives from this before it's been merged, which you should, if you're about to start any new branch, base it on [this commit](https://github.com/mic-e/openage/commit/483c482649fa026cee8fe4024237f34f23255ab3). That commit is guaranteed to end up as-is in `openage/master`."},"comment":{"url":"https://api.github.com/repos/SFTtech/openage/issues/comments/125559676","html_url":"https://github.com/SFTtech/openage/pull/288#issuecomment-125559676","issue_url":"https://api.github.com/repos/SFTtech/openage/issues/288","id":125559676,"user":{"login":"mic-e","id":796624,"avatar_url":"https://avatars.githubusercontent.com/u/796624?v=3","gravatar_id":"","url":"https://api.github.com/users/mic-e","html_url":"https://github.com/mic-e","followers_url":"https://api.github.com/users/mic-e/followers","following_url":"https://api.github.com/users/mic-e/following{/other_user}","gists_url":"https://api.github.com/users/mic-e/gists{/gist_id}","starred_url":"https://api.github.com/users/mic-e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mic-e/subscriptions","organizations_url":"https://api.github.com/users/mic-e/orgs","repos_url":"https://api.github.com/users/mic-e/repos","events_url":"https://api.github.com/users/mic-e/events{/privacy}","received_events_url":"https://api.github.com/users/mic-e/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T11:05:59Z","updated_at":"2015-07-28T11:05:59Z","body":"This is now ready for merging."}}