Forráskód Böngészése

fix some alt_host issues

David Rose 16 éve
szülő
commit
573d69caf5
1 módosított fájl, 8 hozzáadás és 5 törlés
  1. 8 5
      direct/src/p3d/AppRunner.py

+ 8 - 5
direct/src/p3d/AppRunner.py

@@ -292,6 +292,9 @@ class AppRunner(DirectObject):
         than the one given, for instance to download a version in
         than the one given, for instance to download a version in
         testing. """
         testing. """
 
 
+        if hostUrl is None:
+            hostUrl = PandaSystem.getPackageHostUrl()
+
         altUrl = self.altHostMap.get(hostUrl, None)
         altUrl = self.altHostMap.get(hostUrl, None)
         if altUrl:
         if altUrl:
             # We got an alternate host.  Use it.
             # We got an alternate host.  Use it.
@@ -617,6 +620,11 @@ class AppRunner(DirectObject):
         if self.p3dPackage:
         if self.p3dPackage:
             self.p3dConfig = self.p3dPackage.FirstChildElement('config')
             self.p3dConfig = self.p3dPackage.FirstChildElement('config')
 
 
+            xhost = self.p3dPackage.FirstChildElement('host')
+            while xhost:
+                self.__readHostXml(xhost)
+                xhost = xhost.NextSiblingElement('host')
+
         if self.p3dConfig:
         if self.p3dConfig:
             allowPythonDev = self.p3dConfig.Attribute('allow_python_dev')
             allowPythonDev = self.p3dConfig.Attribute('allow_python_dev')
             if allowPythonDev:
             if allowPythonDev:
@@ -625,11 +633,6 @@ class AppRunner(DirectObject):
             if guiApp:
             if guiApp:
                 self.guiApp = int(guiApp)
                 self.guiApp = int(guiApp)
 
 
-            xhost = self.p3dConfig.FirstChildElement('host')
-            while xhost:
-                self.__readHostXml(xhost)
-                xhost = xhost.NextSiblingElement('host')
-
         # The interactiveConsole flag can only be set true if the
         # The interactiveConsole flag can only be set true if the
         # application has allow_python_dev set.
         # application has allow_python_dev set.
         if not self.allowPythonDev and interactiveConsole:
         if not self.allowPythonDev and interactiveConsole: