本文整理汇总了Python中panda3d.core.PandaSystem.getPackageVersionString方法的典型用法代码示例。如果您正苦于以下问题:Python PandaSystem.getPackageVersionString方法的具体用法?Python PandaSystem.getPackageVersionString怎么用?Python PandaSystem.getPackageVersionString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.PandaSystem
的用法示例。
在下文中一共展示了PandaSystem.getPackageVersionString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dummyAppRunner
# 需要导入模块: from panda3d.core import PandaSystem [as 别名]
# 或者: from panda3d.core.PandaSystem import getPackageVersionString [as 别名]
def dummyAppRunner(tokens = [], argv = None):
""" This function creates a dummy global AppRunner object, which
is useful for testing running in a packaged environment without
actually bothering to package up the application. Call this at
the start of your application to enable it.
It places the current working directory under /mf, as if it were
mounted from a packed multifile. It doesn't convert egg files to
bam files, of course; and there are other minor differences from
running in an actual packaged environment. But it can be a useful
first-look sanity check. """
if AppRunnerGlobal.appRunner:
print("Already have AppRunner, not creating a new one.")
return AppRunnerGlobal.appRunner
appRunner = AppRunner()
appRunner.dummy = True
AppRunnerGlobal.appRunner = appRunner
platform = PandaSystem.getPlatform()
version = PandaSystem.getPackageVersionString()
hostUrl = PandaSystem.getPackageHostUrl()
if platform.startswith('win'):
rootDir = Filename(Filename.getUserAppdataDirectory(), 'Panda3D')
elif platform.startswith('osx'):
rootDir = Filename(Filename.getHomeDirectory(), 'Library/Caches/Panda3D')
else:
rootDir = Filename(Filename.getHomeDirectory(), '.panda3d')
appRunner.rootDir = rootDir
appRunner.logDirectory = Filename(rootDir, 'log')
# Of course we will have the panda3d application loaded.
appRunner.addPackageInfo('panda3d', platform, version, hostUrl)
appRunner.tokens = tokens
appRunner.tokenDict = dict(tokens)
if argv is None:
argv = sys.argv
appRunner.argv = argv
appRunner.altHost = appRunner.tokenDict.get('alt_host', None)
appRunner.p3dInfo = None
appRunner.p3dPackage = None
# Mount the current directory under the multifileRoot, as if it
# were coming from a multifile.
cwd = ExecutionEnvironment.getCwd()
vfs = VirtualFileSystem.getGlobalPtr()
vfs.mount(cwd, appRunner.multifileRoot, vfs.MFReadOnly)
appRunner.initPackedAppEnvironment()
return appRunner