From 01ae235bfb4cf1bca092a668e05cd9bfb3fae6b2 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Fri, 30 Mar 2018 13:42:35 -0700 Subject: [PATCH] deploy-ng: Change default model-cache-dir on deployed applications We replace panda3d in the model-cache-dir ConfigVariable with the name from setup.py. --- direct/src/showutil/dist.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/direct/src/showutil/dist.py b/direct/src/showutil/dist.py index 345f4edeb8..e179b422f4 100644 --- a/direct/src/showutil/dist.py +++ b/direct/src/showutil/dist.py @@ -315,16 +315,17 @@ class build_apps(distutils.core.Command): ln = ln.strip() useline = True if ln.startswith('#') or not ln: - useline = False - else: - for plugin in check_plugins: - if plugin in ln and plugin not in self.plugins: - useline = False - if warn_on_missing_plugin: - self.warn( - "Missing plugin ({0}) referenced in user PRC data".format(plugin) - ) - break + continue + if 'model-cache-dir' in ln: + ln = ln.replace('/panda3d', '/{}'.format(self.distribution.get_name())) + for plugin in check_plugins: + if plugin in ln and plugin not in self.plugins: + useline = False + if warn_on_missing_plugin: + self.warn( + "Missing plugin ({0}) referenced in user PRC data".format(plugin) + ) + break if useline: out.append(ln) return out