From 0f1a3e13d72f0b6dddfb7929d8262db1718123bc Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 25 Dec 2009 20:35:43 +0000 Subject: [PATCH] pdeploy is now fully working for all platforms, I think. --- direct/src/p3d/DeploymentTools.py | 16 ++++++++++++++-- direct/src/p3d/pdeploy.py | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/direct/src/p3d/DeploymentTools.py b/direct/src/p3d/DeploymentTools.py index 4b3ca9208e..f175231095 100644 --- a/direct/src/p3d/DeploymentTools.py +++ b/direct/src/p3d/DeploymentTools.py @@ -4,12 +4,11 @@ to build for as many platforms as possible. """ __all__ = ["Standalone", "Installer"] -import os, sys, subprocess, tarfile, shutil, time +import os, sys, subprocess, tarfile, shutil, time, zipfile from direct.directnotify.DirectNotifyGlobal import * from pandac.PandaModules import PandaSystem, HTTPClient, Filename, VirtualFileSystem from direct.p3d.HostInfo import HostInfo from direct.showbase.AppRunnerGlobal import appRunner -import glob class CachedFile: def __init__(self): self.str = "" @@ -415,6 +414,19 @@ class Installer: archive.add(appfn.toOsSpecific(), appname) archive.close() + # Put the .pkg into a zipfile + archive = Filename(output.getDirname(), "%s %s.zip" % (self.fullname, self.version)) + dir = Filename(output.getDirname()) + dir.makeAbsolute() + zip = zipfile.ZipFile(archive.toOsSpecific(), 'w') + for root, dirs, files in os.walk(output.toOsSpecific()): + for name in files: + file = Filename.fromOsSpecific(os.path.join(root, name)) + file.makeAbsolute() + file.makeRelativeTo(dir) + zip.write(os.path.join(root, name), str(file)) + zip.close() + return output def buildNSIS(self, output, platform): diff --git a/direct/src/p3d/pdeploy.py b/direct/src/p3d/pdeploy.py index 1a5d09f678..3bb4b9e7f5 100644 --- a/direct/src/p3d/pdeploy.py +++ b/direct/src/p3d/pdeploy.py @@ -84,6 +84,14 @@ Options: is licensed under. Only relevant when generating a graphical installer. + -a com.your_company + Short identifier of the author of the application. The default + is "org.panda3d", but you will most likely want to change + it to your own name or that of your organization or company. + + -A "Your Company" + Full name of the author of the application. + -h Display this help @@ -111,6 +119,8 @@ platforms = [] currentPlatform = False licensename = "" licensefile = Filename() +authorid = "" +authorname = "" try: opts, args = getopt.getopt(sys.argv[1:], 'n:N:v:o:t:P:cl:L:h') @@ -137,6 +147,10 @@ for opt, arg in opts: licensename = arg.strip() elif opt == '-L': licensefile = Filename.fromOsSpecific(arg) + elif opt == '-a': + authorid = arg.strip() + elif opt == '-A': + authorname = arg.strip() elif opt == '-h': usage(0) @@ -197,6 +211,8 @@ elif deploy_mode == 'installer': i = Installer(shortname, fullname, appFilename, version, tokens = tokens) i.licensename = licensename i.licensefile = licensefile + i.authorid = authorid + i.authorname = authorname if currentPlatform: platform = PandaSystem.getPlatform()