Browse Source

Merge branch 'release/1.10.x' into incoming

rdb 6 years ago
parent
commit
1e6be1b2ee

+ 1 - 0
direct/src/gui/DirectGuiBase.py

@@ -81,6 +81,7 @@ __all__ = ['DirectGuiBase', 'DirectGuiWidget']
 
 
 from panda3d.core import *
 from panda3d.core import *
 from direct.showbase import ShowBaseGlobal
 from direct.showbase import ShowBaseGlobal
+from direct.showbase.ShowBase import ShowBase
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
 from .OnscreenText import *
 from .OnscreenText import *
 from .OnscreenGeom import *
 from .OnscreenGeom import *

+ 5 - 0
doc/ReleaseNotes

@@ -1,3 +1,8 @@
+------------------------  RELEASE 1.10.4.1  ---------------------
+
+This release fixes only one critical regression: calling destroy()
+on a DirectGUI item would cause an exception.
+
 ------------------------  RELEASE 1.10.4  -----------------------
 ------------------------  RELEASE 1.10.4  -----------------------
 
 
 This release fixes a regression with DirectScrolledList in 1.10.3,
 This release fixes a regression with DirectScrolledList in 1.10.3,

+ 2 - 2
makepanda/getversion.py

@@ -4,13 +4,13 @@
 # and returns it on the command-line.  This is useful for the
 # and returns it on the command-line.  This is useful for the
 # automated scripts that build the Panda3D releases.
 # automated scripts that build the Panda3D releases.
 
 
-from makepandacore import ParsePandaVersion, ParsePluginVersion
+from makepandacore import ParsePandaVersion, ParsePluginVersion, GetMetadataValue
 import sys
 import sys
 
 
 if '--runtime' in sys.argv:
 if '--runtime' in sys.argv:
     version = ParsePluginVersion("dtool/PandaVersion.pp")
     version = ParsePluginVersion("dtool/PandaVersion.pp")
 else:
 else:
-    version = ParsePandaVersion("dtool/PandaVersion.pp")
+    version = GetMetadataValue('version')
 
 
 version = version.strip()
 version = version.strip()
 sys.stdout.write(version)
 sys.stdout.write(version)

+ 1 - 1
makepanda/makepackage.py

@@ -1071,7 +1071,7 @@ if __name__ == "__main__":
             PkgDisable(pkg)
             PkgDisable(pkg)
 
 
     # Parse the version.
     # Parse the version.
-    match = re.match(r'^\d+\.\d+\.\d+', options.version)
+    match = re.match(r'^\d+\.\d+(\.\d+)+', options.version)
     if not match:
     if not match:
         exit("version requires three digits")
         exit("version requires three digits")
 
 

+ 3 - 2
makepanda/makepanda.py

@@ -222,7 +222,7 @@ def parseopts(args):
             elif (option=="--arch"): target_arch = value.strip()
             elif (option=="--arch"): target_arch = value.strip()
             elif (option=="--nocolor"): DisableColors()
             elif (option=="--nocolor"): DisableColors()
             elif (option=="--version"):
             elif (option=="--version"):
-                match = re.match(r'^\d+\.\d+\.\d+', value)
+                match = re.match(r'^\d+\.\d+(\.\d+)+', value)
                 if not match:
                 if not match:
                     usage("version requires three digits")
                     usage("version requires three digits")
                 WHLVERSION = value
                 WHLVERSION = value
@@ -2684,7 +2684,7 @@ PANDAVERSION_H="""
 #define PANDA_SEQUENCE_VERSION $VERSION3
 #define PANDA_SEQUENCE_VERSION $VERSION3
 #define PANDA_VERSION $NVERSION
 #define PANDA_VERSION $NVERSION
 #define PANDA_NUMERIC_VERSION $NVERSION
 #define PANDA_NUMERIC_VERSION $NVERSION
-#define PANDA_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
+#define PANDA_VERSION_STR "$VERSION"
 #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
 #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
 #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
 #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
 #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
 #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
@@ -2803,6 +2803,7 @@ def CreatePandaVersionFiles():
     pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
     pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
     pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
     pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
     pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
     pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
+    pandaversion_h = pandaversion_h.replace("$VERSION",VERSION)
     pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
     pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
     pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
     pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
     pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
     pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)

+ 4 - 2
panda/src/ffmpeg/ffmpegAudioCursor.cxx

@@ -132,8 +132,10 @@ FfmpegAudioCursor(FfmpegAudio *src) :
   // Set up the resample context if necessary.
   // Set up the resample context if necessary.
   if (_audio_ctx->sample_fmt != AV_SAMPLE_FMT_S16) {
   if (_audio_ctx->sample_fmt != AV_SAMPLE_FMT_S16) {
 #ifdef HAVE_SWRESAMPLE
 #ifdef HAVE_SWRESAMPLE
-    ffmpeg_cat.debug()
-      << "Codec does not use signed 16-bit sample format.  Setting up swresample context.\n";
+    if (ffmpeg_cat.is_debug()) {
+      ffmpeg_cat.debug()
+        << "Codec does not use signed 16-bit sample format.  Setting up swresample context.\n";
+    }
 
 
     _resample_ctx = swr_alloc();
     _resample_ctx = swr_alloc();
     av_opt_set_int(_resample_ctx, "in_channel_count", _audio_channels, 0);
     av_opt_set_int(_resample_ctx, "in_channel_count", _audio_channels, 0);

+ 6 - 0
tests/gui/test_DirectButton.py

@@ -0,0 +1,6 @@
+from direct.gui.DirectButton import DirectButton
+
+
+def test_button_destroy():
+    btn = DirectButton(text="Test")
+    btn.destroy()

+ 5 - 0
tests/gui/test_DirectEntry.py

@@ -3,6 +3,11 @@ from direct.gui.DirectEntry import DirectEntry
 import sys
 import sys
 
 
 
 
+def test_entry_destroy():
+    entry = DirectEntry()
+    entry.destroy()
+
+
 def test_entry_get():
 def test_entry_get():
     entry = DirectEntry()
     entry = DirectEntry()
     assert isinstance(entry.get(), str)
     assert isinstance(entry.get(), str)

+ 22 - 0
tests/gui/test_DirectGuiBase.py

@@ -0,0 +1,22 @@
+from direct.gui.DirectGuiBase import DirectGuiWidget
+from direct.showbase.ShowBase import ShowBase
+from direct.showbase import ShowBaseGlobal
+from panda3d import core
+import pytest
+
+
[email protected](not ShowBaseGlobal.__dev__, reason="requires want-dev")
+def test_track_gui_items():
+    page = core.load_prc_file_data("", "track-gui-items true")
+    try:
+        item = DirectGuiWidget()
+        id = item.guiId
+
+        assert id in ShowBase.guiItems
+        assert ShowBase.guiItems[id] == item
+
+        item.destroy()
+
+        assert id not in ShowBase.guiItems
+    finally:
+        core.unload_prc_file(page)