Browse Source

Merge branch 'release/1.10.x'

rdb 6 years ago
parent
commit
d92b440617

+ 5 - 0
direct/src/dist/commands.py

@@ -66,6 +66,8 @@ def _parse_dict(input):
 
 
 
 
 def egg2bam(_build_cmd, srcpath, dstpath):
 def egg2bam(_build_cmd, srcpath, dstpath):
+    if dstpath.endswith('.gz') or dstpath.endswith('.pz'):
+        dstpath = dstpath[:-3]
     dstpath = dstpath + '.bam'
     dstpath = dstpath + '.bam'
     try:
     try:
         subprocess.check_call([
         subprocess.check_call([
@@ -895,6 +897,9 @@ class build_apps(setuptools.Command):
                 os.makedirs(dst_dir)
                 os.makedirs(dst_dir)
 
 
             ext = os.path.splitext(src)[1]
             ext = os.path.splitext(src)[1]
+            # If the file ends with .gz/.pz, we strip this off.
+            if ext in ('.gz', '.pz'):
+                ext = os.path.splitext(src[:-3])[1]
             if not ext:
             if not ext:
                 ext = os.path.basename(src)
                 ext = os.path.basename(src)
 
 

+ 1 - 0
direct/src/stdpy/file.py

@@ -83,6 +83,7 @@ def open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None,
         elif isinstance(file, strType):
         elif isinstance(file, strType):
             filename = core.Filename.fromOsSpecific(file)
             filename = core.Filename.fromOsSpecific(file)
         else:
         else:
+            # It's either a Filename object or an os.PathLike.
             # If a Filename is given, make a writable copy anyway.
             # If a Filename is given, make a writable copy anyway.
             filename = core.Filename(file)
             filename = core.Filename(file)
 
 

+ 5 - 27
dtool/src/interrogate/interrogateBuilder.cxx

@@ -2038,33 +2038,11 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type, CP
     iproperty._length_function = length_function;
     iproperty._length_function = length_function;
   }
   }
 
 
-  if (make_property->_type == CPPMakeProperty::T_normal) {
-    if (getter != nullptr) {
-      iproperty._flags |= InterrogateElement::F_has_getter;
-      iproperty._getter = get_function(getter, "", struct_type,
-                                      struct_type->get_scope(), 0);
-      nassertr(iproperty._getter, 0);
-    }
-  } else {
-    // We could have a mixed sequence/mapping property, so synthesize a
-    // getitem function.  We don't really care what's in here; we just use
-    // this to store the remaps.
-    if (!iproperty.has_getter()) {
-      iproperty._flags |= InterrogateElement::F_has_getter;
-      iproperty._getter = InterrogateDatabase::get_ptr()->get_next_index();
-      InterrogateFunction *ifunction = new InterrogateFunction;
-      ifunction->_instances = new InterrogateFunction::Instances;
-      InterrogateDatabase::get_ptr()->add_function(iproperty._getter, ifunction);
-    }
-
-    // Add our getter to the generated getitem function.
-    string signature = TypeManager::get_function_signature(getter);
-    InterrogateFunction &ifunction =
-      InterrogateDatabase::get_ptr()->update_function(iproperty._getter);
-    if (ifunction._instances == nullptr) {
-      ifunction._instances = new InterrogateFunction::Instances;
-    }
-    ifunction._instances->insert(InterrogateFunction::Instances::value_type(signature, getter));
+  if (getter != nullptr) {
+    iproperty._flags |= InterrogateElement::F_has_getter;
+    iproperty._getter = get_function(getter, "", struct_type,
+                                    struct_type->get_scope(), 0);
+    nassertr(iproperty._getter, 0);
   }
   }
 
 
   if (hasser != nullptr) {
   if (hasser != nullptr) {

+ 5 - 3
panda/src/event/eventQueue.cxx

@@ -46,11 +46,13 @@ queue_event(CPT_Event event) {
   LightMutexHolder holder(_lock);
   LightMutexHolder holder(_lock);
 
 
   _queue.push_back(event);
   _queue.push_back(event);
-  if (event_cat.is_spam() || event_cat.is_debug()) {
+  if (event_cat.is_debug()) {
     if (event->get_name() == "NewFrame") {
     if (event->get_name() == "NewFrame") {
       // Don't bother us with this particularly spammy event.
       // Don't bother us with this particularly spammy event.
-      event_cat.spam()
-        << "Throwing event " << *event << "\n";
+      if (event_cat.is_spam()) {
+        event_cat.spam()
+          << "Throwing event " << *event << "\n";
+      }
     } else {
     } else {
       event_cat.debug()
       event_cat.debug()
         << "Throwing event " << *event << "\n";
         << "Throwing event " << *event << "\n";

+ 4 - 4
panda/src/pgraph/nodePath.h

@@ -41,6 +41,8 @@
 #include "pta_LVecBase2.h"
 #include "pta_LVecBase2.h"
 #include "stl_compares.h"
 #include "stl_compares.h"
 #include "shaderInput.h"
 #include "shaderInput.h"
+#include "internalNameCollection.h"
+#include "materialCollection.h"
 #include "textureCollection.h"
 #include "textureCollection.h"
 #include "textureStageCollection.h"
 #include "textureStageCollection.h"
 
 
@@ -49,13 +51,9 @@ class FindApproxPath;
 class FindApproxLevelEntry;
 class FindApproxLevelEntry;
 class Light;
 class Light;
 class PolylightNode;
 class PolylightNode;
-class InternalNameCollection;
 class Texture;
 class Texture;
 class TextureStage;
 class TextureStage;
-class TextureCollection;
-class TextureStageCollection;
 class Material;
 class Material;
-class MaterialCollection;
 class Fog;
 class Fog;
 class GlobPattern;
 class GlobPattern;
 class PreparedGraphicsObjects;
 class PreparedGraphicsObjects;
@@ -1054,6 +1052,8 @@ private:
 
 
 INLINE std::ostream &operator << (std::ostream &out, const NodePath &node_path);
 INLINE std::ostream &operator << (std::ostream &out, const NodePath &node_path);
 
 
+#include "nodePathCollection.h"
+
 #include "nodePath.I"
 #include "nodePath.I"
 
 
 #endif
 #endif

+ 24 - 0
tests/dtoolutil/test_filename.py

@@ -0,0 +1,24 @@
+from panda3d.core import Filename
+import sys, os
+import pytest
+
+
[email protected](sys.version_info < (3, 6), reason="Requires Python 3.6")
+def test_filename_fspath():
+    fn = Filename.from_os_specific(__file__)
+    assert os.fspath(fn) == fn.to_os_specific_w()
+
+
[email protected](sys.version_info < (3, 6), reason="Requires Python 3.6")
+def test_filename_open():
+    fn = Filename.from_os_specific(__file__)
+    open(fn, 'rb')
+
+
[email protected](sys.version_info < (3, 4), reason="Requires Python 3.4")
+def test_filename_ctor_pathlib():
+    pathlib = pytest.importorskip('pathlib')
+
+    path = pathlib.Path(__file__)
+    fn = Filename(path)
+    assert fn.to_os_specific_w() == str(path)