From 26ce3eab297e018516361647f269af14936c3079 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 23 Jan 2024 14:24:23 +0100 Subject: [PATCH 1/3] Update version number to 1.10.15 --- dtool/PandaVersion.pp | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/PandaVersion.pp b/dtool/PandaVersion.pp index 9b8f30b25d..c3914608fd 100644 --- a/dtool/PandaVersion.pp +++ b/dtool/PandaVersion.pp @@ -7,7 +7,7 @@ // place to put this. // Use spaces to separate the major, minor, and sequence numbers here. -#define PANDA_VERSION 1 10 14 +#define PANDA_VERSION 1 10 15 // This variable will be defined to false in the CVS repository, but // scripts that generate source tarballs and/or binary releases for diff --git a/setup.cfg b/setup.cfg index 6d0eb80e5a..3bce54d05a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = Panda3D -version = 1.10.14 +version = 1.10.15 url = https://www.panda3d.org/ description = Panda3D is a framework for 3D rendering and game development for Python and C++ programs. license = Modified BSD License From 16afdd2bf9d38035391960d3d29e249253a8a891 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 23 Jan 2024 14:24:37 +0100 Subject: [PATCH 2/3] Prepare installer.nsi for Python 3.13 --- makepanda/installer.nsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/makepanda/installer.nsi b/makepanda/installer.nsi index fc0054b25a..cf6f7746be 100644 --- a/makepanda/installer.nsi +++ b/makepanda/installer.nsi @@ -426,6 +426,7 @@ SectionGroup "Python modules" SecGroupPython !insertmacro PyBindingSection 3.10-32 .cp310-win32.pyd !insertmacro PyBindingSection 3.11-32 .cp311-win32.pyd !insertmacro PyBindingSection 3.12-32 .cp312-win32.pyd + !insertmacro PyBindingSection 3.13-32 .cp313-win32.pyd !else !insertmacro PyBindingSection 3.5 .cp35-win_amd64.pyd !insertmacro PyBindingSection 3.6 .cp36-win_amd64.pyd @@ -435,6 +436,7 @@ SectionGroup "Python modules" SecGroupPython !insertmacro PyBindingSection 3.10 .cp310-win_amd64.pyd !insertmacro PyBindingSection 3.11 .cp311-win_amd64.pyd !insertmacro PyBindingSection 3.12 .cp312-win_amd64.pyd + !insertmacro PyBindingSection 3.13 .cp313-win_amd64.pyd !endif SectionGroupEnd @@ -546,6 +548,7 @@ Function .onInit !insertmacro MaybeEnablePyBindingSection 3.10-32 !insertmacro MaybeEnablePyBindingSection 3.11-32 !insertmacro MaybeEnablePyBindingSection 3.12-32 + !insertmacro MaybeEnablePyBindingSection 3.13-32 ${EndIf} !else !insertmacro MaybeEnablePyBindingSection 3.5 @@ -557,6 +560,7 @@ Function .onInit !insertmacro MaybeEnablePyBindingSection 3.10 !insertmacro MaybeEnablePyBindingSection 3.11 !insertmacro MaybeEnablePyBindingSection 3.12 + !insertmacro MaybeEnablePyBindingSection 3.13 ${EndIf} !endif @@ -578,6 +582,10 @@ Function .onInit SectionSetFlags ${SecPyBindings3.12} ${SF_RO} SectionSetInstTypes ${SecPyBindings3.12} 0 !endif + !ifdef SecPyBindings3.13 + SectionSetFlags ${SecPyBindings3.13} ${SF_RO} + SectionSetInstTypes ${SecPyBindings3.13} 0 + !endif ${EndUnless} FunctionEnd @@ -891,6 +899,7 @@ Section Uninstall !insertmacro RemovePythonPath 3.10-32 !insertmacro RemovePythonPath 3.11-32 !insertmacro RemovePythonPath 3.12-32 + !insertmacro RemovePythonPath 3.13-32 !else !insertmacro RemovePythonPath 3.5 !insertmacro RemovePythonPath 3.6 @@ -900,6 +909,7 @@ Section Uninstall !insertmacro RemovePythonPath 3.10 !insertmacro RemovePythonPath 3.11 !insertmacro RemovePythonPath 3.12 + !insertmacro RemovePythonPath 3.13 !endif SetDetailsPrint both @@ -977,6 +987,7 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.10-32} $(DESC_SecPyBindings3.10-32) !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.11-32} $(DESC_SecPyBindings3.11-32) !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.12-32} $(DESC_SecPyBindings3.12-32) + !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.13-32} $(DESC_SecPyBindings3.13-32) !else !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.5} $(DESC_SecPyBindings3.5) !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.6} $(DESC_SecPyBindings3.6) @@ -986,6 +997,7 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.10} $(DESC_SecPyBindings3.10) !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.11} $(DESC_SecPyBindings3.11) !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.12} $(DESC_SecPyBindings3.12) + !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.13} $(DESC_SecPyBindings3.13) !endif !ifdef INCLUDE_PYVER !insertmacro MUI_DESCRIPTION_TEXT ${SecPython} $(DESC_SecPython) From 8c74919a8b482eddba8d18cf8adcc43529a11d78 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 23 Jan 2024 14:51:44 +0100 Subject: [PATCH 3/3] dgui: Make copy of mutable default value Fixes #1587 --- direct/src/gui/DirectGuiBase.py | 7 ++++++- tests/gui/test_DirectButton.py | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/direct/src/gui/DirectGuiBase.py b/direct/src/gui/DirectGuiBase.py index fecfea608a..b7f35ac3af 100644 --- a/direct/src/gui/DirectGuiBase.py +++ b/direct/src/gui/DirectGuiBase.py @@ -224,7 +224,12 @@ class DirectGuiBase(DirectObject.DirectObject): del keywords[name] else: # Use optionDefs value - optionInfo[name] = [default, default, function] + value = default + if isinstance(value, list): + value = list(value) + elif isinstance(value, dict): + value = dict(value) + optionInfo[name] = [default, value, function] elif optionInfo[name][FUNCTION] is None: # Only override function if not defined by derived class optionInfo[name][FUNCTION] = function diff --git a/tests/gui/test_DirectButton.py b/tests/gui/test_DirectButton.py index 6f85e72f59..d01455bae1 100644 --- a/tests/gui/test_DirectButton.py +++ b/tests/gui/test_DirectButton.py @@ -1,6 +1,21 @@ from direct.gui.DirectButton import DirectButton +def test_button_default_extraArgs(): + btn = DirectButton() + + assert btn.configure('extraArgs') == ('extraArgs', [], []) + assert btn._optionInfo['extraArgs'] == [[], [], None] + + # Changing will not affect default value + btn['extraArgs'].append(1) + assert btn.configure('extraArgs') == ('extraArgs', [], [1]) + + # Changing this does + btn.configure('extraArgs')[1].append(2) + assert btn.configure('extraArgs') == ('extraArgs', [2], [1]) + + def test_button_destroy(): btn = DirectButton(text="Test") btn.destroy()