Compare commits

...
713 Commits
Author SHA1 Message Date
pre-commit-ci[bot] e9d55a50a7 [pre-commit.ci] Pre-commit autoupdate. (#159)
updates:
- [github.com/pre-commit/mirrors-clang-format: v22.1.2 → v22.1.5](https://github.com/pre-commit/mirrors-clang-format/compare/v22.1.2...v22.1.5)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-07-08 15:54:09 +02:00
Jonathan Feenstra 17840a0d97 Fix typo in "Python Initialization failed" message (#158) 2026-06-04 09:01:06 +02:00
Mikaël Capelle 0b0f34b2da Change IExecutablesList.titleExists to contains to match UIBase name. (#157) 2026-05-08 12:54:40 +02:00
Jeremy Rimpo 1720aeedf8 Update vcpkg targets (#155) 2026-04-15 09:31:56 +02:00
Jeremy Rimpo 1c8ab3f1c1 Add blueprint prefix to game plugin (#156) 2026-04-15 09:01:02 +02:00
pre-commit-ci[bot] 5003bf75a7 [pre-commit.ci] Pre-commit autoupdate. (#153)
updates:
- [github.com/pre-commit/mirrors-clang-format: v21.1.8 → v22.1.2](https://github.com/pre-commit/mirrors-clang-format/compare/v21.1.8...v22.1.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-04-07 09:00:58 +02:00
Jonathan Feenstra b1ecd89c50 Add instance manager to plugin API (#152) 2026-02-08 10:28:25 +01:00
Jonathan Feenstra 076244faab Add executables list to plugin API (#151) 2026-01-31 16:49:51 +01:00
Jonathan Feenstra b81646562c Add instanceName and profiles methods to plugin API (#150) 2026-01-11 17:57:34 +01:00
pre-commit-ci[bot] 648db4db99 [pre-commit.ci] Pre-commit autoupdate. (#149)
updates:
- [github.com/pre-commit/mirrors-clang-format: v21.1.2 → v21.1.8](https://github.com/pre-commit/mirrors-clang-format/compare/v21.1.2...v21.1.8)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-05 19:32:00 +01:00
pre-commit-ci[bot] 15d74e5e76 [pre-commit.ci] Pre-commit autoupdate. (#148)
updates:
- [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0)
- [github.com/pre-commit/mirrors-clang-format: v20.1.7 → v21.1.2](https://github.com/pre-commit/mirrors-clang-format/compare/v20.1.7...v21.1.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-07 15:00:39 +02:00
Mikaël Capelle 4f3a9891fa Add missing IPlugin inheritance in installer bindings. (#147) 2025-09-30 20:22:52 +02:00
Jonathan Feenstra 6bed428d04 Extend Python plugin API with author and uploader data (#145) 2025-08-18 07:55:42 +02:00
Mikaël Capelle f16e51867a Allow non-cache build in CI when Azure variables are not available. (#146) 2025-08-17 12:00:35 +02:00
Mikaël Capelle c05027b653 Update following move of IFileTree glob() and walk() to free function. (#144) 2025-07-08 19:33:04 +02:00
pre-commit-ci[bot] 5726e65504 [pre-commit.ci] Pre-commit autoupdate. (#143)
* [pre-commit.ci] Pre-commit autoupdate.

updates:
- [github.com/pre-commit/mirrors-clang-format: v19.1.5 → v20.1.7](https://github.com/pre-commit/mirrors-clang-format/compare/v19.1.5...v20.1.7)

* [pre-commit.ci] Auto fixes from pre-commit.com hooks.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-07-07 20:38:02 +02:00
Mikaël Capelle b0d2b48524 Add bindings for IFileTree glob() and walk() generators (#142)
* Adding binding for new IFileTree glob and walk.
* Fix issues with Version binding.
2025-07-06 19:38:16 +02:00
Mikaël Capelle 00a6d5969b Use exact Python version and fix missing DLLs for plugin. (#141) 2025-07-02 08:16:47 +02:00
Mikaël Capelle 1010bfda55 Move to VCPKG (#133) 2025-05-29 11:03:51 +02:00
Jeremy Rimpo 9a788c9f3f Add game interfaces (#140)
- modDataDirectory defines mod directory that maps to 'Data'
- getModMappings allows mapping directories to multiple locations
2025-05-21 18:43:47 +02:00
Jonathan Feenstra 84bf90d575 Add form and header versions to IPluginList (#139) 2025-01-31 20:07:33 +01:00
Jonathan Feenstra 8c47cea270 Add startDownloadNexusFileForGame (#138) 2025-01-02 14:11:06 +01:00
Jeremy RimpoandJonathan Feenstra 5cdf0f6f19 Blueprint support (#136)
---------

Co-authored-by: Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com>
2024-10-03 09:45:05 +02:00
Jonathan Feenstra 4409375fd8 Add author and description methods to IPluginList (#135) 2024-09-28 19:58:34 +02:00
Jeremy Rimpo e11d5ec00d Support new pluginpreview interfaces (#130) 2024-07-11 11:27:19 +02:00
Mikaël Capelle 6623e19754 Expose INVALID_HANDLE_VALUE as mobase.INVALID_HANDLE_VALUE. (#131)
* Expose INVALID_HANDLE_VALUE as mobase.INVALID_HANDLE_VALUE.
* Add tests for startApplication() returning INVALID_HANDLE_VALUE.
* Clean tests and generate stub files for them.
2024-06-28 11:48:30 +02:00
Mikaël Capelle 7cfc761e40 Clean cmake test configuration after change to cmake_common. (#129)
* Clean cmake test configuration after change to cmake_common.
* Remove appveyor.yml.
2024-06-22 08:27:42 +02:00
Mikaël Capelle 5bb4de039e Fix for Python debug build (#128)
* Minor updates for debug Python/PyQt.
* Fix issue with destructor of lambda in shared holder.
2024-06-14 16:13:52 +02:00
Jeremy Rimpo 8c044e28c5 Starfield Creation Update: Convert overlay/override flags to medium flags (#127)
* Convert overlay/override flags to medium flags
2024-06-13 17:50:48 +02:00
Mikaël Capelle 790d0a1097 Refactoring of game features for better management. (#126) 2024-06-09 12:26:39 +02:00
Mikaël Capelle a966db7d19 Use more modern way to set Python paths and use PYTHONPATH environment variable when no paths is specified in runner. (#125) 2024-06-01 13:20:56 +02:00
Mikaël Capelle 86505f19ce Add bindings for getKnownFolders(). Move stuff to mobase.utils. (#122) 2024-05-25 14:34:47 +02:00
Mikaël Capelle a839d36235 Switch from fmtlib to std::format. (#124)
* Fix issue with latest pybind11.
* Switch from fmtlib to std::format.
* Set CMake policy CMP0144.
2024-05-25 13:15:10 +02:00
Jeremy Rimpo bb0a24a00d Merge pull request #119 from ModOrganizer2/2_5_x
Bump version to reflect 2.5.0 release
2023-12-16 16:31:45 -06:00
Mikaël Capelle ac7009d17f Configure Python to run in isolated mode. (#121) 2023-12-03 09:15:57 +01:00
Jeremy RimpoandMikaël Capelle cc1bc4cb7f Fix string conversion issues with emoji characters (#120)
* Fix load/cast of QString to avoid issues with surrogate pairs (emoji characters, ...).

---------

Co-authored-by: Mikaël Capelle <capelle.mikael@gmail.com>
2023-12-03 09:15:17 +01:00
Jeremy Rimpo ebede37865 Bump version to reflect 2.5.0 release 2023-11-24 21:15:34 -06:00
Jeremy Rimpo 7a885ad014 Merge pull request #117 from ModOrganizer2/plugin_updates
Add isDummy to IPluginList
2023-10-27 20:09:34 -05:00
Jeremy Rimpo ff3c601164 Use hasNoRecords 2023-10-18 23:04:16 -05:00
Jeremy Rimpo 655e60acb7 Add isDummy to IPluginList 2023-10-17 00:41:44 -05:00
Jeremy Rimpo e52163eb29 Merge pull request #116 from ModOrganizer2/overlay_support
Add isOverlayFlagged to IPluginList
2023-10-08 13:02:41 -05:00
Jeremy Rimpo 431caa9992 Add isOverlayFlagged to IPluginList 2023-10-08 04:13:58 -05:00
Mikaël Capelle a644546b41 Merge pull request #115 from ModOrganizer2/uibase_updates
Use defaults set in UIBase
2023-10-04 11:10:00 +02:00
Jeremy Rimpo 404fd3f4a3 Use defaults set in UIBase 2023-10-04 02:58:15 -05:00
Jeremy Rimpo 0be763f3d2 Merge pull request #114 from ModOrganizer2/loot_0_22
Plugin sorting updates
2023-10-03 23:17:31 -05:00
Jeremy Rimpo 7452df8bbb Plugin sorting updates
- Add enabledPlugins for core plugins which are enabled but NOT auto-loaded (may need to be written to plugins.txt or have an ambiguous load order position)
- General Starfield updates
  - Add enabledPlugins for "BlueprintShips-Starfield.esm"
  - Disable plugin management if sTestFile is in use (also applies to FO4)
  - Write the enabledPlugins to plugins.txt to enforce base game load order
  - Allow for LOOT sorting (dynamic based on settings)
- Incorporate enabledPlugins into force enabled plugins in plugin list
- Update various interface layers

TODO: Fix sort button to dynamically update if status changes
TODO: Auto refresh lists if the INI Editor is closed
2023-10-02 15:27:12 -05:00
Mikaël Capelle c6c7e5ef73 Merge pull request #113 from ModOrganizer2/dev/refresh-callback
Add onNextRefresh() and 2nd onAboutToRun bindings.
2023-09-29 08:24:02 +02:00
Mikaël Capelle 328b6e7710 Fix arity check for function arguments. 2023-09-27 20:22:34 +02:00
Mikaël Capelle eb2c874a39 Remove duplicated logger print. 2023-09-27 19:55:48 +02:00
Mikaël Capelle 5501814e00 Add onNextRefresh() and 2nd onAboutToRun bindings. 2023-09-26 21:41:27 +02:00
Jeremy Rimpo d1609a79ae Merge pull request #112 from ModOrganizer2/starfield
Starfield
2023-09-17 16:19:34 -05:00
Jeremy Rimpo 58737acf0e Fix lint issues 2023-09-13 03:35:36 -05:00
Jeremy Rimpo d3fec9c230 Add 'None' LoadOrderMechanism which disables managed plugins
- Primary plugins are still marked as loaded
2023-09-09 04:37:02 -05:00
Jeremy Rimpo b99a5115cb Implement 'override' plugin support 2023-09-05 13:25:00 -05:00
Jeremy Rimpo 923d600bc0 Merge remote-tracking branch 'origin/qt6' 2023-09-04 22:29:11 -05:00
Jeremy Rimpo ba80ce9e20 Use map so we can set an origin name 2023-09-04 19:39:40 -05:00
Jeremy Rimpo 57b30be723 Preliminary secondary data directory support 2023-09-04 18:02:54 -05:00
Mikaël Capelle f1e5d65868 Merge pull request #111 from ModOrganizer2/ci/mob-github-action
Switch to generic mob action.
2023-07-10 20:10:48 +02:00
Mikaël Capelle 5a8d3e1a72 Switch to generic mob action. 2023-07-10 19:59:53 +02:00
Mikaël Capelle 809157115f Merge pull request #110 from ModOrganizer2/dev/clean-formatting
Formatting (black, isort, clang, line-ending).
2023-07-10 09:41:54 +02:00
Mikael CAPELLE be9b614a5e Fix build workflow. 2023-07-10 09:32:09 +02:00
Mikael CAPELLE 0ee795ac6a Add black and isort to linting action. 2023-07-10 09:19:14 +02:00
Mikael CAPELLE d7c109c344 Add .git-blame-ignore-revs. 2023-07-10 09:13:21 +02:00
Mikael CAPELLE 7108d59267 Apply black/isort to Python files. 2023-07-10 09:12:34 +02:00
Mikael CAPELLE 1bffcfa8bf Fix line-ending and force them through gitattributes. 2023-07-10 09:12:20 +02:00
Mikaël Capelle 6c20f001ff Fix Github build Workflow for PR. 2023-07-09 18:09:46 +02:00
Mikaël Capelle 0fff26df0c Merge pull request #109 from Holt59/ci/initial-gh-action-for-build
Add Github Workflows
2023-07-09 17:10:28 +02:00
Mikaël Capelle a5d84297fc Fix some formatting with clang-format. 2023-07-09 17:07:44 +02:00
Mikaël Capelle 1bc51b6626 Add workflow to run clang-format. 2023-07-09 17:03:11 +02:00
Mikaël Capelle e6190bf4f7 Add basic Github CI action for testing. 2023-07-09 16:48:38 +02:00
Mikaël Capelle 788f982eab Merge pull request #108 from Holt59/fix/qt-type-caster
Fix Qt type caster for latest pybind11
2023-07-02 13:55:47 +02:00
Mikaël Capelle cb750e72d1 Merge branch 'qt6' into fix/qt-type-caster 2023-07-02 13:55:39 +02:00
Mikaël Capelle 1cdeb081b2 Fix conversion operators for Qt type casters with latest pybind11. 2023-04-09 20:41:57 +02:00
Mikaël Capelle 1effc57990 Fix Python package installation in CMake for tests. 2023-04-09 20:34:26 +02:00
Jeremy Rimpo 26d7de23f3 Fixes for PyQt6 updates 2022-10-07 02:07:11 -05:00
Mikaël Capelle 967f1d327b Fix IPluginModPage inheritance. 2022-05-13 20:29:04 +02:00
Mikaël Capelle 2430e85968 Fix an issue where delayed DLLs would not be found. 2022-05-09 19:46:14 +02:00
Mikaël Capelle 2eabaf1774 Back to a shared library for the runner. 2022-05-08 16:05:26 +02:00
Mikaël Capelle 40c6119515 Move tests to their own folder. 2022-05-08 11:14:01 +02:00
Mikaël Capelle efaea1edfe Better implementation for FileWrapper / DirectoryWrapper. 2022-05-07 13:58:59 +02:00
Mikaël Capelle e204c003ae Add GameFeatureType. 2022-05-06 23:34:48 +02:00
Mikaël Capelle 29fc11dfd8 Define the true MoVariant, FileWrapper and DirectoryWrapper inside mobase. 2022-05-06 23:18:08 +02:00
Mikaël Capelle cc11a1a4f7 Merge pull request #106 from ModOrganizer2/qt6-update
Documentation and minor updates
2022-05-06 22:29:51 +02:00
Mikaël Capelle 465059181a Add custom std::function<> caster. 2022-05-06 22:29:00 +02:00
Mikaël Capelle cb35c950cf Update documentation. Minor changes for clarity. 2022-05-06 22:06:55 +02:00
Mikaël Capelle e6c5923bb1 Make runner a static lib. Update translation paths. Clean CMake stuff. 2022-05-06 17:40:11 +02:00
Mikael Capelle 604c50d3b3 Add README and intermediate CMake. 2022-05-06 08:31:10 +02:00
Mikaël Capelle 5b32c4f024 More warnings. 2022-05-05 22:26:01 +02:00
Mikaël Capelle e788f44b85 Merge pull request #105 from ModOrganizer2/fix-unloading
Fix unloading of modules.
2022-05-05 22:03:48 +02:00
Mikaël Capelle 28210d3d7a Fix unloading of modules. Up warning levels to 4. 2022-05-05 22:03:18 +02:00
Mikaël Capelle 450bfa821a Minor fixes and updates for widgets. 2022-05-05 19:12:35 +02:00
Mikaël Capelle b17a1a3b07 Test for FileTypes (and QFlags). 2022-05-05 14:21:24 +02:00
Mikaël Capelle 19da0a9d8c Minor fixes for typing. 2022-05-05 13:13:56 +02:00
Mikaël Capelle b7e08ad862 Fix MoVariant name. 2022-05-04 23:59:06 +02:00
Mikaël Capelle d0a0ac0f0d Add new functions for IPluginList. 2022-05-04 23:30:33 +02:00
Mikaël Capelle 4b0890e679 Add missing constructor for VersionInfo(). 2022-05-04 23:30:26 +02:00
Mikaël Capelle 6268fe6d7b Minor cleaning. 2022-05-04 23:22:40 +02:00
Mikaël Capelle cf76d34cdf Minor fix to filetree for bindings. 2022-05-04 22:26:59 +02:00
Mikaël Capelle 9bc343c944 Fix DataArchives::addArchive. 2022-05-04 22:06:26 +02:00
Mikaël Capelle 72750ab4de Fix name of wrapped arguments. 2022-05-04 21:15:55 +02:00
Mikaël Capelle 7c6bbc2980 Merge pull request #104 from ModOrganizer2/test-and-fixes-for-qt6
Test, fixes and improvements for qt6
2022-05-04 20:57:55 +02:00
Mikaël Capelle 65ccc4af9c Add argument wrapper for directory and files. 2022-05-04 20:54:06 +02:00
Mikaël Capelle b42ce25b6e Set default logging handler. 2022-05-04 19:14:29 +02:00
Mikaël Capelle fa33e42e22 Remove automatic conversion from path to QString. 2022-05-04 19:10:18 +02:00
Mikaël Capelle 94bd8b82b4 Add tests for IPluginDiagnose and IPluginFileMapper. 2022-05-04 19:09:02 +02:00
Mikaël Capelle 639c3cf71d Fix bindings for IPluginDiagnose and IPluginFileMapper. 2022-05-04 18:46:56 +02:00
Mikaël Capelle 6030b443f7 Move pybind11-utils to own folder. Add tests for shared_cpp_owner. 2022-05-04 18:24:33 +02:00
Mikaël Capelle 08430a5df1 Add basic tests for QFlags. 2022-05-03 22:21:23 +02:00
Mikaël Capelle 8a886733d4 Look for translations in pybind11-qt and mobase. 2022-05-03 08:24:01 +02:00
Mikaël Capelle 2ef5dedfc0 Fix enum arithmetic. 2022-05-02 23:26:08 +02:00
Mikaël Capelle 97e9876987 Merge pull request #103 from ModOrganizer2/python-rework
Python rework
2022-05-02 20:32:05 +02:00
Mikaël Capelle e89616d695 Add more basic tests. 2022-05-02 19:59:49 +02:00
Mikaël Capelle cc0be7469a More tests. 2022-05-02 19:46:26 +02:00
Mikaël Capelle 62f4a9679d Remove useless stuff. 2022-05-02 19:39:09 +02:00
Mikaël Capelle 958cf9de37 Remove tests stuff from mobase and remove old boost runner. 2022-05-02 19:01:19 +02:00
Mikaël Capelle 30a01cf783 Fixes and tests. 2022-05-02 18:56:44 +02:00
Mikaël Capelle 6ea9d92b26 Minor fixes + tests + getSupportURL(). 2022-05-02 17:09:36 +02:00
Mikaël Capelle 225c86d258 Add some tests for widgets. 2022-04-29 22:27:31 +02:00
Mikaël Capelle 051c0589b5 Add more tests. 2022-04-29 21:11:59 +02:00
Mikaël Capelle 907bbf3117 Fix mod name not being updated correctly in installers. 2022-04-29 21:11:00 +02:00
Mikaël Capelle e5d4a4133c start adding tests. 2022-04-29 20:01:14 +02:00
Mikaël Capelle 21aeebdcc8 Fix excepthook for Python. 2022-04-29 18:09:27 +02:00
Mikaël Capelle 275acba6dd Add back warning from proxy. 2022-04-28 22:47:49 +02:00
Mikaël Capelle 68060b0e6b Global re-organization to split mobase from runner. 2022-04-28 22:44:15 +02:00
Mikaël Capelle b2767887a9 Many update to have a fully isolated plugin_python. 2022-04-28 21:38:27 +02:00
Mikaël Capelle d4f515ade1 Rename runner -> runner-boost. 2022-04-28 21:38:12 +02:00
Mikaël Capelle 64af744c8c Merge pull request #102 from ModOrganizer2/update-cmake-common-qt6
Update following cmake_common changes.
2022-04-28 17:50:04 +02:00
Mikaël Capelle dff9bd2404 Documentation. 2022-04-28 13:51:26 +02:00
Mikaël Capelle 4c7b452219 Multiple fixes. 2022-04-28 13:44:29 +02:00
Mikaël Capelle d0e883fd90 Fix Qt ownerships. 2022-04-27 19:43:10 +02:00
Mikaël Capelle f904e25e76 Multiple updates. 2022-04-27 17:49:21 +02:00
Mikaël Capelle 55e8ce326a Finally implement everything (some stuff not working). 2022-04-26 13:53:02 +02:00
Mikaël Capelle 92a2429d58 Fix installers. 2022-04-25 22:17:34 +02:00
Mikaël Capelle 5ec456f880 Continue implementing plugins. 2022-04-25 21:21:06 +02:00
Mikaël Capelle b92e3de535 Start implementing plugins. 2022-04-25 18:57:14 +02:00
Mikaël Capelle c97724a98f Implement basic classes from uibase. 2022-04-24 22:23:30 +02:00
Mikaël Capelle 3798370283 Fix Qt bindings. 2022-04-24 13:54:06 +02:00
Mikaël Capelle b2e1cb490c Update pybind11 bindings. 2022-04-24 13:43:33 +02:00
Mikaël Capelle 8e714f2eb6 Fix PyQt6 bindings. 2022-04-23 22:59:44 +02:00
Mikaël Capelle 9ad6c7f6ac Update pybind11 version. 2022-04-23 21:39:10 +02:00
Mikaël Capelle 4937fe9cc9 Some updates for Qt6. 2022-04-21 23:58:05 +02:00
Mikaël Capelle 67ea7deb00 Clean stuff. Bindings for IFileTree. 2022-04-21 23:57:07 +02:00
Mikaël Capelle 8bd7d08d1a Start moving to pybind11.
# Conflicts:
#	.gitmodules
2022-04-21 23:57:05 +02:00
Mikaël Capelle 4be4bc2a55 Remove pybind11. 2022-04-21 23:17:47 +02:00
Mikaël Capelle 94ecbe2c16 Fix translations. 2022-04-21 19:09:07 +02:00
Mikaël Capelle ddaff7d03d Update following cmake_common changes.
# Conflicts:
#	CMakeLists.txt
#	src/runner/CMakeLists.txt
#	src/runner/pythonRunner.pro
#	src/runner/pythonrunner_en.ts
2022-04-19 23:46:01 +02:00
Jeremy Rimpo 3957187e0a Merge remote-tracking branch 'origin/master' into qt6 2022-04-17 20:22:54 -05:00
Chris Bessent 7c54a45f63 Merge pull request #99 from Holt59/no-more-external-python
Remove support for external Python.
2022-03-19 21:15:05 -07:00
Chris Bessent b090d1341b Merge pull request #100 from Qudix/isX
Add hasMasterExtension, hasLightExtension, isMasterFlagged, and isLightFlagged
2022-03-19 21:10:02 -07:00
Qudix f3b43a5375 Change isXFile to hasXExtension 2022-03-19 19:47:35 -05:00
Qudix 0423ccb9ca Rename isX to isXFile and deprecate isMaster 2022-02-24 20:00:56 -06:00
Qudix d4d958018d Add isMasterFlagged isLight isLightFlagged 2022-02-24 17:57:23 -06:00
Mikaël Capelle b1c51ada08 Remove support for external Python. 2022-02-13 17:33:53 +01:00
Mikaël Capelle 5f56aa99ca Merge pull request #98 from Holt59/fix-sharedptr-deletion
Fix shared_ptr in createFile().
2022-02-13 17:32:39 +01:00
Mikaël Capelle 0c5622ea69 Fix shared_ptr in createFile(). 2022-01-11 22:36:16 +01:00
Jeremy Rimpo 03989ae0f1 Merge remote-tracking branch 'origin/category_revamp' into qt6 2021-12-24 15:12:04 -06:00
Jeremy Rimpo cc129e4895 Fix Python version check and translations 2021-12-10 09:35:32 -06:00
Jeremy Rimpo 7e8748abf0 Fix garbage collection issue with closure in Python 3.10 2021-12-09 16:46:39 -06:00
Jeremy Rimpo 11c2bcac9a More Qt6 migrations 2021-12-08 05:24:24 -06:00
Jeremy Rimpo 56de0fb4d1 Remove extraneous conversion 2021-12-08 05:24:00 -06:00
Jeremy Rimpo a53d3fe5d3 PyQt6 fixes 2021-12-06 03:46:43 -06:00
Jeremy Rimpo d6a7efc266 Changes to compile with Qt6 + Boost 1.77 2021-12-05 03:42:45 -06:00
Jeremy Rimpo 574f79117e Merge branch 'master' into category_revamp 2021-07-13 16:02:03 -05:00
Mikaël Capelle 071498f305 Merge pull request #96 from Holt59/remove-boost-uibase
Update after removal of boost in uibase.
2021-05-27 15:43:22 +02:00
Mikaël Capelle f134881da6 Update after removal of boost in uibase. 2021-05-26 19:47:15 +02:00
Mikaël Capelle 931996347b Merge pull request #94 from Holt59/fix-fileinfo
Fix FileInfo attribute access.
2021-05-20 20:21:07 +02:00
Mikaël Capelle 4775bafc33 Merge pull request #95 from Holt59/iorganizer-virtualfiletree
Add IOrganizer::virtualFileTree().
2021-05-20 20:20:47 +02:00
Mikaël Capelle f5a8446230 Add IOrganizer::virtualFileTree(). 2021-05-14 14:40:36 +02:00
Mikaël Capelle 120c13170c Fix FileInfo attribute access. 2021-05-14 13:54:06 +02:00
Jeremy Rimpo 4d018999cd Merge remote-tracking branch 'origin/master' into category_revamp 2021-03-25 10:28:50 -05:00
Mikaël Capelle ae975e52d7 Merge pull request #93 from Holt59/fix-startup-logs
Import mobase after installing the exception wrapper.
2021-03-04 20:29:24 +01:00
Mikaël Capelle e5ac21442f Import mobase after installing the exception wrapper. 2021-03-03 20:44:20 +01:00
Mikaël Capelle 40e6924714 Merge pull request #92 from LostDragonist/disabled_plugins
Add enabledByDefault to IPlugin definition
2021-03-02 19:27:44 +01:00
Mikaël Capelle e4ff66b727 Merge pull request #91 from Holt59/fix-ifiletree-sharedptr
Fix deletion of shared_ptr created from C++.
2021-03-02 19:27:32 +01:00
Chris Bessent a9a3d49efa Add enabledByDefault to IPlugin definition 2021-03-02 02:45:47 -07:00
Mikaël Capelle fce4f39dc8 Fix deleting of shared_ptr create from C++. 2021-02-28 19:58:15 +01:00
Jeremy Rimpo d678a22f99 Merge remote-tracking branch 'origin/master' into category_revamp 2021-02-11 15:31:01 -06:00
Mikaël Capelle 57441bd3c5 Update translation file. 2021-02-02 20:39:14 +01:00
Jeremy Rimpo 4e8800b4d6 [ci skip] Update artifacts paths for msbuild 2021-01-29 10:53:40 -06:00
Mikaël Capelle bab25d25ca Merge pull request #89 from Holt59/fix-iplugininstaller-install
Update IInstallationManager::installArchive() to handle string directly.
2021-01-02 15:30:16 +01:00
Mikaël Capelle ca052389b5 Merge pull request #90 from Holt59/update-imodinterface
Remove setName and remove from mod interface.
2021-01-02 15:25:35 +01:00
Mikaël Capelle 5f86de5d9e Remove setName and remove from mod interface. 2021-01-02 15:07:31 +01:00
Mikaël Capelle 91c55c909f Update IInstallationManager::installArchive() to handle string directly. 2021-01-01 19:58:19 +01:00
Mikaël Capelle d2d31f993d Merge pull request #88 from Holt59/fix-iorganizer-findfileinfos
Add missing converters to use IOrganizer::findFileInfos.
2020-12-30 21:06:13 +01:00
Mikaël Capelle 56dbb1f40e Add missing converters to use IOrganizer::findFileInfos. 2020-12-30 20:42:19 +01:00
Al cde7f79bc3 Merge pull request #87 from Holt59/imodinterface-isX
Add method to get the type of IModInterface.
2020-12-30 15:25:18 +01:00
Mikaël Capelle 96a7bc3898 Add method to get the type of IModInterface. 2020-12-26 16:55:07 +01:00
Mikaël Capelle f4ae1c94a0 Merge pull request #86 from Holt59/add-taskdialog
Add bindings for TaskDialog.
2020-12-12 13:00:37 +01:00
Mikaël Capelle 87c91b8259 Add bindings for TaskDialog. 2020-12-08 19:44:10 +01:00
Mikaël Capelle 2ed4b901c0 Merge pull request #85 from Holt59/moexception
Rename MyException to MOException
2020-12-04 13:30:30 +01:00
Mikaël Capelle cd9b16dcc2 MOException -> Exception. 2020-12-04 12:04:45 +01:00
Mikaël Capelle 5cad8a9ff8 Rename MyException to MOException. 2020-12-04 11:49:44 +01:00
Mikaël Capelle e961d21f24 Merge pull request #84 from Holt59/ipluginproxy-unload
Add IPluginProxy::unload() and rename instantiate() to load().
2020-12-02 16:26:56 +01:00
Mikaël Capelle 7f0848c9d2 Improve comments. 2020-12-02 09:20:13 +01:00
Mikaël Capelle bc05ec6477 Add IPluginProxy::unload() and rename instantiate() to load(). 2020-12-01 21:18:06 +01:00
Al 631fc2b31b Merge pull request #83 from ModOrganizer2/Al12rs-refresh-waitForApplication
Add refresh parameter for waitForApplication
2020-11-28 10:55:38 -08:00
AL f17ce3d2e6 add default value for refresh 2020-11-28 18:17:23 +01:00
AL 73d7771703 Add refresh parameter for waitForApplication 2020-11-28 18:02:39 +01:00
Al e737f0a5a8 Merge pull request #79 from ModOrganizer2/iplugingame-saves
IPluginGame::listSaves
2020-11-28 06:37:40 -08:00
isanae a75e94d46f Merge pull request #82 from ModOrganizer2/revert-73-master
Revert "Moving things around"
2020-11-27 07:47:30 -05:00
isanae b7855ca7d8 Merge pull request #81 from ModOrganizer2/revert-80-dll_directory
Revert "Fix libffi not found"
2020-11-27 07:47:24 -05:00
isanae f6cf0e8b33 Revert "Moving things around" 2020-11-27 07:36:39 -05:00
isanae 4fdbabdf76 Revert "Fix libffi not found" 2020-11-27 07:36:28 -05:00
Mikaël Capelle efc7d76a0a Revert translation file. 2020-11-25 22:47:10 +01:00
Mikaël Capelle 832aced4d3 Fix default binding for IPlugin::master(). 2020-11-21 14:11:36 +01:00
Mikaël Capelle a335adf928 Add argument name to IPluginRequirement::check(). 2020-11-21 13:45:30 +01:00
Mikaël Capelle ccef4be741 Replace ScriptExtender saveGameAttachmentExtensions with savegameExtension. 2020-11-21 12:25:59 +01:00
Mikaël Capelle aacf3654d8 Add default argument to GuessedString constructor to match C++ implementation. 2020-11-20 21:42:07 +01:00
Mikaël Capelle 234586823d Return shared_ptr in IPlugin::requirements(). 2020-11-19 21:21:58 +01:00
Mikaël Capelle 5b84588732 Add comment to reference Boost.Python issue. 2020-11-19 20:41:24 +01:00
Mikaël Capelle 7dbc139b10 Fix crash when destructing Python save games due to the GIL lock. 2020-11-19 20:40:05 +01:00
Mikaël Capelle 31e4f724ed Clean listSaves() bindings. 2020-11-19 20:33:24 +01:00
Mikaël Capelle 6e088406c8 Update following removal of IPlugin::isActive(). 2020-11-19 20:33:24 +01:00
Mikaël Capelle 9784881921 Update following addition of IPluginGame::listSaves(). 2020-11-19 20:33:00 +01:00
Mikaël Capelle aa8caee65c Merge pull request #80 from Qudix/dll_directory
Fix libffi not found
2020-11-19 09:36:34 +01:00
Qudix 9a10c01cc0 lamb-da 2020-11-18 14:30:40 -06:00
Qudix d9243bb617 Better 2020-11-18 13:37:54 -06:00
Qudix adf5888faf Fix libffi not found 2020-11-18 13:02:15 -06:00
Mikaël Capelle 7bec9237e6 Merge pull request #78 from Holt59/iplugin-isactive-refactoring
IPlugin::isActive refactoring
2020-11-18 10:01:30 +01:00
Mikaël Capelle 0846ffd177 Merge pull request #77 from Holt59/logging-module
Add handler for Python logging module.
2020-11-16 09:13:28 +01:00
isanae f3601e5bfe Merge pull request #73 from Qudix/master
Moving things around
2020-11-14 06:54:31 -05:00
Mikaël Capelle b37d3a9c17 Add callbacks for plugin enabled/disabled. 2020-11-12 21:49:37 +01:00
Mikaël Capelle cbb911f6a0 Rename the wrapper declaration and definition macros. 2020-11-11 22:02:40 +01:00
Mikaël Capelle 27c34af2aa Update authors. 2020-11-11 21:54:54 +01:00
Mikaël Capelle b20c015643 master() returns the name of the plugin. 2020-11-11 21:00:47 +01:00
Mikaël Capelle d89eae1646 Allow IPluginRequirement to be properly extended from Python. 2020-11-11 17:25:55 +01:00
Mikaël Capelle de5fde0f28 Cleaner IPluginRequirement. 2020-11-11 16:14:28 +01:00
Mikaël Capelle e84777d550 Remove automatic plugin dependency for proxy (moved to MO2 core). 2020-11-11 13:38:42 +01:00
Mikaël Capelle 1ca6fee64d Add plugin requirements. 2020-11-11 11:23:15 +01:00
Mikaël Capelle 57c774103d Better handling of sequence conversions. 2020-11-11 11:22:50 +01:00
Mikaël Capelle ead8352c93 Remove isActive() for the Python proxy plugin. 2020-11-11 11:22:10 +01:00
Mikaël Capelle 04e1af60a0 Do not set basicConfig() but provide a default logger. 2020-11-09 20:08:29 +01:00
Mikaël Capelle ebb566f773 Expose LogHandler in mobase. 2020-11-09 19:17:57 +01:00
Mikaël Capelle c45bfb1e35 Cast the record message to str() before extracting. 2020-11-09 18:28:58 +01:00
Mikaël Capelle 5f8e1803c0 Add handler for Python logging module. 2020-11-09 18:23:57 +01:00
Seth Riley 9bd22cfceb Merge branch 'master' of https://github.com/ModOrganizer2/modorganizer-plugin_python into master 2020-11-06 13:24:00 -06:00
Mikaël Capelle c2c63e0624 Merge pull request #76 from Holt59/iplugingame-detectgame
Replace IPlugin::registered() by IPluginGame::detectGame().
2020-11-06 20:17:45 +01:00
Seth Riley 240622565c Fix merge 2020-11-06 12:36:43 -06:00
Seth Riley ba7ba616ea Merge branch 'master' of https://github.com/ModOrganizer2/modorganizer-plugin_python into master 2020-11-06 12:27:51 -06:00
Mikaël Capelle 93dcf8d5b3 Replace IPlugin::registered() by IPluginGame::detectGame(). 2020-11-06 18:56:00 +01:00
isanae 7d0e97ed2b Merge pull request #75 from isanae/command-line
Command line and instance dialogs
2020-11-06 10:50:25 -05:00
isanae 86297b1170 removed unused IOrganizer from PythonRunner 2020-11-06 09:25:01 -05:00
isanae 78e4e5c548 binding for getPluginDataPath() 2020-11-06 09:22:23 -05:00
isanae 6a73c23a4b added registered() python wrapper
null checks for the IOrganizer, replaced pluginDataPath() by the static version getPluginDataPath()
2020-11-06 09:06:55 -05:00
Mikaël Capelle 7afade8642 Merge pull request #74 from Holt59/imodinterface-filetree
Add IModInterface::fileTree().
2020-11-05 10:43:55 +01:00
isanae 6445f7f47f handle empty variants returned from pluginSetting()
can happen when init() is called when MO has no instance set up
2020-11-04 22:52:56 -05:00
Mikaël Capelle c6e89dead6 Add IModInterface::fileTree(). 2020-11-04 21:48:22 +01:00
Seth Riley 20c2e5a14d Moving things around 2020-11-02 13:46:02 -06:00
Mikaël Capelle 83dec58e4a Merge pull request #72 from Holt59/imodlist-updates
IModList updates
2020-10-26 21:37:39 +01:00
Mikaël Capelle f4b8cbcd0b Merge pull request #70 from Holt59/iorganizer-profile-callbacks
Add IOrganizer::onProfileXXX callbacks.
2020-10-26 21:36:51 +01:00
Mikaël Capelle 96d15ae762 Fix default nullptr argument for allModsByProfilePriority. 2020-10-25 18:37:53 +01:00
Mikaël Capelle 7668783d3c Move IOrganizer::getMod() to IModList::getMod(). 2020-10-25 17:46:00 +01:00
Mikaël Capelle 40b7cd8e86 Move IOrganizer::removeMod() to IModList::removeMod(). 2020-10-25 17:15:22 +01:00
Mikaël Capelle 2aa65ec5bb Move IOrganizer::modsSortedByProfilePriority() to IModList::allModsByProfilePriority(). 2020-10-25 16:52:28 +01:00
Mikaël Capelle b1e554526a Fix for onModInstalled() modification. 2020-10-25 16:52:20 +01:00
Mikaël Capelle 8640890f8c Rename IOrganizer::refresh(). Move IOrganizer::onModInstalled. Add IModList::onModRemoved(). 2020-10-25 16:18:55 +01:00
Mikaël Capelle 2526b75ca1 Merge pull request #71 from Holt59/fix-ifiletree-const
Fix implicit conversion from non-const IFileTree to const IFileTree.
2020-10-25 13:00:50 +01:00
Mikaël Capelle 138de736ef Fix implicit conversion from non-const IFileTree to const IFileTree. 2020-10-25 12:58:37 +01:00
Mikaël Capelle 9e4cfaa0f0 Add IOrganizer::onProfileXXX callbacks. 2020-10-24 20:52:52 +02:00
Mikaël Capelle 8b703f2e4f Merge pull request #68 from Holt59/iplugin-setactive-fix
Switch from Qt signals to boost::signals for DownloadManager.
2020-10-21 20:07:55 +02:00
Mikaël Capelle 984a307a04 Merge pull request #69 from Holt59/add-mapping-constructor
Add Mapping constructor.
2020-10-18 12:56:34 +02:00
Mikaël Capelle 2c30cd25cd Add Mapping constructor. 2020-10-18 10:59:57 +02:00
Mikaël Capelle 9ba91b1ffa Switch from Qt signals to boost::signals for DownloadManager. 2020-10-14 18:48:14 +02:00
Mikaël Capelle d53e8de91c Merge pull request #67 from Holt59/imodinterface-seturl
Add IModInterface::setUrl and remove IInstallationManager::setURL.
2020-10-14 18:44:41 +02:00
Mikaël Capelle 702dc6c66f Add IModInterface::setUrl and remove IInstallationManager::setURL. 2020-10-09 20:32:07 +02:00
Mikaël Capelle 9c9d1ee574 Merge pull request #66 from Holt59/add-iprofile-inifilepath
Add IProfile::iniFilePath().
2020-09-27 21:22:34 +02:00
Mikaël Capelle 7a83a472b8 Rename iniFilePath() -> absoluteIniFilePath(). 2020-09-27 20:56:41 +02:00
Mikaël Capelle e4b367e909 Add IProfile::iniFilePath(). 2020-09-27 20:33:30 +02:00
Mikaël Capelle eb5232c1eb Merge pull request #60 from Holt59/fix-ipluginlist-callbacks
Make onPluginStateChanged take a list of plugins.
2020-09-27 14:55:47 +02:00
Jeremy Rimpo eb033c3e9e [skip ci] Use PR branch for umbrella repo (if it exists) 2020-09-25 00:34:18 -05:00
Jeremy Rimpo 28704a8a2e Merge branch 'master' of https://github.com/ModOrganizer2/modorganizer-plugin_python into master 2020-09-24 21:44:34 -05:00
Mikaël Capelle 5a15a374bf Merge pull request #64 from Holt59/plugin-installer-callbacks
Add IPluginInstaller onInstallationStart and onInstallationEnd callbacks
2020-09-23 18:40:24 +02:00
Mikaël Capelle f4478dcf66 Merge remote-tracking branch 'origin/master' into plugin-installer-callbacks 2020-09-23 18:38:25 +02:00
Mikaël Capelle df663f6e4f Merge pull request #63 from Holt59/expose-modinterface-meta
Add getters for most meta-information in mod.
2020-09-23 18:34:24 +02:00
Mikaël Capelle bb522b9126 Add 'reinstallation' parameter to onInstallationStart(). 2020-09-22 22:02:27 +02:00
Mikaël Capelle d549a99867 Change modId() to nexusId(). 2020-09-22 21:13:23 +02:00
Al 44553b4621 Merge pull request #65 from Holt59/imodinterface-clearpluginsettings
Add IModInterface::clearPluginSettings().
2020-09-21 14:42:42 -07:00
Mikaël Capelle 1d51b3c457 Add IModInterface::clearPluginSettings(). 2020-09-21 23:37:30 +02:00
Al 2c0f1006cf Merge pull request #61 from Holt59/iplugin-interface-improvements
Add interfaces for IPlugin::localizedName() and IPlugin::master().
2020-09-21 13:08:54 -07:00
Mikaël Capelle 58d5100dfc Add IPluginInstaller onInstallationStart and onInstallationEnd callbacks. 2020-09-21 21:34:24 +02:00
Jeremy Rimpo e545aec65a Merge branch 'test' into master 2020-09-21 13:26:04 -05:00
Jeremy Rimpo f10194a4bb Revert "Test GH integration"
This reverts commit afe671d4
2020-09-21 10:42:05 -05:00
Jeremy Rimpo afe671d484 Test GH integration 2020-09-21 07:51:33 -05:00
Jeremy Rimpo bfb85087a0 Force exit PS with last exit code after umbrella build error 2020-09-21 05:53:44 -05:00
Jeremy Rimpo b4ae13314c Needs quotes 2020-09-21 05:37:42 -05:00
Jeremy Rimpo c5be2c3605 PowerShell build should fail on error 2020-09-21 05:17:22 -05:00
Jeremy Rimpo 0f33ee2176 Finalize appveyor script update 2020-09-20 22:34:32 -05:00
Jeremy Rimpo 1d2fa7f269 Convert scripts to PowerShell 2020-09-20 19:56:37 -05:00
Jeremy Rimpo c0828f2553 Merge remote-tracking branch 'origin/master' into master 2020-09-20 19:16:23 -05:00
Jeremy Rimpo 847e73a0db Need extra space for second command 2020-09-20 19:11:50 -05:00
Al 1d111cdd8f Merge pull request #62 from Holt59/mod-specific-plugin-settings
Add pluginSetting[s]() and setPluginSetting() to IModInterface.
2020-09-20 12:53:07 -07:00
Mikaël Capelle 5b06bb75a9 Add pluginSetting[s]() and setPluginSetting() to IModInterface. 2020-09-20 21:30:01 +02:00
Mikaël Capelle 04a54c7566 Add getters for most meta-information in mod. 2020-09-20 15:20:22 +02:00
Jeremy Rimpo b96e006e7d Add /bigobj flag to compile options 2020-09-09 19:38:50 -05:00
Mikaël Capelle bfa5c28285 Remove debug logs. 2020-09-06 11:54:55 +02:00
Mikaël Capelle cf6679292f Add interfaces for IPlugin::localizedName() and IPlugin::master(). 2020-09-06 11:44:50 +02:00
Mikaël Capelle 65e73aa537 Fix typo onModStateChanged -> onPluginStateChanged. 2020-09-05 14:49:19 +02:00
Mikaël Capelle 194bba9a9b Make onPluginStateChanged take a list of plugins. 2020-09-05 13:49:11 +02:00
Al 64fd574c3b Merge pull request #59 from Holt59/ipluginlist-setpriority
Add IPluginList::setPriority binding.
2020-09-01 03:59:56 -07:00
Al 93fee5bd6c Merge pull request #58 from Holt59/modlist-setactive-bulk
Fix bindings of IModList::setActive.
2020-09-01 03:59:32 -07:00
Mikaël Capelle accb270353 Add IPluginList::setPriority binding. 2020-08-30 14:03:23 +02:00
Mikaël Capelle d8657946e9 Fix depreciation -> deprecation. 2020-08-30 11:15:31 +02:00
Mikaël Capelle 3780f157e4 Move the storage for deprecated lines in show_depreciation_warnings(). 2020-08-30 10:25:11 +02:00
Mikaël Capelle 7a9cd34878 Update following onModStateChanged + Depreciation warning. 2020-08-29 19:55:06 +02:00
Mikaël Capelle 829ac65cea Fix bindings of IModList::setActive. 2020-08-29 12:59:38 +02:00
isanae 5c34d11e79 Merge pull request #57 from Holt59/fix-imodlist-ipluginlist-callbacks
Add missing onPluginStateChanged binding and missing functor converters.
2020-08-27 12:38:01 -04:00
Mikaël Capelle 6001d88f40 Add missing onPluginStateChanged binding and missing functor converters. 2020-08-27 18:30:22 +02:00
isanae 139666705a Merge pull request #55 from Holt59/fix-ifiletree-copy
Fix IFileTree::copy() bindings.
2020-08-06 09:00:28 -04:00
Mikaël Capelle fed261e9eb Fix IFileTree::copy() bindings. 2020-08-06 11:10:26 +02:00
isanae f531905e4a Merge pull request #54 from Holt59/add-missing-iplugin-bases
Add missing bpy::bases<IPluginX> for some plugin types.
2020-07-28 21:26:13 -04:00
Mikaël Capelle e25fa00285 Add missing bpy::bases<IPlugin> for some plugin types. 2020-07-22 21:23:47 +02:00
isanae 5c63d62a1e Merge pull request #53 from Holt59/add-executableforcedloadsetting-converter
Add executableforcedloadsetting converter
2020-07-20 15:18:42 -04:00
Mikaël Capelle 624c5257bd Add missing converter for QList<ExecutableForcedLoadSetting>. 2020-07-20 19:44:51 +02:00
Mikaël Capelle 480eb3f30e Fix name of default argument in persistent(). 2020-07-20 19:36:58 +02:00
isanae 4909b6cff0 Merge pull request #52 from Holt59/add-arg-names
Add arg names
2020-07-14 12:23:02 -04:00
Mikaël Capelle 331416d1e7 Add binding for IInstallationManager::getSupportedExtensions(). 2020-07-14 16:39:45 +02:00
Mikaël Capelle c955b4e8de Fix argument name for getSaveGameWidget. 2020-07-14 15:00:26 +02:00
Mikaël Capelle 727a55e1a8 Add missing argument names. 2020-07-14 14:36:11 +02:00
Mikaël Capelle 6c1f961d83 Add missing arg names for GuessedString constructor. 2020-07-14 13:33:48 +02:00
Mikaël Capelle a3e9916400 Fix order of overloads for VersionInfo constructors. 2020-07-14 13:21:30 +02:00
Mikaël Capelle 0fbb88b3c1 Add argument names to bindings. 2020-07-14 13:14:53 +02:00
isanae 5023a13aa2 Merge pull request #51 from isanae/ts
updated translations
2020-07-10 12:21:48 -04:00
isanae fe8a0b849c updated translations
disabled translations for plugin_python, identical to pythonrunner
2020-07-10 12:17:45 -04:00
isanae e1a1b70121 Merge pull request #50 from Holt59/add-movariant
Add module variable to fake MoVariant.
2020-06-17 18:08:03 -04:00
Mikaël Capelle 671776f306 Clarify comment for MoVariant export. 2020-06-16 22:12:25 +02:00
Mikaël Capelle 95ed8ae14a Add module variable to fake MoVariant. 2020-06-16 21:57:31 +02:00
isanae e6ca79c694 Merge pull request #49 from Holt59/new-iorganizer-callbacks
Update for new organizer callbacks.
2020-06-16 15:40:04 -04:00
Mikaël Capelle c521178769 Update for new organizer callbacks. 2020-06-15 22:48:21 +02:00
Al 1cbfde96a0 Merge pull request #48 from Holt59/fix-game-plugins-getloadorder
Change getLoadOrder() to return the load order in python.
2020-06-14 15:59:29 -07:00
Mikaël Capelle e7ae48f633 Update getLoadOrder() bindings following game_features change. 2020-06-14 15:31:21 +02:00
Mikaël Capelle d0fd776648 Change getLoadOrder() to return the load order in python. 2020-06-14 14:51:52 +02:00
Al cbdf8fee14 Merge pull request #46 from Holt59/allow-plugins-to-fix-filetree
Update following ModDataChecker change.
2020-06-14 05:48:54 -07:00
Al 5fe9c44f26 Merge pull request #47 from Holt59/executable-forced-load-settings-bindings
Add missing bindings for executableForcedLoads and fix ExecutableInfo.
2020-06-14 05:48:21 -07:00
Mikaël Capelle 3f02f975aa Add missing bindings for executableForcedLoads and fix ExecutableInfo. 2020-06-14 10:52:45 +02:00
Mikaël Capelle b2b0b6f5c5 Missing includes and fix names in bindings. 2020-06-14 00:06:41 +02:00
Mikaël Capelle 6ee58c6bf9 Update following ModDataChecker change. 2020-06-13 23:51:52 +02:00
isanae 2efc6d4af6 Merge pull request #45 from Holt59/fix-exception-transfer-at-startup
Fix Python -> C++ error transfer during plugin creation.
2020-06-13 13:10:04 -04:00
Mikaël Capelle 760cca172f Fix Python -> C++ error transfer during plugin creation. 2020-06-13 19:04:58 +02:00
Al 26c0e628b8 Merge pull request #44 from Holt59/add-ifiletree-copy
Add bindings for IFileTree::copy().
2020-06-13 02:52:10 -07:00
Mikaël Capelle ab4a067042 Add bindings for IFileTree::copy(). 2020-06-12 20:54:52 +02:00
Al 38188e0b17 Merge pull request #43 from Holt59/add-utility-functions
Add bindings for utility functions from uibase.
2020-06-10 04:00:05 -07:00
Mikaël Capelle 863893cc31 Add bindings for utility functions from uibase. 2020-06-09 23:31:25 +02:00
Al 06b11c86ba Merge pull request #40 from Holt59/fix-exceptions-plugin-preview
Fix genFilePreview issue with exceptions not being properly translated to C++.
2020-06-09 05:53:15 -07:00
Al d4a6a57f14 Merge pull request #42 from Holt59/fix-iprofile-invalidationactive
Fix IProfile::invalidationActive
2020-06-08 13:10:17 -07:00
Mikaël Capelle 2ea33f4faa Return a tuple<bool, bool> for IProfile::invalidationActive() to replace the bool* parameter. 2020-06-08 21:45:01 +02:00
Al b4c23ad733 Merge pull request #41 from Holt59/iorganizer-findfiles-glob
Add findFiles overload with glob patterns.
2020-06-08 12:05:26 -07:00
Mikaël Capelle 71db9d81d4 Add findFiles overload with glob patterns. 2020-06-08 18:37:59 +02:00
Mikaël Capelle e712448ca0 Fix genFilePreview issue with exceptions not being properly translated to C++. 2020-06-08 17:54:30 +02:00
Al 98b8d92350 Merge pull request #39 from Holt59/qclass-converter-fix
Fix issue with QClass converter for overloaded functions.
2020-06-08 08:40:46 -07:00
Mikaël Capelle 7cc0f974f5 Use a sequence converter for QStringList instead of a QClass converter. 2020-06-07 17:56:58 +02:00
Mikaël Capelle 48c35a8f92 Switch 0 for nullptr. 2020-06-07 17:01:46 +02:00
Mikaël Capelle 4b9fc2d32a Fix issue with QClass converter for overloaded functions. 2020-06-07 16:54:53 +02:00
Al be63c1d9de Merge pull request #38 from Holt59/set-plugin-setting-signal
Add IOrganizer signal when a plugin setting is changed.
2020-06-07 03:45:50 -07:00
Mikaël Capelle 100a2d03f0 Add IOrganizer signal when a plugin setting is changed. 2020-06-05 16:48:42 +02:00
Al fcd1177acd Merge pull request #37 from Holt59/install-manager-improvements
Installation manager improvements
2020-06-01 13:56:14 -07:00
Mikaël Capelle 5eeb02403f Update bindings after uibase update. 2020-05-30 14:58:50 +02:00
isanae eca495c849 Merge pull request #36 from Holt59/mod-data-content
Add ModDataContent to the python interface.
2020-05-28 23:43:02 -04:00
Mikaël Capelle 024a333194 Update to match game features. 2020-05-27 22:44:32 +02:00
Mikaël Capelle ead37d1dbe Add ModDataContent to the python interface. 2020-05-25 21:24:50 +02:00
Al 65003ef4ad Merge pull request #35 from Holt59/moddatachecker
Minor updates following changes in uibase.
2020-05-23 14:07:30 -07:00
Mikaël Capelle a3b593f714 Remove time() method from FileTreeEntry. 2020-05-23 21:45:05 +02:00
Mikaël Capelle ab4168fd93 Minor updates following changes in uibase. 2020-05-23 17:32:01 +02:00
Al bfad575467 Merge pull request #34 from Holt59/cleaning
Cleaning and improvements
2020-05-22 12:30:48 +02:00
Mikaël Capelle d5f44f424d Add comments for basicWrapperFunction functions. 2020-05-21 23:15:41 +02:00
Mikaël Capelle da679b1d6d Common code for basicWrapperFunction functions. 2020-05-21 23:11:56 +02:00
Mikaël Capelle 751e67e86c Fix issue with Python errors not being retrieved correctly in C++. 2020-05-21 22:08:20 +02:00
Mikaël Capelle c96fe2d21a Add missing qflags converter for ModState. 2020-05-21 17:47:08 +02:00
Mikaël Capelle 4b4c36df7a Add possibility to create multiple plugins object from a single .py file or python module. 2020-05-20 20:52:31 +02:00
Mikaël Capelle 5f9d2b296d Remove usage of getDataFolderName() for ModDataChecker. 2020-05-20 19:53:49 +02:00
Mikaël Capelle 05e79cc13b Merge remote-tracking branch 'origin/master' into cleaning 2020-05-20 18:32:22 +02:00
Al 3f5aa49dee Merge pull request #33 from Holt59/python-module
Allow implementation of python plugin as whole module.
2020-05-20 13:15:46 +02:00
Al 3e9209a191 Merge pull request #32 from Holt59/new-filetree
Update python bindings for UI base change and new filetree implementation
2020-05-20 13:03:39 +02:00
Mikaël Capelle d70942efa1 Rollback to setGameName instead of setGamePlugin for mod interface. 2020-05-19 17:58:44 +02:00
Mikaël Capelle d9393a2d2b Add WalkReturn enumeration. 2020-05-18 16:16:26 +02:00
Mikaël Capelle 7c1389d479 Add ModDataChecker game feature and clean some game-feature related code. 2020-05-16 20:47:41 +02:00
Mikaël Capelle 7333bde006 Add makeTree in moprivate. 2020-05-16 17:37:57 +02:00
Mikaël Capelle fae9f1b52f Allow None value from python in functor converter. 2020-05-16 17:37:41 +02:00
Mikaël Capelle 23c6f3fad9 Better arity check for functor converter. 2020-05-16 17:37:22 +02:00
Mikaël Capelle f12bb05d61 Update python version to 3.8. 2020-05-14 23:24:38 +02:00
Mikaël Capelle d931d71a43 Translate failure in exceptions for some IFileTree methods. Add IFileTree::walk. 2020-05-14 23:18:23 +02:00
Mikaël Capelle aa75c3b18e Add .feature() method to the Python interface of IPluginGame. 2020-05-13 17:35:33 +02:00
Mikaël Capelle eb29202b2f Use UPPER_CASE for enumeration values (kept non-uppercase for backward compatibility). 2020-05-13 15:55:05 +02:00
Mikaël Capelle fe0a75b819 Add to-python converter for QVariant holding QStringList. 2020-05-13 15:35:50 +02:00
Mikaël Capelle 90a99b37c9 Add missing override annotation and use using to bring invalidate in public scope. 2020-05-13 14:34:17 +02:00
Mikaël Capelle 7c474c58ca Add small comments. 2020-05-13 14:33:15 +02:00
Mikaël Capelle 288f9f9a95 Rename IModRepositoryBridge to be consistent with other interfaces. 2020-05-12 19:25:57 +02:00
Mikaël Capelle a05006a0b3 Allow implementation of python plugin as whole module. 2020-05-11 23:51:58 +02:00
Mikaël Capelle d6b8c66911 Move include directive where they should be. 2020-05-11 23:40:06 +02:00
Mikaël Capelle 0c52c2417c Remove unused global variable. 2020-05-11 23:39:55 +02:00
Mikaël Capelle 24205bba66 Remove useless wrappers. 2020-05-11 23:36:35 +02:00
Mikaël Capelle f0f949c4ef Remove ModRepositoryBridgeWrapper since it is not needed anymore. 2020-05-11 23:26:29 +02:00
Mikaël Capelle 6b88cee9d8 Remove useless includes. 2020-05-11 23:26:06 +02:00
Mikaël Capelle 1825c58666 Remove comment. 2020-05-11 23:18:44 +02:00
Mikaël Capelle 83a89ca595 Move utils::register_ at the top of the module definition. 2020-05-11 23:16:51 +02:00
Mikaël Capelle e9fdfd40aa Add comment for Q_DELEGATE. 2020-05-11 23:02:08 +02:00
Mikaël Capelle fcf1aa8b42 Move converter to a dedicate file. Add Q_DELEGATE for QObject-derived wrappers. 2020-05-11 23:00:29 +02:00
Mikaël Capelle d404a37fed Add/fix bindings for ISaveGame and ISaveGameInfoWidget. 2020-05-10 16:01:14 +02:00
Mikaël Capelle b360cae555 Add missing include in error.h. 2020-05-10 15:57:46 +02:00
Mikaël Capelle 039e33f5fa Minor clean and first try for ISaveGameInfoWidget. 2020-05-09 23:30:10 +02:00
Mikaël Capelle 622d4246a7 Clean some comments. 2020-05-09 21:32:23 +02:00
Mikaël Capelle 2f1646a2e6 Remove HANDLE_converters since it is not used anymore and did not really work. 2020-05-09 21:27:00 +02:00
Mikaël Capelle 716cbcf733 More cleaning. 2020-05-09 21:16:30 +02:00
Mikaël Capelle 62f10c03ff Temporary commit. 2020-05-09 21:13:45 +02:00
Mikaël Capelle 957b786d8c Start cleaning interfaces. 2020-05-09 18:19:31 +02:00
Mikaël Capelle 29a5eb8366 Remove wrong static_assert(). 2020-05-07 00:19:11 +02:00
Mikaël Capelle 4209d90533 Remove left-out method not implemented. 2020-05-06 22:08:25 +02:00
Mikaël Capelle 7bbf05bc0c Apply appendIfInstance for each class separately. 2020-05-06 12:51:27 +02:00
Mikaël Capelle 154c643bff Replace TRY_PLUGIN_TYPE with a more modern C++ variant. 2020-05-05 17:52:54 +02:00
Mikaël Capelle 2146cc9207 Fix wrapper for custom installer. 2020-05-04 20:17:02 +02:00
Mikaël Capelle 163ed213ef Update the install() bindings to allow more flexibility and be easier to use. 2020-05-04 20:09:24 +02:00
Mikaël Capelle 6919539d35 Remove left-out comment. 2020-05-04 18:40:53 +02:00
Mikaël Capelle 917b8dfb4b Slight modification for tuple and variant registers using C++17 fold expressions. 2020-05-04 01:58:56 +02:00
Mikaël Capelle 54e447c0a9 Switch from boost variant/tuple to std. 2020-05-04 01:47:30 +02:00
Mikaël Capelle 206454c34e Remove makeTree that was meant for testing purpose. 2020-05-03 23:16:58 +02:00
Mikaël Capelle 457529546b Add a bit of documentation to register functions. 2020-05-03 21:01:43 +02:00
Mikaël Capelle b9de35772f Clean sequence converters. 2020-05-03 20:57:50 +02:00
Mikaël Capelle 4589cab093 Add missing std::vector register for installation manager. 2020-05-03 20:19:25 +02:00
Mikaël Capelle 2b4eedb62b Clean std::set/std::vector from/to python conversions. 2020-05-03 20:17:49 +02:00
Mikaël Capelle 36022774e3 Add methods to utils to register map, vector and set. 2020-05-03 20:17:14 +02:00
Mikaël Capelle aac45a39e2 Make register_variant work for all variant types. 2020-05-03 20:16:57 +02:00
Mikaël Capelle 61ad2ef2b6 Clean bindings for IFileTree and FileTreeEntry. 2020-05-03 18:27:26 +02:00
Mikaël Capelle 1ea006b74e Add bindings for FileInfo. 2020-05-03 18:26:27 +02:00
Mikaël Capelle af37a451f9 Better variant handling for IFileTree::merge. 2020-05-03 18:26:11 +02:00
Mikaël Capelle 473cef6217 Add utility package with register_map for std::map. 2020-05-03 18:25:35 +02:00
Mikaël Capelle 5cd7917709 Add to_python to register_variant.h. 2020-05-03 18:25:16 +02:00
Mikaël Capelle 585296d527 Fix issue with shared pointer being registered twice. 2020-05-03 18:24:32 +02:00
Mikaël Capelle 221949f48b Fix issue with Functor_converter when return type was not bool or void. 2020-05-03 13:39:04 +02:00
Mikaël Capelle 8b118ad898 Better handling of boost::variant. 2020-05-03 13:38:47 +02:00
Mikaël Capelle f83ed39287 Modify FileTypes enumeration for FileTreeEntry. 2020-05-03 12:57:23 +02:00
Mikaël Capelle 8a286f9cfc Change Functor_converter to use a function-type template argument. 2020-05-03 12:57:01 +02:00
Mikaël Capelle 70172ddda6 Add possibility to create GuessedString from python. 2020-05-02 15:34:06 +02:00
Mikaël Capelle 817f8d7238 Fix variants() method of GuessedValue. 2020-05-02 15:05:24 +02:00
Mikaël Capelle 9f5dab285d Fix return_value_policy for methods returning QWidget. 2020-05-02 15:04:44 +02:00
Mikaël Capelle 53b91f0092 Update exposed method names for installer to be consistent with others. 2020-05-02 13:28:08 +02:00
Mikaël Capelle f1d5a1f31b Improve GuessedValue binding and switch to upper-case for enumerations in Python. 2020-05-02 13:22:55 +02:00
Mikaël Capelle 626a7bc670 Update python bindings for tree to be consistent with others. 2020-05-02 13:22:34 +02:00
Mikaël Capelle c9115e7ad0 Add python interface for IPluginInstallerSimple. 2020-05-02 00:30:17 +02:00
Mikaël Capelle 6cececc7a0 Fix issue with default QDateTime() throwing error. 2020-05-01 21:32:30 +02:00
Mikaël Capelle d82640455f Update wrappers and expose the new file tree interface. 2020-05-01 21:32:08 +02:00
Mikaël Capelle f25602cc69 Update the wrapper and the python interface after change to IModInterface. 2020-05-01 21:30:31 +02:00
Silarn 168b9d7b0d Appveyor CMAKE fix 2020-05-01 04:59:02 -05:00
isanae 247944baa8 Merge pull request #31 from isanae/new-cmakefiles
New cmakefiles
2020-04-26 02:53:56 -04:00
isanae 332b8239bb unused 2020-04-25 00:51:20 -04:00
isanae 97a93a5989 now using new cmakefiles 2020-04-25 00:51:14 -04:00
Al e871617843 Merge pull request #30 from AnyOldName3/threadsafe
Make runner threadsafe again
2020-04-17 14:41:38 +02:00
AnyOldName3 c5d4857f47 Make functor converter variadic
Duplicating code three times is silly.
2020-04-16 00:56:57 +01:00
AnyOldName3 5825661a4f Only initialise Python once
When switching instances, the Python runner gets another initPython call, despite the previous interpreter existing. Most of the function was either a no-op or was redundant, and the GIL state got confusing. This is the simplest fix.

If things catch fire that I haven't anticipated, instead of returning true, we can destroy the pre-existing interpreter and create a new one by running the rest of the function.
2020-04-16 00:53:29 +01:00
AnyOldName3 2e13cf0dab Ensure we relinquish the GIL after initialising Python and have it when destroying callables 2020-04-15 17:01:28 +01:00
Chris Bessent d6dd0342b7 Merge pull request #29 from ModOrganizer2/2_2_2
Pull in 2.2.2.1 changes
2020-01-13 23:05:28 -07:00
Chris Bessent 67abab0779 Merge pull request #28 from ModOrganizer2/Develop
Stage for release 2.2.2
2020-01-06 05:11:19 -07:00
Silarn b0ef81214a Fix cmakelists and use zip 2019-10-29 01:35:15 -05:00
Silarn b2ae43a0e5 Add lightPluginsAreSupported to the wrapped game plugin functions 2019-10-19 02:28:01 -05:00
LostDragonist 52dd7454be Update version 2019-10-06 17:22:09 -05:00
LostDragonist 059dc8b9d2 Report plugin as active even if failed
This is required for the plugin to report notifications.  This
behavior was changed in the main MO program at some point.
2019-10-06 17:20:53 -05:00
Silarn b8bcecbed4 Update Appveyor to official VS 2019 image 2019-09-28 00:41:47 -05:00
Jeremy Rimpo 42e559b59c Merge pull request #26 from ModOrganizer2/Develop
Stage for release 2.2.1
2019-07-22 01:02:42 -05:00
Jeremy Rimpo b7d343a8dd Merge pull request #27 from AnyOldName3/message-forwarding
Message forwarding
2019-07-22 00:56:29 -05:00
AnyOldName3 63a6c504b0 Restore logging of historically-logged Python exceptions. 2019-07-22 00:08:35 +01:00
AnyOldName3 19dcdd95c0 Prevent PyQt from using its buggy exception logging by making it look like we're using custom exception handling. 2019-07-15 20:04:44 +01:00
AnyOldName3 ac5540ba87 Forward Python stdout and stderr to qDebug and qCritical 2019-07-15 20:02:18 +01:00
Silarn 0708bdedbf Improve error parser for _C_API loader 2019-07-02 12:33:18 -05:00
Silarn 2b6f453fbc Add better error handling when loading the SIP API 2019-07-01 22:19:14 -05:00
Brian Munro 4f86e542cc Merge pull request #25 from AnyOldName3/sip-transfer-fix
Correctly use SIP to transfer ownership of objects from Python to C++
2019-06-01 09:02:05 +02:00
AnyOldName3 e280b07cb6 Correctly use SIP to transfer ownership of objects from Python to C++ 2019-06-01 00:59:39 +01:00
Silarn 0c11e75f0f Set optimization for release builds 2019-05-22 02:04:22 -05:00
Silarn ab72c2f42f Fix artifact paths 2019-05-22 01:07:13 -05:00
Silarn cbe679aad8 Add logs to build artifacts on CI fail, commit translation changes 2019-05-21 23:46:06 -05:00
Silarn 59e5f1acf2 Switch to local build files as appveyor can't use installed files 2019-05-21 02:27:58 -05:00
Silarn d0598cd849 Unify artifacts source path to install path 2019-05-21 01:37:18 -05:00
Silarn 174abb3cea Enable parallel building 2019-05-09 02:10:42 -05:00
Silarn dee8825960 Set appveyor image to VS 2019 Preview 2019-05-08 23:10:34 -05:00
LostDragonist 46a4ee8653 Merge pull request #24 from ModOrganizer2/Develop
Stage for Release 2.2.0
2019-05-03 21:09:18 -05:00
Brian Munro 4721ab35df Merge pull request #23 from ModOrganizer2/Appveyor
Support Appveyor.
2019-04-29 14:18:19 +02:00
LePresidente 352e5c2103 Fixed artifacts for proxy_python. 2019-04-29 14:07:19 +02:00
LePresidente 78278ae57d Support Appveyor. 2019-04-29 10:30:47 +02:00
LostDragonist 3eb85cd17f Update for startApplication 2019-03-24 21:28:13 -05:00
Brian Munro 208965b96d Merge pull request #22 from ModOrganizer2/Appveyor
Removed unneeded cmake variables due to that umbrella handles them co…
2019-03-09 20:20:01 +02:00
LostDragonist c17d703b15 Add function for tracking status 2019-03-07 11:20:59 -06:00
LostDragonist 65eb0c6374 Add function to get configured mods directory 2019-02-23 07:11:19 -06:00
LostDragonist 97a20d522a Add setGameName to the mod interface 2019-02-22 22:16:17 -06:00
Silarn caee1fb7f6 Change to uibase requires Qt5Network linkage 2019-02-18 21:40:12 -06:00
Silarn bab649af43 Update to support API changes to uibase 2019-02-18 21:40:12 -06:00
Brian Munro 30ab7b8e14 Removed unneeded cmake variables due to that umbrella handles them correctly.
Requires testing.
2019-02-12 21:37:41 +02:00
LostDragonist 956d481ca4 Make logs more consistent in format and content 2019-01-30 20:53:48 -06:00
LostDragonist 41a4f273d6 Support for force loading libraries 2019-01-11 01:39:05 -06:00
LostDragonist 66391098b6 Update version to 2.0.1.0 2019-01-05 16:43:30 -06:00
LostDragonist c9d77cf948 Change qPrintable to qUtf8Printable to better support non-ASCII text 2019-01-05 16:34:11 -06:00
LostDragonist b939f7e88e Add enumerations for plugin states and mod states 2018-12-21 02:30:58 -06:00
LostDragonist be6b102599 Merge pull request #21 from ModOrganizer2/Develop
Stage for release 2.1.6
2018-12-20 13:58:41 -06:00
LostDragonist a1bc87e75a Fix the crash in a better, non-leaky way 2018-12-17 17:56:24 -06:00
LostDragonist 4160dea823 Convert a crash when converting strings to QStrings to possibly a memory leak 2018-12-16 18:27:45 -06:00
LostDragonist 1bd5dda7d8 Update version to 2.0.0.0 2018-12-12 02:14:02 -06:00
LostDragonist 9780aeb477 Improve refresh of data when changing profile settings 2018-12-08 00:12:09 -06:00
LostDragonist f6d41a1a81 Update for archive invalidation changes 2018-12-05 06:34:30 -06:00
Al 69ff972b12 Merge pull request #20 from AnyOldName3/settable-plugin-settings
Fix typo preventing IOrganizer::setPluginSetting from being used in P…
2018-09-25 20:28:15 +02:00
Al ada342e818 Merge pull request #19 from AnyOldName3/qvariant-from-unicode
Add missing PyUnicode_Check which prevented QVariants being created f…
2018-09-25 20:27:58 +02:00
AnyOldName3 051c14fe72 Add working version of IOrganizer::waitForApplication (#18) 2018-09-25 20:27:23 +02:00
AnyOldName3 f841a3b13a Add support for the default (invalid) QVariant 2018-09-19 22:52:40 +01:00
AnyOldName3 60701b6ba0 Add forgotten PyDict_Check 2018-09-19 22:36:11 +01:00
AnyOldName3 a8cf8d45f3 Fix typo preventing IOrganizer::setPluginSetting from being used in Python 2018-09-19 22:16:50 +01:00
AnyOldName3 84c04c32dc Add missing PyUnicode_Check which prevented QVariants being created from Python 3 strings 2018-09-19 21:45:42 +01:00
Al 6ce4138b31 Add new function wrapper for archive conflicts (#17) 2018-09-09 23:28:53 +02:00
Silarn d1f6766e16 Allow installs to pass Mod ID through (fixes NCC installs losing ID) 2018-09-09 04:20:21 -05:00
LostDragonist aa2b0744f7 Update for changes to local save game class 2018-08-26 17:55:31 -05:00
Jeremy Rimpo f1997b4788 Merge pull request #15 from ModOrganizer2/python3
Migrate to python 3.7
2018-08-23 11:48:07 -05:00
Brian Munro 423e6f8842 Merge pull request #14 from Modorganizer2/Develop
Stage for 2.1.5 release
2018-08-21 12:11:25 +02:00
Silarn b5b547e041 Changes to compile and run with python3 (WIP) 2018-08-20 19:01:18 -05:00
Silarn 61977d6149 Remove archive conflict code from python 3 branch 2018-08-20 19:00:06 -05:00
Silarn fbf59519c0 Fix to use modularized sip API and embedded python libs 2018-08-20 18:49:15 -05:00
Silarn 08bcebe19c Changes to compile and run with python3 (WIP) 2018-08-20 18:49:15 -05:00
LostDragonist 4900135130 Merge pull request #13 from AnyOldName3/free-plugin-support
Add support for free plugins which don't implement any specialised interface
2018-08-15 15:41:55 -05:00
AnyOldName3 b70fa8174e Add support for free plugins which don't implement any specialised interface 2018-08-15 15:34:08 +01:00
Brian Munro 437d89fc04 Merge pull request #12 from Modorganizer2/Develop
Stage for 2.1.3 release
2018-05-08 12:20:04 +02:00
Silarn 51b59de04d Changes to allow installer_NCC to use the game source set in the DL meta 2018-05-07 01:28:59 -05:00
Silarn 19015289cb Updating gitignore 2018-05-04 00:28:40 -05:00
Silarn e004b56dc9 Fit primarySources to new wrapper method 2018-05-03 22:32:31 -05:00
Jeremy Rimpo fba18c2b96 Merge pull request #11 from AnyOldName3/reusable-wrapper-template
Helpful error message and reduce code duplication
2018-05-03 20:49:05 -05:00
AnyOldName3 00c38f5f03 Remove superfluous template parameter specification to shrink lines to a more readable length. 2018-05-03 22:22:32 +01:00
AnyOldName3 8919fbd351 Use new template for game features wrappers. 2018-05-03 22:19:55 +01:00
Silarn 6a3a257ecd Allow for primary game sources and marking mods as converted/working 2018-05-03 16:17:39 -05:00
AnyOldName3 ec4945db3e Use new template for (non-pointless) uibase wrappers. 2018-05-03 22:02:06 +01:00
AnyOldName3 9f975b92b2 Create template for wrapper functions and add helpful error message. Use this for plugin wrappers. 2018-05-03 21:56:23 +01:00
Jeremy Rimpo 17c86ef540 Merge pull request #10 from AnyOldName3/proxy-multiple-inheritance-support
Return a plugin as multiple (differently-typed) instances to work aro…
2018-05-02 14:02:13 -05:00
AnyOldName3 7ab4b71ed3 Return a plugin as multiple (differently-typed) instances to work around multiple inheritance issues 2018-05-02 17:24:09 +01:00
Jeremy Rimpo 61ecb68918 Merge pull request #9 from AnyOldName3/implement-more-interfaces-2
Implement more interfaces
2018-05-01 18:25:53 -05:00
AnyOldName3 94886104f3 Prevent the C++ part of PyQt objects being deleted while the Python component is still accessible. 2018-05-02 00:19:29 +01:00
AnyOldName3 902024e508 Add Game Features support 2018-04-25 17:25:12 +01:00
AnyOldName3 0a9b4b9fc4 Change the capitalisation of sipapiaccess.h to make it consistent with other files 2018-04-22 15:39:09 +01:00
AnyOldName3 028c14a951 Add missing include guard to sipApiAccess.h 2018-04-22 15:37:29 +01:00
AnyOldName3 bf8f427cd8 Move sipAPI getter function to a shared header so it isn't duplicated. 2018-04-22 00:59:42 +01:00
AnyOldName3 8fe091ab48 Implement IPluginProxy bindings. 2018-04-22 00:34:59 +01:00
AnyOldName3 8877fee4fa Implement IpluginModPage bindings. 2018-04-20 16:40:39 +01:00
AnyOldName3 f13a5961df Align ModRepositoryFileInfo indentation 2018-04-20 16:40:39 +01:00
AnyOldName3 7b6ca76dec Handle conversion for types IPluginModPage depends on 2018-04-20 16:40:39 +01:00
AnyOldName3 a35208d902 Improve QVariant conversion and generalise QMap conversion 2018-04-20 16:40:39 +01:00
AnyOldName3 4feb06a099 Add IPluginFileMapper Wrapper and bindings. 2018-04-20 16:40:39 +01:00
AnyOldName3 0abbab9f8c Add missing parts of IOrganizer bindings 2018-04-20 16:40:39 +01:00
AnyOldName3 86d859d430 Allow anonymous Python functions to return values 2018-04-20 16:40:38 +01:00
AnyOldName3 5a730941db Implement wrapper and bindings for IPluginDiagnose 2018-04-20 16:40:38 +01:00
AnyOldName3 c70f78adfe Reduce code duplication by moving common implementation to macros 2018-04-20 16:40:38 +01:00
AnyOldName3 e8af8819df Add PYCATCH missed when rebasing 2018-04-20 16:40:38 +01:00
AnyOldName3 de809c6d57 Fix simple errors with IPluginGame proxy and add warning when the unimplemented part is encountered 2018-04-20 16:40:38 +01:00
AnyOldName3 01168483c5 handle errors in Python game plugins 2018-04-20 16:40:38 +01:00
AnyOldName3 317f13177e Move IPluginGameWrapper's mentod implementations into the cpp file 2018-04-20 16:40:38 +01:00
AnyOldName3 c47b94d534 Restore indentation which rearraging things broke 2018-04-20 16:40:38 +01:00
AnyOldName3 ca51a53d41 Make IPluginGameWrapper into a class and include the necessary Qt annotations 2018-04-20 16:40:38 +01:00
AnyOldName3 9722d5b093 Move IPluginGameWrapper to proxypluginwrappers.h as it's a wrapper for a plugin. 2018-04-20 16:40:38 +01:00
AnyOldName3 2df983e22c Create ExecutableInfo interface 2018-04-20 16:40:38 +01:00
AnyOldName3 52417d64e4 Implement missing handling for QFileInfo 2018-04-20 16:40:38 +01:00
AnyOldName3 4a558d4caf Implement from_python handling for QStringList 2018-04-20 16:40:38 +01:00
AnyOldName3 8dd9a710b4 Replace wrong QDir converter 2018-04-20 16:40:38 +01:00
AnyOldName3 377199f233 Put plugin wrappers in alphabetical order 2018-04-20 16:40:38 +01:00
Silarn 18a73c2f54 Remove remnants of QtScript and fix some CMake issues 2018-04-19 01:43:57 -05:00
Silarn fba28bb9ab Add SortMechanism check 2018-04-18 03:30:09 -05:00
Silarn cdbc0f3bdb Support for multi-game downloads 2018-04-16 13:07:56 -05:00
Silarn ffbd4e3f11 Support for multi-game downloads 2018-04-16 12:51:40 -05:00
Jeremy Rimpo e1ba01777d Merge pull request #8 from AnyOldName3/version-info-missing-parts
Add missing comparison operators and functions for MOBase::VersionInfo
2018-04-13 12:44:29 -05:00
Jeremy Rimpo 9cbb35d354 Merge pull request #7 from AnyOldName3/cleanup
Cleanup dead code & update .gitignore
2018-04-13 12:43:44 -05:00
Brian Munro abff0e890d Merge pull request #6 from Modorganizer2/Develop
Merge to Master for Release
2018-04-13 08:44:06 +02:00
Jeremy Rimpo c076d7a8bb Remove extraneous search code 2018-04-13 00:38:21 -05:00
AnyOldName3 e277c9b56b Add missing comparison operators and functions for MOBase::VersionInfo 2018-04-12 01:16:27 +01:00
AnyOldName3 d8ad6569ba remove dead include 2018-04-11 17:27:23 +01:00
AnyOldName3 e08b8be570 Remove dead code 2018-04-11 17:12:27 +01:00
AnyOldName3 aca861194d Update .gitignore with msbuild stuff 2018-04-11 17:10:55 +01:00
Silarn fdffe6f277 Prep for Qt 5.11 (backward-compatible) 2018-04-10 23:28:32 -05:00
Silarn 341daf5c5f Fix up CMAKE to use /MP and allow building through umbrella 2018-04-07 17:12:21 -05:00
Jeremy Rimpo b272bd12fe Merge pull request #5 from Modorganizer2/LePresidente-patch-1
Fixed typo causing compilation to fail
2018-03-19 13:33:10 -05:00
Brian Munro d6b673f149 Fixed typo causing compilation to fail
Fixed typo causing compilation to fail
2018-03-19 11:05:00 +02:00
Jeremy Rimpo 81ec421adb Merge pull request #4 from AnyOldName3/better-qflags-support
Better QFlags support
2018-03-17 00:02:12 -05:00
AnyOldName3 f3fa0baa41 Make indentation consistent 2018-03-17 00:35:59 +00:00
AnyOldName3 9a3465cc7a Register converters for all remaining uses of QFlags in the Python wrappers 2018-03-17 00:19:45 +00:00
AnyOldName3 277a2862b1 Make QFlags conversion bidirectional and register the converter for more uses of QFlags 2018-03-17 00:05:17 +00:00
Jeremy Rimpo 046e080943 Merge pull request #3 from AnyOldName3/register-missing-functions
Register some functions which Tannin created wrappers for, but omitte…
2018-03-16 13:28:41 -05:00
AnyOldName3 af7823b920 Register some functions which Tannin created wrappers for, but omitted to make accessible from Python 2018-03-16 17:03:48 +00:00
Jeremy Rimpo d408512a2c Merge pull request #2 from AnyOldName3/full-unicode-support
Allow conversion of any unicode sequence into a QString
2018-03-15 22:25:04 -05:00
AnyOldName3 10437e0aca Allow conversion of any unicode sequence into a QString 2018-03-16 00:32:21 +00:00
Al c6e8a223e1 Merge pull request #1 from AnyOldName3/unicode-support
Add support for converting Python unicode strings to QStrings
2018-03-15 23:26:31 +01:00
AnyOldName3 425ec8df5a Add support for converting Python unicode strings to QStrings 2018-03-15 21:21:23 +00:00
Jeremy Rimpo 39e17ebbe3 Merge pull request #6 from Silarn/mainline_dev
Allow getLauncherName to be overridden
2017-12-12 15:44:01 -06:00
Jeremy Rimpo fc0a257b51 Allow getLauncherName to be overridden 2017-12-12 12:41:28 -06:00
Brian Munro fe87c841a8 Merge pull request #5 from Silarn/mainline_dev
Add QDir and required function to pythonrunner to fix missing definition
2017-12-08 19:40:40 +02:00
Jeremy Rimpo 705d423839 Add QDir and required function to pythonrunner to fix missing definition 2017-12-08 02:41:53 -06:00
Brian Munro 9dff2ab02e Merge pull request #4 from Silarn/mainline_dev
Add CCPlugins support
2017-12-03 07:51:57 +02:00
Jeremy Rimpo 1bc41a72b4 Add CCPlugins support 2017-11-18 12:28:36 -06:00
Brian Munro d212bff9e9 Merge pull request #3 from Silarn/mainline_dev
Fix bind failure due to function overload and move to std bind (MSVC 2017 - Boost 1.65.1)
2017-11-05 17:26:29 +02:00
Jeremy Rimpo 85cb9b18e4 Fix bind failure due to function overload and move to std bind 2017-11-05 03:49:56 -06:00
LePresidente 6a5ab7f747 Updated cmakelists to get the QT5 location from the QT_ROOT variable, instead of expecting it in DEPENDENCIES_DIR. 2017-09-21 16:48:15 +02:00
Brian Munro 539b068b71 Merge pull request #2 from Hugues92/master
Cannot override basePath as it is not present in parent class
2017-03-29 07:35:28 -07:00
Hugues92 96dbb56467 Cannot override basePath as it is not present in parent class 2017-03-22 23:22:38 +01:00
Brian Munro ea408a05af Merge pull request #1 from ZachHaber/master
Adding basePath to python plugins
2017-01-17 20:23:22 -08:00
ZachHaber fa66025024 Adding basePath to python plugins
Adds the virtual function override to the boost python wrapper.
2017-01-17 17:05:22 -06:00
LePresidente 3e61a88abb added if statement to allow to build on msvc2013 2016-12-12 05:13:08 -08:00
lepresidente 828e35a129 changes required by adding gameNexusName to uibase. 2016-12-04 17:52:43 +02:00
lepresidente cc58ccc992 Fixed cmake python location.
Fixed build issue with VS2015.
2016-11-27 16:54:19 +02:00
Tannin aa37f30c68 bugfix: invalid return type in python api 2016-06-06 20:27:29 +02:00
Tannin f9353e4da0 translation 2016-06-04 20:39:14 +02:00
Tannin 9a310229e7 updated wrappers to current api 2016-05-06 22:45:52 +02:00
Tannin a78db4cbdc Merge branch 'ThosRTanner-issue/418' 2016-02-10 18:55:43 +01:00
Tannin 9502ea561e Merge branch 'issue/418' of https://github.com/ThosRTanner/modorganizer-plugin_python into ThosRTanner-issue/418
Conflicts:
	src/runner/uibasewrappers.h
2016-02-10 18:55:18 +01:00
Tannin 179deda6e4 Merge branch 'ThosRTanner-master' 2016-02-10 18:52:48 +01:00
Tannin fa85cc89d3 Merge branch 'master' of https://github.com/ThosRTanner/modorganizer-plugin_python into ThosRTanner-master
Conflicts:
	src/runner/uibasewrappers.h
2016-02-10 18:52:20 +01:00
Tannin ee31647014 minor cleanup 2016-02-09 19:34:09 +01:00
Thomas Tanner 4bb0994d71 Merge branch 'master' into issue/418 2016-01-24 15:57:54 +00:00
Thomas Tanner 4b8b75e641 Removing the 'get' in all function names and making FO4 plugin build
Merge branch 'master' of https://github.com/TanninOne/modorganizer-plugin_python

# Conflicts:
#	src/runner/uibasewrappers.h
2016-01-24 15:23:30 +00:00
Tannin 2fcb932e16 allow for game plugins to be written in python 2016-01-10 19:50:19 +01:00
Tannin 40192cb583 Merge branch 'master' of https://github.com/TanninOne/modorganizer-plugin_python 2015-12-28 14:35:43 +01:00
Tannin 163e3d4544 removed get-prefix from many getters 2015-12-28 14:35:35 +01:00
TanninOne a65763fb58 fixes to build system 2015-12-28 13:46:31 +01:00
Thomas Tanner d144d7c97b Fix const correctness 2015-12-26 15:47:50 +00:00
Thomas Tanner de99a71085 Merge branch 'master' into issue/418 2015-12-26 15:26:41 +00:00
Thomas Tanner 9bdb48c6bc Merge remote-tracking branch 'refs/remotes/TanninOne/master' into issue/418 2015-12-26 15:04:13 +00:00
Thomas Tanner a20b166290 Restore start download file method (3 of 3) 2015-12-20 22:25:45 +00:00
Thomas Tanner d1b2259cc5 For TanninOne/modarganizer#418
Changes to support getting list of mods / esps to activate from game plugin
2015-12-19 20:49:30 +00:00
Tannin 4bb048aa67 Merge branch 'master' of https://github.com/TanninOne/modorganizer-plugin_python
Conflicts:
	src/runner/pythonrunner.cpp
	src/runner/uibasewrappers.h
2015-12-06 20:58:22 +01:00
Tannin 0b53e86e5a updated python api 2015-12-06 20:55:36 +01:00
Thomas Tanner 9077573b9d Merge remote-tracking branch 'refs/remotes/TanninOne/master' 2015-12-06 18:08:43 +00:00
TanninOne 0fa436fc0f Merge pull request #5 from ThosRTanner/issue/344
Issue 344
2015-12-06 18:44:14 +01:00
Thomas Tanner d75eda53fc Merge remote-tracking branch 'TanninOne/master' into issue/344 2015-12-06 17:31:13 +00:00
Thomas Tanner a71566122e Merge remote-tracking branch 'TanninOne/master' into issue/344
# Conflicts:
#	src/runner/pythonrunner.cpp
#	src/runner/uibasewrappers.h
2015-12-06 17:31:02 +00:00
TanninOne 69b988eede Merge pull request #1 from ThosRTanner/issue/308
View web pages from non-nexus installs (3 of 4)
2015-12-06 17:56:42 +01:00
Thomas Tanner c106d6f342 Merge remote-tracking branch 'TanninOne/master' 2015-12-06 16:22:27 +00:00
Thomas Tanner 4a6f8e84f4 work through build issues 2015-12-06 16:13:29 +00:00
TanninOne efc0b1962f Merge branch 'ThosRTanner-issue/344' 2015-12-06 16:24:22 +01:00
TanninOne 8f408a77d2 Merge branch 'issue/344' of https://github.com/ThosRTanner/modorganizer-plugin_python into ThosRTanner-issue/344 2015-12-06 16:23:29 +01:00
Thomas Tanner dccc265364 Merge remote-tracking branch 'TanninOne/master' 2015-12-06 14:56:14 +00:00
TanninOne aa9c6ead94 Merge pull request #4 from ThosRTanner/issue/356
Refactor gameinfo & 'shared' library to use game plugins (7 of 17)
2015-12-06 13:21:25 +01:00
Thomas Tanner f94f37b635 Merge remote-tracking branch 'refs/remotes/TanninOne/master' into issue/356
Conflicts:
	src/runner/pythonrunner.cpp
2015-12-05 12:48:39 +00:00
Thomas Tanner 9fdcde3bd5 Merge remote-tracking branch 'TanninOne/master' into issue/344 2015-12-05 10:33:09 +00:00
Thomas Tanner 11c92e7e96 Merge remote-tracking branch 'refs/remotes/TanninOne/master' 2015-12-05 10:02:16 +00:00
Thomas Tanner 287a82ed48 Most of work for savegame 2015-12-05 06:51:41 +00:00
Thomas Tanner c9299bb623 Addition of directory validity check to IPluginGame API 2015-11-28 14:48:28 +00:00
Tannin 7d6d51b213 fixed build scripts and added fallout 4 support 2015-11-28 10:58:49 +01:00
Thomas Tanner e60121b21f Renamed getNexusName to getGameShortName as previously because it hopefully isn't too nexus related. 2015-11-26 21:17:06 +00:00
Thomas Tanner 7f7a3fb1ca Replaced the IPluginGame getNexusDisplayURL with some APIs in NexusInterface
It makes more sense to have them here as they have very little to do with the game, more to do with the origin of the mod.
2015-11-26 21:03:23 +00:00
Thomas Tanner 9ba337ef17 Remove the getNexusManagementURL as it is a property of how you talk to nexus, not the game 2015-11-26 17:45:30 +00:00
Thomas Tanner 1455bda2f8 Sigh - python wrapper version of the 2 URL fetch functions 2015-11-26 07:40:53 +00:00
Thomas Tanner cc62f15cc8 Replace GameInfo::getNexusModID with IPluginGame::getNexusModOrganizerID()
Also implement IPluginGame::getNexusGameID() but not hooked it in yet.
2015-11-24 16:16:10 +00:00
Thomas Tanner 0b9a56fa7a Replace GameInfo::getLoadorderMechanism with IPluginGame::getLoadOrderMechanism 2015-11-24 14:20:47 +00:00
Thomas Tanner fc8f6c77bc Remove most instances of GameInfo::getname, and transfer getDLCPlugins to the plugingame interface
Also removed startDownloadNextFile as it doesn't appear to be used anywhere
2015-11-23 18:34:04 +00:00
Thomas Tanner 55e9c9c7b6 Final eradication of igameinfo and adding python wrappers for IPluginGame 2015-11-22 21:18:12 +00:00
Thomas Tanner 47e25da95e Removes igameinfo.h from everywhere apart from (sort of) the pythonrunner plugin. 2015-11-22 08:42:42 +00:00
Thomas Tanner cb5d3b4e62 Replace GameInfo::path with iPluginGame::gameDirectory (or dataDirectory where applicable)
Note: this isn''t ideal as it's not backward compatible
2015-11-21 16:41:28 +00:00
Thomas Tanner 542ef73a30 Removal of (get)BinaryName.
Note in pythonrunner this is a bit commented out so I can think about how to deal with it.
2015-11-21 12:28:48 +00:00
Thomas Tanner f6d499e6c6 Merge remote-tracking branch 'refs/remotes/TanninOne/master' 2015-11-18 20:46:19 +00:00
Tannin fe2169650e updated build scripts 2015-11-16 21:39:53 +01:00
Thomas Tanner 07798f2e23 More changes suggested by compiling with clang 2015-11-09 18:14:57 +00:00
Thomas Tanner 86d2ce34f3 Fix compilation issues with clang, requires adding widgets to build 2015-11-08 23:15:55 +00:00
Thomas Tanner 88846e52f5 Add support for version dependency checks 2015-11-01 18:27:03 +00:00
Thomas Tanner 27704407a3 Add the python wrapper changes for the new setURL method 2015-10-15 19:06:04 +01:00
Thomas Tanner 3648690c5e Merge remote-tracking branch 'TanninOne/master' 2015-10-10 14:00:38 +01:00
Tannin 97787553f7 more work on build system 2015-10-09 19:57:45 +02:00
Tannin 10fd3e77d7 more work on build system 2015-10-09 19:57:17 +02:00
convert-repo f806d29a75 update tags 2015-09-07 16:36:52 +00:00
Tom Tanner 25ac05622a Small fix to shut up messages about long boost names 2015-08-20 19:53:39 +01:00
Tannin f29d9ac993 added plugin interface to add/remove/list categories to/from/of mods 2015-06-10 22:09:32 +02:00
Tom Tanner d8f49b3906 Update scons build 2015-05-28 20:42:15 +01:00
Tannin 25d9ad16c2 python runner is now bundled with MO as a separate file instead of embedded in the plugin 2015-05-24 18:44:57 +02:00
Tannin a5901d7975 extended plugin interface. Plugins can now activate/deactivate mods, install mods
suggesting a name and retrieve a list of all installed mods
2015-05-17 14:30:14 +02:00
Tannin a7b81418a5 fixes to make MO compile with mingw (also fixes some warnings generated by mingw) 2015-05-16 18:44:07 +02:00
Tannin 560e1ce0c7 Merge 2015-05-09 21:46:40 +02:00
Tannin 6edbec745d plugin can now have multiple states 2015-03-31 18:35:12 +02:00
Tom Tanner d6edcf4fa0 Adding an icon to nxmhandler so that it looks pretty in firefox 2015-03-28 10:39:40 +00:00
Tannin 50a725a1b4 Merge in changes by Tom Tanner 2015-03-27 18:24:37 +01:00
Tom Tanner a1fdb54471 Add in all the necessary stuff for scons 2015-03-25 22:35:53 +00:00
Tom Tanner e602014dda Fix a meory leak with modules that error during loading
More Sconscript stuff
2015-03-22 10:49:15 +00:00
Tom Tanner 90df417a8c Fixed Scons build for existing bits.
Changed pynedit.pro to fetch from 'standard' install location
Changed saveas code to use organizer report rather than uibase - this way it's
not dependant on the vagaries of the include path, and works the same as the
rest of the organiser directory
2015-03-20 10:34:30 +00:00
Tom Tanner cb9a7fcd2d Merge with branch1.2 2015-03-18 17:40:29 +00:00
Tom Tanner 9d2264aff8 Refactoring and cleanup. 2015-03-18 14:16:04 +00:00
Tom Tanner 0aeeb9365f Every plugin now built 2015-03-17 16:31:15 +00:00
Tom Tanner 3967d64437 Cleanup 2015-03-16 08:35:14 +00:00
Tom Tanner a7e881869e Yet more scons stuff. Now builds everything but the plugins, and installs all the dlls 2015-03-15 10:58:21 +00:00
Tom Tanner 3f66d206e8 More sconscripts set up 2015-03-14 14:59:52 +00:00
Tannin 9d48b75388 python proxy plugin should no longer throw a fit if another process locks the unpacked pythonrunner 2015-02-25 18:13:17 +01:00
Tannin 841b923751 better error handling in python runner extraction 2015-01-29 19:28:58 +01:00
Tannin 23fd430605 extended the game-plugin interface 2015-01-29 19:26:42 +01:00
Tannin 1a89e42c0f Merge with branch1.2 2015-01-24 19:34:12 +01:00
Tannin 42afc90c8d cleanup (mostly removing unused includes) 2015-01-22 19:44:38 +01:00
Tannin 9b989e9f97 bugfix: translations for some plugins weren't loaded 2015-01-11 11:14:58 +01:00
Tannin c7203bf9de - bugfixes
- moved more functionality to game-plugins
- further decoupled management functionality from the UI
- created another "tutorial" which is only a single page with relevant parts of
  the ui highlighted with info as tooltips
2015-01-06 19:31:53 +01:00
Tannin a7d626c83c Merge 2015-01-04 10:33:37 +01:00
Tannin bbea63e7af - fixes after merge 2015-01-04 10:13:12 +01:00
Tannin 9f607a5fcb Merge with branch1.2 2015-01-03 15:58:52 +01:00
Tannin b7edde6fa0 custom installers can now set the installation file (and the ncc installer now does) 2014-12-14 16:30:23 +01:00
Tannin 589325d91b - NCC installer can now discover files in other mods (thanks Reunion!) and knows the script extender version 2014-12-13 16:47:11 +01:00
Tannin 994018a491 minor fixes 2014-12-04 19:25:07 +01:00
Tannin 868ab93a1f replaced all uses of NULL with nullptr
fixed a few placed where NULL was used as a number or boolean
2014-11-28 11:19:20 +01:00
Tannin 7c8fafc196 several bugfixes from the bugfix-wc that I forgot to backport 2014-11-26 20:21:33 +01:00
Tannin dec620b5b7 - started on a refactoring moving functionality out of the MainWindow class
- started on support for game-plugins
2014-11-21 14:45:30 +01:00
Tannin 29c66c621d - updated staging script to use qt5 and to fetch translations from transifex
- removed call to function unavailable in Windows XP
2014-11-11 23:48:22 +01:00
Tannin 5da6a9d3bd - updated staging script to use qt5 and to fetch translations from transifex
- removed call to function unavailable in Windows XP
2014-11-11 23:48:22 +01:00
Tannin 7b5f01b49d - bsa parser will now cancel in case of a read error. Before, when attempting to parse a broken bsa it could take forever and continuously allocate memory
- better error message when bsa parsing fails
- slightly better support for font colors in bbcode converter
- configurator now also uses pyqt5
- bugfix: bsa hashing function converted backslashes to slashes instead of the other way around. hash calculation is still often wrong on folder names...
2014-11-09 14:01:48 +01:00
Tannin 573be8c6b5 - bsa parser will now cancel in case of a read error. Before, when attempting to parse a broken bsa it could take forever and continuously allocate memory
- better error message when bsa parsing fails
- slightly better support for font colors in bbcode converter
- configurator now also uses pyqt5
- bugfix: bsa hashing function converted backslashes to slashes instead of the other way around. hash calculation is still often wrong on folder names...
2014-11-09 14:01:48 +01:00
Tannin a738cef190 - moved the hook-recursion-protection to tls
- some code cleanup and consolidation
- hook.dll will now report all of its own exceptions
- some more logging during startup
- changed the way urls are encoded for download requests
- now displaying (one of the) process name(s) while waiting for a program to end
- bugfix: spawned processes were forced to leave the job
2014-09-29 20:35:35 +02:00
Tannin 2c661da2da - moved the hook-recursion-protection to tls
- some code cleanup and consolidation
- hook.dll will now report all of its own exceptions
- some more logging during startup
- changed the way urls are encoded for download requests
- now displaying (one of the) process name(s) while waiting for a program to end
- bugfix: spawned processes were forced to leave the job
2014-09-29 20:35:35 +02:00
Tannin 2bf3ba0984 plugins can now query the list of masters for a plugin 2014-09-10 20:37:17 +02:00
Tannin fa09fd7635 plugins can now query the list of masters for a plugin 2014-09-10 20:37:17 +02:00
Tannin b76c4a1869 - re-enabled building of loot_cli and started developing against the new api
- extended set of default categories
- more tolerand bbcode parser
- added a few colors for the bbcode parser
- more fixes to qt5 compatibility
- started work on ability to unloading (and thus re-loading) of plugins
- names of plugins are no longer localizable (because those names are also used to store settings)
- added settings to disable individual diagnosis settings
- path of dependencies is now configured in a .pri file instead of environment variablees
- bugfix: if the modid-input is canceled, the id was saved as -1 and wasn't re-requested from the user
- bugfix: moving files with the SHFileOperation-Api didn't update the vfs correctly (still not perfect but better)
- bugfix: attempt to remove the deleter-file seems to have caused error messages for some users
- bugfix: fixed a couple of cases that might have caused the tutorial to hang
2014-09-08 20:37:23 +02:00
Tannin 84fe2b0307 - re-enabled building of loot_cli and started developing against the new api
- extended set of default categories
- more tolerand bbcode parser
- added a few colors for the bbcode parser
- more fixes to qt5 compatibility
- started work on ability to unloading (and thus re-loading) of plugins
- names of plugins are no longer localizable (because those names are also used to store settings)
- added settings to disable individual diagnosis settings
- path of dependencies is now configured in a .pri file instead of environment variablees
- bugfix: if the modid-input is canceled, the id was saved as -1 and wasn't re-requested from the user
- bugfix: moving files with the SHFileOperation-Api didn't update the vfs correctly (still not perfect but better)
- bugfix: attempt to remove the deleter-file seems to have caused error messages for some users
- bugfix: fixed a couple of cases that might have caused the tutorial to hang
2014-09-08 20:37:23 +02:00
Tannin e7e686c361 - can now filter by mod content
- all files/directories that require write access can now be placed in AppData instead of the MO directory
2014-08-18 23:00:25 +02:00
Tannin ae8b6a39b0 - browser dialog now has a hidden url-field (for testing only)
- loot_cli is no longer part of this project. I will probably create a fork of loot that allows command-line usage instead
- loot integration now works with such a modified loot version
- integrated loot will now also integrate incompatibility messages in the MO UI
- overwrite-markers are now updated as the list order is changed
- fnis checker will now always allow the user to ignore fnis errors
- plugin interface now has a function to wait for handles returned from startApplication (which can be job or process handles)
- bugfix: non-mo mods sharing the name with regular mods now have a different internal name
- bugfix: using hotkeys the vanilla game-plugins could be moved
2014-07-27 18:34:32 +02:00
TheBloke 2dc9463951 pythonRunner.pro - formatting/consistency fixes
Same types of fixes as previous commit; missed this file.
2014-07-08 00:28:06 +01:00
TheBloke 1d4a4b485d .pro files - formatting/consistency fixes
Many small formatting changes to the majority of .pro files
 Consistent style for Qt version checking, using greaterThan(QT_MAJOR_VERSION, 4)
  This seems safest, as would continue to work for a future Qt 6 etc.
  Note that this makes redudundant the commit before this one, to organizer.pro
 Consistent indenting
 Moved some file configuration sections to be together with related sections
 Moved some installation-related sections (e.g. OUTDIR/DSTDIR) to be at the bottom,
  immediately before the related POST_LINK install lines.
 Similarly, in some cases separated out CONFIG(debug,.. checks into separate
  LIB/INCLUDE sections (high in file) and installation directory sections (low
   in file)
2014-07-07 23:32:18 +01:00
Tannin d5838c7560 - added pseudo-categories to filter for mo-managed vs. unmanaged mods
- deleted mods are now moved to the recycle bin instead of being deleted permanently
- reduced modinfo dialog for foreign mods
- foreign mods are now displayed with a pseudo-category
- added a signal when a plugin is moved
- bugfix: refreshing of directory structure for mods with bsas didn't work correctly when enabling a mod and on changing display of foreign mods
- bugfix: one mod in the list was assigned the same priority on the directory structure as the data directory
- bugfix: conflicts tab in the mod info dialog offered the hide option for files in bsas
2014-06-16 21:49:57 +02:00
Tannin 9cbf374166 - loot client now only updates the masterlist once per MO session
- new event to notify plugins of changed mod priority
- overwrite now shows up in the "checked" category instead of "unchecked"
- display of "foreign" mods can now be limited to only official content
- bugfix: bsa extraction dialog showed up even if the plugin was disabled
- bugfix: after detection of foreign mods the priority of the overwrite folder could get messed up
- bugfix: when displaying only the context menu for the mod list as a whole, the menu didn't disappear
- bugfix: MO crashed when trying to download via the integrated browser
2014-06-08 15:10:08 +02:00
Tannin f71bfff0e6 Merge 2014-05-28 14:23:11 +02:00
Tannin 8aa2ab4eac small bugfixes 2014-05-28 14:14:28 +02:00
Tannin 46a0ce9e38 - files in bsas are now only displayed in the data tab if they are managed by mo
- number of problems detected by MO is now displayed as a badge on the icon
- rephrased the explanation text on the Archives tab. unchecked plugin-loaded bsas no longer prompt a warning
- bsa extraction is now handled in a plugin
- added a way for plugins to react to mod installation
- re-enabled the automatic fix for asset order problems
- bugfix: In some cases when a download wasn't started successfully the download urls weren't stored in the meta file so no resume was possible
- bugfix: MO tried to resume downloads when it didn't have and download urls
- bugfix: downloads couldn't be paused if the download was already broken on the network layer
- bugfix: download managear did not recognize a file as downloaded if the download completed before signals were hooked up
- bugfix: in-place file replacement was re-broken
2014-05-25 15:39:45 +02:00
Tannin 15e635741c - mod list context menu split into two menus (one for whole list, one for selected mods)
- added option to combine category filters using "or"
- added context menu option for deselecting category filters
- slightly changed ui on the category filters
- added a sample plugin for cpp that can be built without building the rest of MO
- simple installer can now be configured to run without any user interaction
- extended interface for python plugins
- iorganizer implementation moved out of the main window
- nexus requests from plugins will now be identified in the user agent
- bugfix: shortcuts created from MO used the wrong working directory
- bugfix: deactivation of bsas didn't stick
- bugfix: file hiding mechanism wasn't active
- bugfix: executables linked on the toolbar couldn't be removed if the executable was removed first
- bugfix: the endorsement-filter couldn't be combined with other filters
- bugfix: python interface to repository bridge was broken
2014-05-13 21:20:44 +02:00
Tannin f56c605479 - bugfix: endless loop in detection of mod order problems 2014-05-04 16:13:35 +02:00
Tannin 617c76e9f8 - main window now has a small view displaying log messages
- mod list will now be highlighted when grouping is active is active
- download tooltip now supports bbcode markup in the description
- bbcode translator will now translate some named colors
- algorithm for detection of mod order problems is now more sophisticated
- exposed more functionality to python plugins
- updated to qt 4.8.6 dlls
- bugfix: plugin list wasn't
- bugfix: state changes in mod list wasn't always reported
- bugfix: loot client will now create necessary directory
- bugfix: NCC sometimes used wrong source path for extracting
- bugfix: removed noisy debug message
2014-05-04 14:50:01 +02:00
Tannin 96081888f1 Merge with branch1.1 2014-04-05 15:36:42 +02:00
Tannin af5958b0af some fixes towards qt5 compatibility 2014-03-16 20:04:57 +01:00
Tannin fee774db45 - added support for mod page plugins
- re-introduced the integrated browser
- added a plugin to download from the tes alliance page
- the download list now contains the file description
- nexus interface now stores cookies persistently to reduce number of required log-ins
2013-09-15 15:20:00 +02:00
131 changed files with 9477 additions and 2722 deletions
+21
View File
@@ -0,0 +1,21 @@
---
# We'll use defaults from the LLVM style, but with 4 columns indentation.
BasedOnStyle: LLVM
IndentWidth: 4
---
Language: Cpp
# Force pointers to the type for C++.
DerivePointerAlignment: false
PointerAlignment: Left
AlignConsecutiveAssignments: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AlwaysBreakTemplateDeclarations: Yes
AccessModifierOffset: -4
AlignTrailingComments: true
SpacesBeforeTrailingComments: 2
NamespaceIndentation: All
MaxEmptyLinesToKeep: 1
BreakBeforeBraces: Stroustrup
ColumnLimit: 88
+2
View File
@@ -0,0 +1,2 @@
1bffcfa8bfba93a9505692b11fdd3f0903983542
7108d59267b0fe4e9442f9bb146ea5d70e7704a8
+8
View File
@@ -0,0 +1,8 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.cpp text eol=crlf
*.h text eol=crlf
*.py text eol=crlf
+38
View File
@@ -0,0 +1,38 @@
name: Build & Test Plugin Python
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
env:
VCPKG_BINARY_SOURCES: ${{ vars.AZ_BLOB_VCPKG_URL != '' && format('clear;x-azblob,{0},{1},readwrite', vars.AZ_BLOB_VCPKG_URL, secrets.AZ_BLOB_SAS) || '' }}
jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Configure Plugin Python
id: configure-plugin-python
uses: ModOrganizer2/build-with-mob-action@master
with:
mo2-dependencies: uibase
mo2-skip-build: true
- name: Build Plugin Python
working-directory: ${{ steps.configure-plugin-python.outputs.working-directory }}
run: cmake --build vsbuild --config RelWithDebInfo --verbose `
--target python-tests --target runner-tests --target proxy
- name: Test Plugin Python
working-directory: ${{ steps.configure-plugin-python.outputs.working-directory }}
run: ctest --test-dir vsbuild -C RelWithDebInfo --output-on-failure
- name: Install Plugin Python
working-directory: ${{ steps.configure-plugin-python.outputs.working-directory }}
run: cmake --build vsbuild --config RelWithDebInfo --target INSTALL
+24
View File
@@ -0,0 +1,24 @@
name: Lint Plugin Python
on:
push:
pull_request:
types: [opened, synchronize, reopened]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check format
uses: ModOrganizer2/check-formatting-action@master
with:
check-path: "."
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- uses: abatilo/actions-poetry@v2
- name: Check format Python tests
run: |
poetry install --no-root
poetry run poe lint
+12
View File
@@ -0,0 +1,12 @@
# build
edit
CMakeLists.txt.user
/msbuild.log
/*std*.log
/*build
# python
tests/**/__pycache__
# IDE
.vscode
+20
View File
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-case-conflict
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v22.1.5
hooks:
- id: clang-format
'types_or': [c++, c]
ci:
autofix_commit_msg: "[pre-commit.ci] Auto fixes from pre-commit.com hooks."
autofix_prs: true
autoupdate_commit_msg: "[pre-commit.ci] Pre-commit autoupdate."
autoupdate_schedule: quarterly
submodules: false
+46
View File
@@ -0,0 +1,46 @@
cmake_minimum_required(VERSION 3.16)
cmake_policy(SET CMP0144 NEW)
project(plugin_python CXX)
# we need mo2-cmake to obtain the Python version, but mo2-cmake will set
# CMAKE_MAP_IMPORTED_CONFIG_* which will trigger a tons of CMP0111 warnings for Python
# below so we need to reset these before finding Python and then reset them after
find_package(mo2-cmake CONFIG REQUIRED)
set(_CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL ${CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL})
set(_CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO ${CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO})
set(_CMAKE_MAP_IMPORTED_CONFIG_RELEASE ${CMAKE_MAP_IMPORTED_CONFIG_RELEASE})
set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL "")
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO "")
set(CMAKE_MAP_IMPORTED_CONFIG_RELEASE "")
# find Python before include mo2-cmake, otherwise this will trigger a bunch of CMP0111
# due to the imported configuration mapping variables defined in mo2.cmake
find_package(Python ${MO2_PYTHON_VERSION} EXACT COMPONENTS Interpreter Development REQUIRED)
find_package(pybind11 CONFIG REQUIRED)
set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL ${_CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL})
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO ${_CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO})
set(CMAKE_MAP_IMPORTED_CONFIG_RELEASE ${_CMAKE_MAP_IMPORTED_CONFIG_RELEASE})
get_filename_component(Python_HOME ${Python_EXECUTABLE} PATH)
set(Python_DLL_DIR "${Python_HOME}/DLLs")
set(Python_LIB_DIR "${Python_HOME}/Lib")
mo2_python_install_pyqt()
# useful for naming DLL, zip, etc. (3.10 -> 310)
set(Python_VERSION_SHORT ${Python_VERSION_MAJOR}${Python_VERSION_MINOR})
# projects
add_subdirectory(src)
# tests (if requested)
set(BUILD_TESTING ${BUILD_TESTING} CACHE BOOL "build tests for plugin_python")
if (BUILD_TESTING)
enable_testing()
add_subdirectory(tests)
endif()
+73
View File
@@ -0,0 +1,73 @@
{
"configurePresets": [
{
"errors": {
"deprecated": true
},
"hidden": true,
"name": "cmake-dev",
"warnings": {
"deprecated": true,
"dev": true
}
},
{
"cacheVariables": {
"VCPKG_MANIFEST_NO_DEFAULT_FEATURES": {
"type": "BOOL",
"value": "ON"
}
},
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"hidden": true,
"name": "vcpkg"
},
{
"cacheVariables": {
"VCPKG_MANIFEST_FEATURES": {
"type": "STRING",
"value": "testing"
}
},
"hidden": true,
"inherits": ["vcpkg"],
"name": "vcpkg-dev"
},
{
"binaryDir": "${sourceDir}/vsbuild",
"architecture": {
"strategy": "set",
"value": "x64"
},
"cacheVariables": {
"CMAKE_CXX_FLAGS": "/EHsc /MP /W4",
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "x64-windows-static-md"
}
},
"generator": "Visual Studio 17 2022",
"inherits": ["cmake-dev", "vcpkg-dev"],
"name": "vs2022-windows",
"toolset": "v143"
},
{
"cacheVariables": {
"VCPKG_MANIFEST_FEATURES": {
"type": "STRING",
"value": "standalone;testing"
}
},
"inherits": "vs2022-windows",
"name": "vs2022-windows-standalone"
}
],
"buildPresets": [
{
"name": "vs2022-windows",
"resolvePackageReferences": "on",
"configurePreset": "vs2022-windows"
}
],
"version": 4
}
+68
View File
@@ -0,0 +1,68 @@
# ModOrganizer2 - Python Proxy
This repository contains the Python proxy plugin for ModOrganizer2.
The proxy plugin allow developers to write Python plugins for ModOrganizer2.
## Setup, build, tests
This repository is part of MO2 main repositories and should usually be build using
[`mob`](https://github.com/ModOrganizer2/mob).
## Organization
This repositories contains 5 sub-projects in `src`.
The interface between Python and C++ is done using the
[`pybind11`](https://github.com/pybind/pybind11) library.
See the `README` in the subfolder (when there is one) for more details.
- [`src/proxy`](src/proxy/) contains the actual proxy plugin.
This project is a simple interface between MO2 and the runner (see below).
The CMake code:
- generates the `plugin_python.dll` library,
- generates the translation file (under `src/`),
- installs necessary files for the plugin (Python DLL, Python libraries, etc),
including `mobase`.
- [`src/runner`](src/runner/) contains the Python runner. This is the project that
instantiates a Python interpreter and load/unload Python plugins.
- [`src/pybind11-qt`](src/pybind11-qt/) contains many utility stuff to interface
pybind11 with Qt and PyQt.
- [`src/pybind11-utils`](src/pybind11-utils/) contains some utility stuff pybind11.
This project is header-only.
- [`src/mobase`](src/mobase) contains the Python plugin interface.
- This projects generates the `mobase` Python library.
Some (woefully incomplete) tests are available under `tests`, split in three
sub-directories:
- [`tests/mocks`](tests/mocks/) simply contains mocks of `uibase` interfaces to be used
in the two other test projects.
- [`tests/python`](tests/python/) contains Python tests for `pytest`.
This project generates a bunch of Python test libraries that are then imported in
Python test files (`test_*.py`) and tested using `pytest`.
These tests mostly cover the pybind11 Qt and utility stuff, and some standalone
MO2 classes and functions (`IFileTree`, `GuessedString`, etc).
- [`tests/runner`](tests/runner/) contains C++ tests, using GTest
Tests in this project instantiate a Python runner and then use it to check that
plugins implemented in Python can be used properly on the C++ side.
## Building & Running tests
Tests are not built by default with `mob`, so you will need to run `cmake` manually
with the proper arguments.
You need to define `PLUGIN_PYTHON_TESTS` with `-DPLUGIN_PYTHON_TESTS` when running
the configure step of cmake.
You can then build the tests
```bash
# replace vsbuild with your build folder
cmake --build vsbuild --config RelWithDebInfo --target "python-tests" "runner-tests"
```
To run the tests, use `ctest`
```bash
# replace vsbuild with your build folder
ctest.exe --test-dir vsbuild -C RelWithDebInfo
```
Generated
+254
View File
@@ -0,0 +1,254 @@
# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand.
[[package]]
name = "colorama"
version = "0.4.6"
description = "Cross-platform colored terminal text."
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
files = [
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
]
[[package]]
name = "iniconfig"
version = "2.0.0"
description = "brain-dead simple config-ini parsing"
optional = false
python-versions = ">=3.7"
files = [
{file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"},
{file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"},
]
[[package]]
name = "mobase-stubs"
version = "2.5.1a0"
description = "PEP561 stub files for the mobase Python API."
optional = false
python-versions = "<4.0,>=3.12"
files = [
{file = "mobase_stubs-2.5.1a0-py3-none-any.whl", hash = "sha256:bcaecfae038b890d82280fc518f7e44f38d22d35801a8ba7ffa480f7756d6823"},
{file = "mobase_stubs-2.5.1a0.tar.gz", hash = "sha256:a8dc5574336ed3b1f673288447781f705a078472cf8808e05a36f129c81c8e20"},
]
[[package]]
name = "nodeenv"
version = "1.9.1"
description = "Node.js virtual environment builder"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
files = [
{file = "nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9"},
{file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"},
]
[[package]]
name = "packaging"
version = "24.1"
description = "Core utilities for Python packages"
optional = false
python-versions = ">=3.8"
files = [
{file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"},
{file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"},
]
[[package]]
name = "pastel"
version = "0.2.1"
description = "Bring colors to your terminal."
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
files = [
{file = "pastel-0.2.1-py2.py3-none-any.whl", hash = "sha256:4349225fcdf6c2bb34d483e523475de5bb04a5c10ef711263452cb37d7dd4364"},
{file = "pastel-0.2.1.tar.gz", hash = "sha256:e6581ac04e973cac858828c6202c1e1e81fee1dc7de7683f3e1ffe0bfd8a573d"},
]
[[package]]
name = "pluggy"
version = "1.5.0"
description = "plugin and hook calling mechanisms for python"
optional = false
python-versions = ">=3.8"
files = [
{file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"},
{file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"},
]
[package.extras]
dev = ["pre-commit", "tox"]
testing = ["pytest", "pytest-benchmark"]
[[package]]
name = "poethepoet"
version = "0.23.0"
description = "A task runner that works well with poetry."
optional = false
python-versions = ">=3.8"
files = [
{file = "poethepoet-0.23.0-py3-none-any.whl", hash = "sha256:d573ff31d7678e62b6f9bc9a1291ae2009ac14e0eead0a450598f9f05abb27a3"},
{file = "poethepoet-0.23.0.tar.gz", hash = "sha256:62a0a6a518df5985c191aee0c1fcd2bb6a0a04eb102997786fcdf118e4147d22"},
]
[package.dependencies]
pastel = ">=0.2.1,<0.3.0"
tomli = ">=1.2.2"
[package.extras]
poetry-plugin = ["poetry (>=1.0,<2.0)"]
[[package]]
name = "pybind11-stubgen"
version = "2.5.1"
description = "PEP 561 type stubs generator for pybind11 modules"
optional = false
python-versions = "~=3.7"
files = [
{file = "pybind11-stubgen-2.5.1.tar.gz", hash = "sha256:4427a67038a00c5ac1637ffa6c65728c67c5b1251ecc23c7704152be0b14cc0b"},
{file = "pybind11_stubgen-2.5.1-py3-none-any.whl", hash = "sha256:544d49df57da827c8761e7f6ef6bca996df80a33c9fd21c2521d694d4e72fe8d"},
]
[[package]]
name = "pyqt6"
version = "6.7.0"
description = "Python bindings for the Qt cross platform application toolkit"
optional = false
python-versions = ">=3.8"
files = [
{file = "PyQt6-6.7.0-1-cp38-abi3-macosx_10_14_universal2.whl", hash = "sha256:656734112853fde1be0963f0ad362e5efd87ba6c6ff234cb1f9fe8003ee254e6"},
{file = "PyQt6-6.7.0-1-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:fa2d27fc2f5340f3f1e145c815101ef4550771a9e4bfafd4c7c2479fe83d9488"},
{file = "PyQt6-6.7.0-1-cp38-abi3-win_amd64.whl", hash = "sha256:6a1f6dfe03752f888b5e628c208f9fd1a03bda7ebda59ffed8c13580289a1892"},
{file = "PyQt6-6.7.0-cp38-abi3-macosx_10_14_universal2.whl", hash = "sha256:919ffb01020ece42209228bf94b4f2c156a6b77cc5a69a90a05e358b0333750b"},
{file = "PyQt6-6.7.0-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:e294f025f94493ee12b66efd6893fab309c9063172bb8a5b184f84dfc1ebcc49"},
{file = "PyQt6-6.7.0-cp38-abi3-win_amd64.whl", hash = "sha256:9d8865fb6357dba032002c4554a9648e88f2b4706c929cc51fba58edafad91fc"},
{file = "PyQt6-6.7.0.tar.gz", hash = "sha256:3d31b2c59dc378ee26e16586d9469842483588142fc377280aad22aaf2fa6235"},
]
[package.dependencies]
PyQt6-Qt6 = ">=6.7.0,<6.8.0"
PyQt6-sip = ">=13.6,<14"
[[package]]
name = "pyqt6-qt6"
version = "6.7.2"
description = "The subset of a Qt installation needed by PyQt6."
optional = false
python-versions = "*"
files = [
{file = "PyQt6_Qt6-6.7.2-py3-none-macosx_10_14_x86_64.whl", hash = "sha256:065415589219a2f364aba29d6a98920bb32810286301acbfa157e522d30369e3"},
{file = "PyQt6_Qt6-6.7.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7f817efa86a0e8eda9152c85b73405463fbf3266299090f32bbb2266da540ead"},
{file = "PyQt6_Qt6-6.7.2-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:fc93945eaef4536d68bd53566535efcbe78a7c05c2a533790a8fd022bac8bfaa"},
{file = "PyQt6_Qt6-6.7.2-py3-none-win_amd64.whl", hash = "sha256:b2d7e5ddb1b9764cd60f1d730fa7bf7a1f0f61b2630967c81761d3d0a5a8a2e0"},
]
[[package]]
name = "pyqt6-sip"
version = "13.6.0"
description = "The sip module support for PyQt6"
optional = false
python-versions = ">=3.7"
files = [
{file = "PyQt6_sip-13.6.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d6b5f699aaed0ac1fcd23e8fbca70d8a77965831b7c1ce474b81b1678817a49d"},
{file = "PyQt6_sip-13.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:8c282062125eea5baf830c6998587d98c50be7c3a817a057fb95fef647184012"},
{file = "PyQt6_sip-13.6.0-cp310-cp310-win32.whl", hash = "sha256:fa759b6339ff7e25f9afe2a6b651b775f0a36bcb3f5fa85e81a90d3b033c83f4"},
{file = "PyQt6_sip-13.6.0-cp310-cp310-win_amd64.whl", hash = "sha256:8f9df9f7ccd8a9f0f1d36948c686f03ce1a1281543a3e636b7b7d5e086e1a436"},
{file = "PyQt6_sip-13.6.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:5b9c6b6f9cfccb48cbb78a59603145a698fb4ffd176764d7083e5bf47631d8df"},
{file = "PyQt6_sip-13.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:86a7b67c64436e32bffa9c28c9f21bf14a9faa54991520b12c3f6f435f24df7f"},
{file = "PyQt6_sip-13.6.0-cp311-cp311-win32.whl", hash = "sha256:58f68a48400e0b3d1ccb18090090299bad26e3aed7ccb7057c65887b79b8aeea"},
{file = "PyQt6_sip-13.6.0-cp311-cp311-win_amd64.whl", hash = "sha256:0dfd22cfedd87e96f9d51e0778ca2ba3dc0be83e424e9e0f98f6994d8d9c90f0"},
{file = "PyQt6_sip-13.6.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:3bf03e130fbfd75c9c06e687b86ba375410c7a9e835e4e03285889e61dd4b0c4"},
{file = "PyQt6_sip-13.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:43fb8551796030aae3d66d6e35e277494071ec6172cd182c9569ab7db268a2f5"},
{file = "PyQt6_sip-13.6.0-cp312-cp312-win32.whl", hash = "sha256:13885361ca2cb2f5085d50359ba61b3fabd41b139fb58f37332acbe631ef2357"},
{file = "PyQt6_sip-13.6.0-cp312-cp312-win_amd64.whl", hash = "sha256:24441032a29791e82beb7dfd76878339058def0e97fdb7c1cea517f3a0e6e96b"},
{file = "PyQt6_sip-13.6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3075d8b325382750829e6cde6971c943352309d35768a4d4da0587459606d562"},
{file = "PyQt6_sip-13.6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a6ce80bc24618d8a41be8ca51ad9f10e8bc4296dd90ab2809573df30a23ae0e5"},
{file = "PyQt6_sip-13.6.0-cp38-cp38-win32.whl", hash = "sha256:fa7b10af7488efc5e53b41dd42c0f421bde6c2865a107af7ae259aff9d841da9"},
{file = "PyQt6_sip-13.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:9adf672f9114687533a74d5c2d4c03a9a929ad5ad9c3e88098a7da1a440ab916"},
{file = "PyQt6_sip-13.6.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:98bf954103b087162fa63b3a78f30b0b63da22fd6450b610ec1b851dbb798228"},
{file = "PyQt6_sip-13.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:39854dba35f8e5a4288da26ecb5f40b4c5ec1932efffb3f49d5ea435a7f37fb3"},
{file = "PyQt6_sip-13.6.0-cp39-cp39-win32.whl", hash = "sha256:747f6ca44af81777a2c696bd501bc4815a53ec6fc94d4e25830e10bc1391f8ab"},
{file = "PyQt6_sip-13.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:33ea771fe777eb0d1a2c3ef35bcc3f7a286eb3ff09cd5b2fdd3d87d1f392d7e8"},
{file = "PyQt6_sip-13.6.0.tar.gz", hash = "sha256:2486e1588071943d4f6657ba09096dc9fffd2322ad2c30041e78ea3f037b5778"},
]
[[package]]
name = "pyright"
version = "1.1.369"
description = "Command line wrapper for pyright"
optional = false
python-versions = ">=3.7"
files = [
{file = "pyright-1.1.369-py3-none-any.whl", hash = "sha256:06d5167a8d7be62523ced0265c5d2f1e022e110caf57a25d92f50fb2d07bcda0"},
{file = "pyright-1.1.369.tar.gz", hash = "sha256:ad290710072d021e213b98cc7a2f90ae3a48609ef5b978f749346d1a47eb9af8"},
]
[package.dependencies]
nodeenv = ">=1.6.0"
[package.extras]
all = ["twine (>=3.4.1)"]
dev = ["twine (>=3.4.1)"]
[[package]]
name = "pytest"
version = "8.2.2"
description = "pytest: simple powerful testing with Python"
optional = false
python-versions = ">=3.8"
files = [
{file = "pytest-8.2.2-py3-none-any.whl", hash = "sha256:c434598117762e2bd304e526244f67bf66bbd7b5d6cf22138be51ff661980343"},
{file = "pytest-8.2.2.tar.gz", hash = "sha256:de4bb8104e201939ccdc688b27a89a7be2079b22e2bd2b07f806b6ba71117977"},
]
[package.dependencies]
colorama = {version = "*", markers = "sys_platform == \"win32\""}
iniconfig = "*"
packaging = "*"
pluggy = ">=1.5,<2.0"
[package.extras]
dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
[[package]]
name = "ruff"
version = "0.2.2"
description = "An extremely fast Python linter and code formatter, written in Rust."
optional = false
python-versions = ">=3.7"
files = [
{file = "ruff-0.2.2-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:0a9efb032855ffb3c21f6405751d5e147b0c6b631e3ca3f6b20f917572b97eb6"},
{file = "ruff-0.2.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:d450b7fbff85913f866a5384d8912710936e2b96da74541c82c1b458472ddb39"},
{file = "ruff-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ecd46e3106850a5c26aee114e562c329f9a1fbe9e4821b008c4404f64ff9ce73"},
{file = "ruff-0.2.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e22676a5b875bd72acd3d11d5fa9075d3a5f53b877fe7b4793e4673499318ba"},
{file = "ruff-0.2.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1695700d1e25a99d28f7a1636d85bafcc5030bba9d0578c0781ba1790dbcf51c"},
{file = "ruff-0.2.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:b0c232af3d0bd8f521806223723456ffebf8e323bd1e4e82b0befb20ba18388e"},
{file = "ruff-0.2.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f63d96494eeec2fc70d909393bcd76c69f35334cdbd9e20d089fb3f0640216ca"},
{file = "ruff-0.2.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6a61ea0ff048e06de273b2e45bd72629f470f5da8f71daf09fe481278b175001"},
{file = "ruff-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e1439c8f407e4f356470e54cdecdca1bd5439a0673792dbe34a2b0a551a2fe3"},
{file = "ruff-0.2.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:940de32dc8853eba0f67f7198b3e79bc6ba95c2edbfdfac2144c8235114d6726"},
{file = "ruff-0.2.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0c126da55c38dd917621552ab430213bdb3273bb10ddb67bc4b761989210eb6e"},
{file = "ruff-0.2.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:3b65494f7e4bed2e74110dac1f0d17dc8e1f42faaa784e7c58a98e335ec83d7e"},
{file = "ruff-0.2.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1ec49be4fe6ddac0503833f3ed8930528e26d1e60ad35c2446da372d16651ce9"},
{file = "ruff-0.2.2-py3-none-win32.whl", hash = "sha256:d920499b576f6c68295bc04e7b17b6544d9d05f196bb3aac4358792ef6f34325"},
{file = "ruff-0.2.2-py3-none-win_amd64.whl", hash = "sha256:cc9a91ae137d687f43a44c900e5d95e9617cb37d4c989e462980ba27039d239d"},
{file = "ruff-0.2.2-py3-none-win_arm64.whl", hash = "sha256:c9d15fc41e6054bfc7200478720570078f0b41c9ae4f010bcc16bd6f4d1aacdd"},
{file = "ruff-0.2.2.tar.gz", hash = "sha256:e62ed7f36b3068a30ba39193a14274cd706bc486fad521276458022f7bccb31d"},
]
[[package]]
name = "tomli"
version = "2.0.1"
description = "A lil' TOML parser"
optional = false
python-versions = ">=3.7"
files = [
{file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
{file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
]
[metadata]
lock-version = "2.0"
python-versions = "^3.12"
content-hash = "4a3746f1080ab40c4cfde6777517db502e124fe088e971895bd7f7c245c3fa3e"
+53
View File
@@ -0,0 +1,53 @@
[tool.poetry]
name = "modorganizer-plugin_python"
version = "3.0.0"
description = ""
authors = ["Mikaël Capelle <capelle.mikael@gmail.com>"]
[tool.poetry.dependencies]
python = "^3.12"
[tool.poetry.group.dev.dependencies]
pyright = "^1.1.369"
ruff = "^0.2.1"
poethepoet = "^0.23.0"
mobase-stubs = { version = "^2.5.1a0", allow-prereleases = true }
pyqt6 = "^6.7.0"
pytest = "^8.2.2"
pybind11-stubgen = "^2.5.1"
[tool.poe.tasks]
format-imports = "ruff check --select I tests typings --fix"
format-ruff = "ruff format tests typings"
format.sequence = ["format-imports", "format-ruff"]
lint-ruff = "ruff check tests typings"
lint-ruff-format = "ruff format --check tests typings"
lint.sequence = ["lint-ruff", "lint-ruff-format"]
lint.ignore_fail = "return_non_zero"
[tool.ruff]
target-version = "py312"
[tool.ruff.lint]
extend-select = ["B", "Q", "I"]
[tool.ruff.lint.isort.sections]
mobase = ["mobase"]
mobase_tests = ["mobase_tests"]
[tool.ruff.lint.isort]
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"mobase",
"mobase_tests",
"local-folder",
]
[tool.pyright]
typeCheckingMode = "strict"
reportMissingTypeStubs = true
reportMissingModuleSource = false
pythonPlatform = "Windows"
+8
View File
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.16)
# order matters
add_subdirectory(pybind11-qt)
add_subdirectory(pybind11-utils)
add_subdirectory(mobase)
add_subdirectory(runner)
add_subdirectory(proxy)
+38
View File
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.16)
find_package(Qt6 COMPONENTS Core)
find_package(mo2-uibase CONFIG REQUIRED)
pybind11_add_module(mobase MODULE)
mo2_default_source_group()
mo2_configure_target(mobase
NO_SOURCES
WARNINGS 4
EXTERNAL_WARNINGS 4
AUTOMOC ON
TRANSLATIONS OFF
)
mo2_target_sources(mobase
FOLDER src
PRIVATE
deprecation.cpp
deprecation.h
mobase.cpp
pybind11_all.h
)
mo2_target_sources(mobase
FOLDER src/wrappers
PRIVATE
./wrappers/basic_classes.cpp
./wrappers/game_features.cpp
./wrappers/known_folders.h
./wrappers/pyfiletree.cpp
./wrappers/pyfiletree.h
./wrappers/pyplugins.cpp
./wrappers/pyplugins.h
./wrappers/utils.cpp
./wrappers/widgets.cpp
./wrappers/wrappers.cpp
./wrappers/wrappers.h
)
target_link_libraries(mobase PRIVATE pybind11::qt pybind11::utils mo2::uibase Qt6::Core)
+110
View File
@@ -0,0 +1,110 @@
# mobase
`mobase` is a ModOrganizer2 Python API.
It provides access to the part of
[`uibase`](https://github.com/ModOrganizer2/modorganizer-uibase) C++ API from
Python through [`pybind11`](https://github.com/pybind/pybind11).
## Organization
**Important:** All (most) files should include `pybind11_all.h` (either directly
or through another header) to get proper `type_caster` available.
- `mobase.cpp` contains the `PYBIND11_MODULE` definition of `mobase` but is otherwise
the entrypoint for other functions.
- `wrappers.h` contains the declaration of most functions implemented under
`wrappers/`.
- The other files under `wrappers/` contains bindings and trampoline classes (see
below) for `uibase` classes.
- `basic_classes.cpp` contains the bindings for most classes that cannot be extended
in Python (`IOrganizer`, `IModInterface`, etc.)
- `game_features.cpp` contains the bindings and trampoline classes for game features.
- `pyfiletree.h` and `pyfiletree.cpp` contains bindings for the `IFileTree`-related
classes.
- `pyplugins.h` contains the trampoline classes for the `IPluginXXX` classes and
`pyplugins.cpp` the bindings.
- `pyplugins.h` is required since the trampoline classes are tagged with `Q_OBJECT`,
and MOC does not work if the classes are declared in a C++ file.
- `pyplugins.cpp` also contains the `extract_plugins` function in `mobase.private`
that is used to extract plugins from Python object in the runner.
- `widgets.cpp` contains the bindings for the widget classes.
- `wrappers.cpp` contains the trampoline and bindings for non-plugin classes that can
be extended through Python.
## Updating mobase
### Classes that cannot be extended through Python
Updating or adding classes that cannot be extended through Python is quite easily.
One simply needs to declare the appropriate `py::class_` or add new `.def()`.
See below for things to remember when creating pybind11 bindings.
### Free functions
Similar to classes that cannot be extended through Python, see above.
### Classes that can be extended through Python: Plugins
To extend plugins, simply update the trampoline classes in `pyplugins.h` and the
bindings in `pyplugins.cpp`.
**Note:** For new plugins, simply look at the existing one.
### Classes that can be extended through Python: Game Features
To extend or expose game features:
- Create (if there is not already one) a trampoline class for the feature in
`game_features.cpp`.
- Add implementation of missing functions if required.
- Add the bindings in `add_game_feature_bindings` in `game_features.cpp`.
- For new feature, add the feature type to `GameFeaturesHelper::GameFeatures` in
`game_features.cpp`.
### Classes that can be extended through Python: Others
Non-plugin classes should be added to the `wrappers.cpp` file and should be exposed
with `std::shared_ptr<>` or `qobject_holder<>` holders.
- If the classes extends `QObject`, use a `qobject_holder`.
- Otherwise use a `std::shared_ptr<>` holder and add a `MO2_PYBIND11_SHARED_CPP_HOLDER`
declaration in `pybind11_all.h`.
Trampoline can be defined directly in `wrappers.cpp`, and bindings in the appropriate
function.
See the existing classes for example.
**Important:**
You need to make sure that `uibase` manipulates such classes through
`std::shared_ptr<>` (unless those inherit `QObject`).
Using `std::unique_ptr<>` is not possible since `std::unique_ptr<>` cannot have custom
runtime-specified deleters.
## Things to remember
Here are a few things to remember when creating bindings:
- If a function has multiple overloads that can conflict in Python, the more complex
one must be defined first as pybind11 will try calling them in order.
- If a C++ function expect a `QString`, `QFileInfo` or `QDir` that represents a file or
a directory, wrapping the function with `wrap_for_filepath` or `wrap_for_directory` is
a good idea. This allows Python to call the function with `pathlib.Path`.
- Most of the C++ function taking a reference to modify in C++ cannot be directly
exposed in Python since Python cannot modify reference to simple type (e.g.
`QString&` or `int&`).
The best way to expose such function is to bind a lambda that returns a variant from
Python, e.g.
```cpp
// assume the C++ function is QString fn(QString& foo, QString const& bar, int& maz);
m.def("function", [](QString& foo, QString const& bar, int& maz) {
// call the function
auto ret = function(foo, bar, maz);
// make a tuple containing the return value (if there is one), and the modified
// values passed by reference
return std::make_tuple(ret, foo, maz);
});
```
+55
View File
@@ -0,0 +1,55 @@
#include "deprecation.h"
#include <filesystem>
#include <set>
#include <pybind11/pybind11.h>
#include <QCoreApplication>
#include <uibase/log.h>
namespace py = pybind11;
namespace mo2::python {
void show_deprecation_warning(std::string_view name, std::string_view message,
bool show_once)
{
// Contains the list of filename / line number for which a deprecation
// warning has already been shown.
static std::set<std::pair<std::string, int>> DeprecatedLines;
// Find the caller:
auto inspect = py::module_::import("inspect");
auto current_frame = inspect.attr("currentframe")();
py::sequence callable_frame = inspect.attr("getouterframes")(current_frame, 2);
auto last_frame = callable_frame[py::int_(-1)];
auto filename = last_frame.attr("filename").cast<std::string>();
auto function = last_frame.attr("function").cast<std::string>();
auto lineno = last_frame.attr("lineno").cast<int>();
// Only show once if requested:
if (show_once && DeprecatedLines.contains({filename, lineno})) {
return;
}
// Register the deprecation:
DeprecatedLines.emplace(filename, lineno);
auto path = relative(std::filesystem::path(filename),
QCoreApplication::applicationDirPath().toStdWString());
// Show the message:
if (message.empty()) {
MOBase::log::warn("[deprecated] {} in {} [{}:{}].", name, function,
path.native(), lineno);
}
else {
MOBase::log::warn("[deprecated] {} in {} [{}:{}]: {}", name, function,
path.native(), lineno, message);
}
}
} // namespace mo2::python
+27
View File
@@ -0,0 +1,27 @@
#ifndef PYTHONRUNNER_UTILS_H
#define PYTHONRUNNER_UTILS_H
#include <string_view>
#include <pybind11/pybind11.h>
namespace mo2::python {
/**
* @brief Show a deprecation warning.
*
* This methods will print a warning in MO2 log containing the location of
* the call to the deprecated function. If show_once is true, the
* deprecation warning will only be logged the first time the function is
* called at this location.
*
* @param name Name of the deprecated function.
* @param message Deprecation message.
* @param show_once Only show the message once per call location.
*/
void show_deprecation_warning(std::string_view name, std::string_view message = "",
bool show_once = true);
} // namespace mo2::python
#endif
+86
View File
@@ -0,0 +1,86 @@
#pragma warning(disable : 4100)
#pragma warning(disable : 4996)
#include <format>
#include <tuple>
#include <variant>
#include <pybind11/embed.h>
#include "pybind11_all.h"
#include "wrappers/pyfiletree.h"
#include "wrappers/wrappers.h"
using namespace MOBase;
namespace py = pybind11;
PYBIND11_MODULE(mobase, m)
{
using namespace mo2::python;
m.add_object("PyQt6", py::module_::import("PyQt6"));
m.add_object("PyQt6.QtCore", py::module_::import("PyQt6.QtCore"));
m.add_object("PyQt6.QtGui", py::module_::import("PyQt6.QtGui"));
m.add_object("PyQt6.QtWidgets", py::module_::import("PyQt6.QtWidgets"));
// bindings
//
mo2::python::add_basic_bindings(m);
mo2::python::add_wrapper_bindings(m);
// game features must be added before plugins
mo2::python::add_game_feature_bindings(m);
mo2::python::add_igamefeatures_classes(m);
mo2::python::add_plugins_bindings(m);
// widgets
//
py::module_ widgets = m.def_submodule("widgets");
mo2::python::add_widget_bindings(widgets);
// utils
//
py::module_ utils = m.def_submodule("utils");
mo2::python::add_utils_bindings(utils);
// functions
//
m.def("getFileVersion", wrap_for_filepath(&MOBase::getFileVersion),
py::arg("filepath"));
m.def("getProductVersion", wrap_for_filepath(&MOBase::getProductVersion),
py::arg("executable"));
m.def("getIconForExecutable", wrap_for_filepath(&MOBase::iconForExecutable),
py::arg("executable"));
// typing stuff to be consistent with stubs and allow plugin developers to properly
// type their code if they want
{
m.add_object("TypeVar", py::module_::import("typing").attr("TypeVar"));
auto s = m.attr("__dict__");
// expose MoVariant
//
// this needs to be defined, otherwise MoVariant is not found when actually
// running plugins through MO2, making them crash (if plugins use MoVariant in
// their own code)
//
m.add_object(
"MoVariant",
py::eval("None | bool | int | str | list[object] | dict[str, object]"));
// same thing for GameFeatureType
//
m.add_object("GameFeatureType", py::eval("TypeVar('GameFeatureType')", s));
}
// private stuff for debugging/test
py::module_ moprivate = m.def_submodule("private");
// expose a function to create a particular tree, only for debugging
// purpose, not in mobase.
mo2::python::add_make_tree_function(moprivate);
moprivate.def("extract_plugins", &mo2::python::extract_plugins);
}
+146
View File
@@ -0,0 +1,146 @@
#ifndef PYTHON_PYBIND11_ALL_H
#define PYTHON_PYBIND11_ALL_H
#include <filesystem>
#include <QDir>
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/stl/filesystem.h>
#include "pybind11_qt/pybind11_qt.h"
#include "pybind11_utils/functional.h"
#include "pybind11_utils/generator.h"
#include "pybind11_utils/shared_cpp_owner.h"
#include "pybind11_utils/smart_variant_wrapper.h"
#include <uibase/game_features/game_feature.h>
#include <uibase/isavegame.h>
#include <uibase/pluginrequirements.h>
namespace mo2::python {
namespace detail {
template <>
struct smart_variant_converter<QString> {
static QString from(std::filesystem::path const& path)
{
return QString::fromStdWString(path.native());
}
static QString from(QFileInfo const& fileInfo)
{
return fileInfo.filePath();
}
static QString from(QDir const& dir) { return dir.path(); }
};
template <>
struct smart_variant_converter<std::filesystem::path> {
static std::filesystem::path from(QString const& value)
{
return {value.toStdWString()};
}
static std::filesystem::path from(QFileInfo const& fileInfo)
{
return fileInfo.filesystemFilePath();
}
static std::filesystem::path from(QDir const& dir)
{
return dir.filesystemPath();
}
};
// we do not need specialization for QFileInfo and QDir because both of them can
// be constructed from std::filesystem::path and QString already
} // namespace detail
using FileWrapper = smart_variant<QString, std::filesystem::path, QFileInfo>;
using DirectoryWrapper = smart_variant<QString, std::filesystem::path, QDir>;
// wrap the given function to accept FileWrapper (str | PathLike | QFileInfo) at the
// given argument positions (or any valid positions if Is... is empty)
//
template <std::size_t... Is, class Fn>
auto wrap_for_filepath(Fn&& fn)
{
return mo2::python::wrap_arguments<FileWrapper, Is...>(std::forward<Fn>(fn));
}
// wrap the given function to accept DirectoryWrapper (str | PathLike | QDir)
// at the given argument positions (or any valid positions if Is... is empty)
//
template <std::size_t... Is, class Fn>
auto wrap_for_directory(Fn&& fn)
{
return mo2::python::wrap_arguments<DirectoryWrapper, Is...>(
std::forward<Fn>(fn));
}
// wrap a function-like object to return a FileWrapper instead of its return type,
// useful to generate proper typing in Python
//
// note that QFileInfo has a __fspath__ in Python, so it is quite easy to convert
// from "FileWrapper", a.k.a., str | os.PathLike | QFileInfo to Path by simply
// calling Path() on the return type if necessary
//
// this should be combined with custom return-value in PYBIND11_OVERRIDE(_PURE), see
// ISaveGame binding for an example
//
template <class Fn>
auto wrap_return_for_filepath(Fn&& fn)
{
return mo2::python::wrap_return<FileWrapper>(std::forward<Fn>(fn));
}
// similar to wrap_return_for_filepath, except it returns a DirectoryWrapper instead
// of its return type
//
// this is much less practical than wrap_return_for_filepath since QDir does not
// expose __fspath__, so more complex things need to be done in Python, which is why
// this should be used carefully (e.g., should not be used if the return type is
// already QDir)
//
template <class Fn>
auto wrap_return_for_directory(Fn&& fn)
{
return mo2::python::wrap_return<DirectoryWrapper>(std::forward<Fn>(fn));
}
// convert a QList to QStringList - QString must be constructible from QString
//
template <class T>
QStringList toQStringList(QList<T> const& list)
{
static_assert(std::is_constructible_v<QString, T>,
"QString must be constructible from T.");
return {list.begin(), list.end()};
}
// convert a QStringList to a QList - T must be constructible from QString
//
template <class T>
QList<T> toQList(QStringList const& list)
{
static_assert(std::is_constructible_v<T, QString>,
"T must be constructible from QString.");
return {list.begin(), list.end()};
}
} // namespace mo2::python
MO2_PYBIND11_SHARED_CPP_HOLDER(MOBase::IPluginRequirement)
MO2_PYBIND11_SHARED_CPP_HOLDER(MOBase::ISaveGame)
MO2_PYBIND11_SHARED_CPP_HOLDER(MOBase::GameFeature)
#endif
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More