Merge branch 'release/1.10.x' into incoming

This commit is contained in:
rdb
2019-08-20 01:26:32 +02:00
9 changed files with 49 additions and 7 deletions

View File

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

View File

@@ -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 -----------------------
This release fixes a regression with DirectScrolledList in 1.10.3,

View File

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

View File

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

View File

@@ -222,7 +222,7 @@ def parseopts(args):
elif (option=="--arch"): target_arch = value.strip()
elif (option=="--nocolor"): DisableColors()
elif (option=="--version"):
match = re.match(r'^\d+\.\d+\.\d+', value)
match = re.match(r'^\d+\.\d+(\.\d+)+', value)
if not match:
usage("version requires three digits")
WHLVERSION = value
@@ -2684,7 +2684,7 @@ PANDAVERSION_H="""
#define PANDA_SEQUENCE_VERSION $VERSION3
#define PANDA_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_DISTRIBUTOR "$DISTRIBUTOR"
#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("$VERSION2",str(version2))
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("$DISTRIBUTOR",DISTRIBUTOR)
pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)

View File

@@ -132,8 +132,10 @@ FfmpegAudioCursor(FfmpegAudio *src) :
// Set up the resample context if necessary.
if (_audio_ctx->sample_fmt != AV_SAMPLE_FMT_S16) {
#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();
av_opt_set_int(_resample_ctx, "in_channel_count", _audio_channels, 0);

View File

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

View File

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

View File

@@ -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
@pytest.mark.skipif(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)