|
@@ -66,8 +66,6 @@ import os
|
|
|
import sys
|
|
import sys
|
|
|
import glob
|
|
import glob
|
|
|
|
|
|
|
|
-from direct.extensions_native.extension_native_helpers import Dtool_PreloadDLL
|
|
|
|
|
-
|
|
|
|
|
#if $[CTPROJS]
|
|
#if $[CTPROJS]
|
|
|
# This script was generated while the user was using the ctattach
|
|
# This script was generated while the user was using the ctattach
|
|
|
# tools. That had better still be the case.
|
|
# tools. That had better still be the case.
|
|
@@ -160,55 +158,60 @@ for proj in ctprojs.split():
|
|
|
packages.append(projName)
|
|
packages.append(projName)
|
|
|
packages.reverse()
|
|
packages.reverse()
|
|
|
|
|
|
|
|
-for package in packages:
|
|
|
|
|
- packageDir = os.getenv(package)
|
|
|
|
|
- if packageDir:
|
|
|
|
|
- packageDir = deCygwinify(packageDir)
|
|
|
|
|
- etcDir = os.path.join(packageDir, 'etc')
|
|
|
|
|
- try:
|
|
|
|
|
- inFiles = glob.glob(os.path.join(etcDir, 'built', '*.in'))
|
|
|
|
|
- except:
|
|
|
|
|
- inFiles = []
|
|
|
|
|
- if inFiles:
|
|
|
|
|
- DoGenPyCode.etcPath.append(etcDir)
|
|
|
|
|
-
|
|
|
|
|
- if package not in ['WINTOOLS', 'DTOOL', 'DIRECT', 'PANDA']:
|
|
|
|
|
- DoGenPyCode.pythonSourcePath.append(packageDir)
|
|
|
|
|
-
|
|
|
|
|
- libDir = os.path.join(packageDir, 'built', 'lib')
|
|
|
|
|
|
|
+try:
|
|
|
|
|
+ from direct.extensions_native.extension_native_helpers import Dtool_PreloadDLL
|
|
|
|
|
+except ImportError:
|
|
|
|
|
+ print "Unable to import Dtool_PreloadDLL, not trying generic libraries."
|
|
|
|
|
+else:
|
|
|
|
|
+ for package in packages:
|
|
|
|
|
+ packageDir = os.getenv(package)
|
|
|
|
|
+ if packageDir:
|
|
|
|
|
+ packageDir = deCygwinify(packageDir)
|
|
|
|
|
+ etcDir = os.path.join(packageDir, 'etc')
|
|
|
try:
|
|
try:
|
|
|
- files = os.listdir(libDir)
|
|
|
|
|
|
|
+ inFiles = glob.glob(os.path.join(etcDir, 'built', '*.in'))
|
|
|
except:
|
|
except:
|
|
|
- files = []
|
|
|
|
|
- for file in files:
|
|
|
|
|
- if os.path.isfile(os.path.join(libDir, file)):
|
|
|
|
|
- basename, ext = os.path.splitext(file)
|
|
|
|
|
-
|
|
|
|
|
- # Try to import the library. If we can import it,
|
|
|
|
|
- # instrument it.
|
|
|
|
|
- try:
|
|
|
|
|
- Dtool_PreloadDLL(basename)
|
|
|
|
|
- # __import__(basename, globals(), locals())
|
|
|
|
|
- isModule = 1
|
|
|
|
|
- except:
|
|
|
|
|
- isModule = 0
|
|
|
|
|
-
|
|
|
|
|
- #
|
|
|
|
|
- # RHH.... hack OPT2 .. py debug libraries...
|
|
|
|
|
- #
|
|
|
|
|
- if not isModule:
|
|
|
|
|
- # debug py library magin naming in windows..
|
|
|
|
|
- basename = basename.replace('_d','')
|
|
|
|
|
|
|
+ inFiles = []
|
|
|
|
|
+ if inFiles:
|
|
|
|
|
+ DoGenPyCode.etcPath.append(etcDir)
|
|
|
|
|
+
|
|
|
|
|
+ if package not in ['WINTOOLS', 'DTOOL', 'DIRECT', 'PANDA']:
|
|
|
|
|
+ DoGenPyCode.pythonSourcePath.append(packageDir)
|
|
|
|
|
+
|
|
|
|
|
+ libDir = os.path.join(packageDir, 'built', 'lib')
|
|
|
|
|
+ try:
|
|
|
|
|
+ files = os.listdir(libDir)
|
|
|
|
|
+ except:
|
|
|
|
|
+ files = []
|
|
|
|
|
+ for file in files:
|
|
|
|
|
+ if os.path.isfile(os.path.join(libDir, file)):
|
|
|
|
|
+ basename, ext = os.path.splitext(file)
|
|
|
|
|
+
|
|
|
|
|
+ # Try to import the library. If we can import it,
|
|
|
|
|
+ # instrument it.
|
|
|
try:
|
|
try:
|
|
|
Dtool_PreloadDLL(basename)
|
|
Dtool_PreloadDLL(basename)
|
|
|
# __import__(basename, globals(), locals())
|
|
# __import__(basename, globals(), locals())
|
|
|
isModule = 1
|
|
isModule = 1
|
|
|
except:
|
|
except:
|
|
|
- isModule = 0
|
|
|
|
|
-
|
|
|
|
|
- if isModule:
|
|
|
|
|
- if basename not in DoGenPyCode.codeLibs:
|
|
|
|
|
- DoGenPyCode.codeLibs.append(basename)
|
|
|
|
|
|
|
+ isModule = 0
|
|
|
|
|
+
|
|
|
|
|
+ #
|
|
|
|
|
+ # RHH.... hack OPT2 .. py debug libraries...
|
|
|
|
|
+ #
|
|
|
|
|
+ if not isModule:
|
|
|
|
|
+ # debug py library magin naming in windows..
|
|
|
|
|
+ basename = basename.replace('_d','')
|
|
|
|
|
+ try:
|
|
|
|
|
+ Dtool_PreloadDLL(basename)
|
|
|
|
|
+ # __import__(basename, globals(), locals())
|
|
|
|
|
+ isModule = 1
|
|
|
|
|
+ except:
|
|
|
|
|
+ isModule = 0
|
|
|
|
|
+
|
|
|
|
|
+ if isModule:
|
|
|
|
|
+ if basename not in DoGenPyCode.codeLibs:
|
|
|
|
|
+ DoGenPyCode.codeLibs.append(basename)
|
|
|
#endif // CTA_GENERIC_GENPYCODE
|
|
#endif // CTA_GENERIC_GENPYCODE
|
|
|
#endif // CTPROJS
|
|
#endif // CTPROJS
|
|
|
|
|
|