From cba60643f5a9c12a56f60e592769f27ae74de56b Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 28 Feb 2011 15:56:56 +0000 Subject: [PATCH] Minor tweaks --- direct/src/p3d/DeploymentTools.py | 12 +++++++++++- direct/src/p3d/pdeploy.py | 12 +++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/direct/src/p3d/DeploymentTools.py b/direct/src/p3d/DeploymentTools.py index 4df8290ca5..09528ef170 100644 --- a/direct/src/p3d/DeploymentTools.py +++ b/direct/src/p3d/DeploymentTools.py @@ -271,7 +271,9 @@ class Installer: """ This class creates a (graphical) installer from a given .p3d file. """ notify = directNotify.newCategory("Installer") - def __init__(self, shortname, fullname, p3dfile, version, tokens = {}): + def __init__(self, p3dfile, shortname, fullname, version, tokens = {}): + if not shortname: + shortname = p3dfile.getBasenameWoExtension() self.shortname = shortname self.fullname = fullname self.version = str(version) @@ -334,6 +336,14 @@ class Installer: p3dRequires.Attribute('host'))) p3dRequires = p3dRequires.NextSiblingElement('requires') + if not self.fullname: + p3dConfig = p3dPackage.FirstChildElement('config') + if p3dConfig: + self.fullname = p3dConfig.Attribute('display_name') + + if not self.fullname: + self.fullname = self.shortname + def __del__(self): try: appRunner.rmtree(self.tempDir) diff --git a/direct/src/p3d/pdeploy.py b/direct/src/p3d/pdeploy.py index eebefa3ed3..2eb233b36f 100644 --- a/direct/src/p3d/pdeploy.py +++ b/direct/src/p3d/pdeploy.py @@ -42,9 +42,10 @@ Options: If omitted, the basename of the p3d file is used. -N "Your Application" - Full name of the application or game. This is the name that - will be displayed to end-user. - If omitted, the short name is used. + Full name of the application or game. This is the + name that will be displayed to the end-user. + The 'display_name' config is used by default. If it + is missing, the short name is used. -v version_number This should define the version number of your application @@ -208,9 +209,6 @@ if shortname == '': if shortname.lower() != shortname or ' ' in shortname: print '\nProvided short name should be lowercase, and may not contain spaces!\n' -if fullname == '': - fullname = shortname - if version == '' and deploy_mode == 'installer': print '\nA version number is required in "installer" mode.\n' sys.exit(1) @@ -247,7 +245,7 @@ if deploy_mode == 'standalone': elif deploy_mode == 'installer': if includeRequires: tokens["verify_contents"] = "never" - i = Installer(shortname, fullname, appFilename, version, tokens = tokens) + i = Installer(appFilename, shortname, fullname, version, tokens = tokens) i.licensename = licensename i.licensefile = licensefile i.authorid = authorid