Commit Graph

291 Commits

Author SHA1 Message Date
WMOkiishi 098fe634a5
task: Annotate core functions (#1548) 2023-10-13 21:20:20 +02:00
rdb c00f3b18f5 direct: More reduction of reliance on builtins, mypy fixes 2023-10-11 11:07:56 +02:00
rdb f7718b466b direct: Fix assorted issues when using mypyc 2023-10-10 12:52:26 +02:00
WMOkiishi 32edfa43fd direct: Get direct to pass a mypy check
Closes #1476
2023-08-04 14:31:44 +02:00
WMOkiishi f7f3179a89 Move test code from across `direct` to proper test modules
Closes #1480
2023-08-02 08:37:51 +02:00
rdb 7cd4ca07ed task: Check sys.platform instead of PandaSystem for emscripten tag
This seems to have been standardized in upstream cpython now
2023-02-24 22:35:21 +01:00
rdb 37b5c9ad9e direct: More code style changes 2023-02-22 11:52:19 +01:00
rdb 8b1126ba3e direct: General cleanup of Python code 2023-02-20 20:52:14 +01:00
Timothy Paustian 50de135641
task: Fix re-adding task object removing extraArgs (#1132)
Fixes #1097
2023-02-13 10:58:02 +01:00
WMOkiishi c7c70bc32a
direct: Cut down on usage of `import *` (#1454)
* Remove most `import *`s in `direct`

* Address feedback
2023-02-12 13:16:52 +00:00
rdb 683c54938c task: Don't capture SIGINT on Android
There's no point to doing that, and doing so restricts the ability to run Python in a separate thread
2022-03-09 16:23:37 +01:00
rdb f8df5cac32 Merge branch 'release/1.10.x' 2022-01-02 20:11:41 +01:00
rdb 2aac58b5ab task: Restore previous interrupt handler after `taskMgr.step()`
Related to #1180
2022-01-02 10:39:52 +01:00
rdb eefcae7b05 direct: Add `base.clock`, deprecate `globalClock` 2021-12-25 11:47:42 +01:00
rdb 73a27fa281 task: Get rid of unnecessary __makeTaskList
We can directly convert AsyncTaskCollection objects to a list (though even that is of questionable value since task collections behave list-like enough)
2021-12-12 13:46:26 +01:00
rdb cdf5b16ddd task: Add AsyncFuture::shield() ability, part of #1136
This is modelled after `asyncio.shield()` and can be used to protect an inner future from cancellation when the outer future is cancelled.
2021-04-09 18:28:07 +02:00
rdb 613441060b Merge branch 'release/1.10.x' 2021-01-18 23:47:36 +01:00
rdb d043df7d4e task: Add delay= argument to taskMgr.add()
This has the same effect as doMethodLater, but slightly better describes what it does
2021-01-18 23:37:23 +01:00
rdb be9dde1eee direct: add .pylintrc, perform major code cleanup pass
Closes #989

Co-authored-by: Daniel Stokes <kupomail@gmail.com>
2020-12-31 01:36:23 +01:00
rdb 707ea089cb Merge remote-tracking branch 'origin/release/1.10.x' 2020-09-01 11:09:29 +02:00
rdb dae9e31223 direct: fix various uses of types.MethodType in Python 3 (from #1000) 2020-09-01 10:54:38 +02:00
rdb d799a09002 cleanup: Remove support for EOL versions of Python
Fixes #905
2020-04-26 20:07:56 +02:00
rdb 918d268b80 Merge branch 'release/1.10.x' 2020-02-28 15:57:06 +01:00
Derzsi Dániel eccfce4606 task: Fix memory leak related to Python 3 signal API changes
Python 3's signal.py API does not properly support custom signal handlers. An exception is created every frame because of this, which fills up the memory of the application.

Closes #873
2020-02-28 15:55:28 +01:00
rdb a72be90f17 Merge branch 'release/1.10.x' 2019-10-29 23:13:22 +01:00
rdb f149fb4ab0 direct: big formatting changes for the benefit of API reference
Part of the effort to move the API reference to Sphinx, see panda3d/panda3d-docs#21
2019-10-29 20:43:41 +01:00
rdb ffeb8937bf task: fix unnecessary use of PythonUtil.Queue class
A standard list will do just fine here.
2019-10-29 14:57:20 +01:00
Christopher Snow b06b5791ca Task: Couple two clauses which execute the same logic.
Closes #589
2019-03-29 12:18:37 +01:00
rdb ed5e5386b9 AsyncFuture improvements, incl. support for gathering futures 2017-12-21 14:07:01 +01:00
rdb 2e20a0f16e Implement awaitable thread-safe future for async operations
This introduces AsyncFuture as a new base class of AsyncTask.  It's modelled after asyncio's Future class, except that it is thread-safe and you can use result() to block the current thread waiting for the future to finish (of course this is not necessary for use with coroutines).

AsyncFuture should be used for any operation that finishes in the future, to get the benefit of awaitability within coroutines as well as a standard interface for querying status and results of the operation as well as cancelling it.  As such, it's been implemented in various places, including texture.prepare() and win.trigger_copy().

Note that AsyncFuture is intended to be used *once*; it cannot be used more than once.  As an example of how this works, tex.prepare() will return the same future as long as the prepare isn't complete, but when it is done, subsequent calls to tex.prepare() will return a new future.
2017-12-04 22:25:28 +01:00
rdb 0c0f9adab9 Support coroutines and async/await in the task manager and loader 2017-10-31 18:56:41 +01:00
rdb d576c6b638 Improvements to generated API docs, especially in direct tree.
Also add an entry point for pfreeze.
2017-05-24 13:30:21 +02:00
rdb f1f4951fb5 Merge remote-tracking branch 'origin/release/1.9.x' 2016-10-13 00:25:57 +02:00
rdb f363088cb2 Fix exception when creating intervals before ShowBase is started 2016-09-30 00:21:12 +02:00
Mitchell Stokes 74d588696c Fix Python3 support 2016-05-15 10:27:37 +02:00
David Rose 28cbe13d85 task names can be unicode strings too, better to check against basestring 2016-05-13 18:21:12 -07:00
rdb 23bf9ea5c7 The direct tree is now valid Python 2 *and* 3 2016-03-28 22:33:30 +02:00
rdb 54fa31ba17 StandardError -> Exception, other 2to3 changes, threaded 2to3 2016-03-25 17:13:09 +01:00
rdb 0d03207d1b Dramatically reduce size of frozen/compiled code by pruning/masking unnecessary imports/code 2016-02-12 22:20:27 +01:00
rdb e0e2d6d222 Ignore run() in emscripten 2016-02-11 19:10:59 +01:00
rdb 03c8d4c009 Fix use of many builtins 2016-02-02 13:41:20 +01:00
rdb dafe48a6bc Begin to add snake_case/property interfaces to important direct classes 2015-12-26 17:00:51 +01:00
mfwass f8837999ed Cleanup trailing whitespace 2015-12-13 10:08:41 -05:00
rdb 32367fcbdc Fix various import issues in the direct tree 2015-12-06 22:36:05 +01:00
rdb 0a9f9887f9 Merge branch 'release/1.9.x'
Conflicts:
	direct/src/p3d/Packager.py
	direct/src/p3d/ppackage.py
	makepanda/makepandacore.py
2015-11-21 03:17:33 +01:00
rdb 2d6c2c5c6d Remove dependency on tkpanels and tkwidgets modules when building .p3d package 2015-11-20 17:42:18 +01:00
rdb 31dbcae262 Deprecate many extension methods, make extension methods imported via modules instead of dumped into core.py, move _core.pyd and _direct.pyd back to core.pyd, direct.pyd respectively, move MAIN_DIR set-up code to module init time 2015-11-10 00:44:29 +01:00
rdb db3ab953e4 Remove ppremake, genPyCode, and all hacks created to support them 2015-11-09 19:06:49 +01:00
rdb d9342043b0 Deprecate pandac.PandaModules and genPyCode, move extensions to panda3d/, clean up imports and deprecated behaviour 2015-06-28 13:55:31 +02:00
rdb f87785d2c0 Allow using Panda without 'signal' module in platforms that do not have one (eg. JavaScript) 2015-06-21 17:37:50 +02:00