Bladeren bron

dist: Fix ability to deploy app without requiring OpenSSL enabled

Fixes #1073
rdb 5 jaren geleden
bovenliggende
commit
66c41d6c31
2 gewijzigde bestanden met toevoegingen van 7 en 6 verwijderingen
  1. 4 3
      direct/src/p3d/DeploymentTools.py
  2. 3 3
      direct/src/p3d/HostInfo.py

+ 4 - 3
direct/src/p3d/DeploymentTools.py

@@ -13,9 +13,10 @@ import os, sys, subprocess, tarfile, shutil, time, zipfile, socket, getpass, str
 import gzip, plistlib
 import gzip, plistlib
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.showbase.AppRunnerGlobal import appRunner
 from direct.showbase.AppRunnerGlobal import appRunner
-from panda3d.core import PandaSystem, HTTPClient, Filename, VirtualFileSystem, Multifile
+from panda3d.core import PandaSystem, Filename, VirtualFileSystem, Multifile
 from panda3d.core import TiXmlDocument, TiXmlDeclaration, TiXmlElement, readXmlStream
 from panda3d.core import TiXmlDocument, TiXmlDeclaration, TiXmlElement, readXmlStream
 from panda3d.core import PNMImage, PNMFileTypeRegistry, StringStream
 from panda3d.core import PNMImage, PNMFileTypeRegistry, StringStream
+from panda3d import core
 from direct.stdpy.file import *
 from direct.stdpy.file import *
 from direct.p3d.HostInfo import HostInfo
 from direct.p3d.HostInfo import HostInfo
 # This is important for some reason
 # This is important for some reason
@@ -87,7 +88,7 @@ class Standalone:
         self.tempDir.makeDir()
         self.tempDir.makeDir()
         self.host = HostInfo(PandaSystem.getPackageHostUrl(), appRunner = appRunner, hostDir = self.tempDir, asMirror = False, perPlatform = True)
         self.host = HostInfo(PandaSystem.getPackageHostUrl(), appRunner = appRunner, hostDir = self.tempDir, asMirror = False, perPlatform = True)
 
 
-        self.http = HTTPClient.getGlobalPtr()
+        self.http = core.HTTPClient.getGlobalPtr()
         if not self.host.hasContentsFile:
         if not self.host.hasContentsFile:
             if not self.host.readContentsFile():
             if not self.host.readContentsFile():
                 if not self.host.downloadContentsFile(self.http):
                 if not self.host.downloadContentsFile(self.http):
@@ -245,7 +246,7 @@ class PackageTree:
         self.hostUrl = hostUrl
         self.hostUrl = hostUrl
         self.hostDir = Filename(hostDir)
         self.hostDir = Filename(hostDir)
         self.hostDir.makeDir()
         self.hostDir.makeDir()
-        self.http = HTTPClient.getGlobalPtr()
+        self.http = core.HTTPClient.getGlobalPtr()
 
 
     def getHost(self, hostUrl):
     def getHost(self, hostUrl):
         if hostUrl in self.hosts:
         if hostUrl in self.hosts:

+ 3 - 3
direct/src/p3d/HostInfo.py

@@ -6,7 +6,7 @@
 __all__ = ["HostInfo"]
 __all__ = ["HostInfo"]
 
 
 from panda3d.core import HashVal, Filename, PandaSystem, DocumentSpec, Ramfile
 from panda3d.core import HashVal, Filename, PandaSystem, DocumentSpec, Ramfile
-from panda3d.core import HTTPChannel, ConfigVariableInt
+from panda3d.core import ConfigVariableInt
 from panda3d import core
 from panda3d import core
 from direct.p3d.PackageInfo import PackageInfo
 from direct.p3d.PackageInfo import PackageInfo
 from direct.p3d.FileSpec import FileSpec
 from direct.p3d.FileSpec import FileSpec
@@ -230,8 +230,8 @@ class HostInfo:
                     self.notify.warning("Unable to download %s" % (url,))
                     self.notify.warning("Unable to download %s" % (url,))
                     try:
                     try:
                         # Something screwed up.
                         # Something screwed up.
-                        if statusCode == HTTPChannel.SCDownloadOpenError or \
-                           statusCode == HTTPChannel.SCDownloadWriteError:
+                        if statusCode == core.HTTPChannel.SCDownloadOpenError or \
+                           statusCode == core.HTTPChannel.SCDownloadWriteError:
                             launcher.setPandaErrorCode(2)
                             launcher.setPandaErrorCode(2)
                         elif statusCode == 404:
                         elif statusCode == 404:
                             # 404 not found
                             # 404 not found