Panda3D
Functions | Variables

Package directscripts.packpanda

Functions

def CompileFiles
def DeleteFiles
def egg2bam
def limitedCopyTree
 Copy the game to a temporary directory, so we can modify it safely.
def ParseFailure
def ParseOptions
def PrintFileStatus
def py2pyc
def ReadFile
 If --bam requested, change default-model-extension .egg to bam.
def WriteFile

Variables

tuple ARCH = ReadFile("packpanda-TMP.txt")
tuple BASENAME = os.path.basename(DIR)
tuple BITMAP = os.path.join(DIR, "installer.bmp")
string CMD = "\""
string COMPRESS = "lzma"
tuple CONF = ReadFile(os.path.join(TMPETC,"Confauto.prc"))
list DIR = OPTIONS["dir"]
tuple EGG2BAM = os.path.join(PANDA,"bin","egg2bam.exe")
 Compile all py files, convert all egg files.
tuple ICON = os.path.join(DIR, "icon.ico")
string INSTALLDIR = 'C:\\'
string INSTALLER_DEB_FILE
 Now make the installer.
string INSTALLER_SPEC_FILE
tuple LICENSE = os.path.join(DIR, "license.txt")
tuple MYDIR = os.path.abspath(os.getcwd())
list NAME = OPTIONS["name"]
tuple NSIS = os.path.abspath(os.path.join(PANDA,"..","thirdparty","win-nsis"))
list OPTIONLIST
tuple OPTIONS = ParseOptions(sys.argv[1:])
tuple OUTFILE = os.path.basename(DIR)
 PANDA = None
 Locate the relevant trees.
string PPICON = "bin\\ppython.exe"
tuple PSOURCE = os.path.abspath(os.path.join(PANDA,".."))
string PYTHONV = "python"
dictionary rmdir = {}
string RUN_SCRIPT
 SMDIRECTORY = NAME
tuple TMPETC = os.path.join(TMPDIR,"etc")
tuple TMPGAME = os.path.join(TMPDIR,"game")
list txt = RUN_SCRIPT[1:]
list VER = OPTIONS["version"]
 Identify the main parts of the game: DIR, NAME, MAIN, ICON, BITMAP, etc.

Function Documentation

def directscripts.packpanda.CompileFiles (   file)
def directscripts.packpanda.DeleteFiles (   file)
def directscripts.packpanda.egg2bam (   file,
  bam 
)
def directscripts.packpanda.limitedCopyTree (   src,
  dst,
  rmdir 
)

Copy the game to a temporary directory, so we can modify it safely.

def directscripts.packpanda.ParseFailure ( )
def directscripts.packpanda.ParseOptions (   args)
def directscripts.packpanda.PrintFileStatus (   label,
  file 
)
def directscripts.packpanda.py2pyc (   file)
def directscripts.packpanda.ReadFile (   wfile)

If --bam requested, change default-model-extension .egg to bam.

def directscripts.packpanda.WriteFile (   wfile,
  data 
)

Variable Documentation

tuple ARCH = ReadFile("packpanda-TMP.txt")
tuple BASENAME = os.path.basename(DIR)
tuple BITMAP = os.path.join(DIR, "installer.bmp")
string CMD = "\""
string COMPRESS = "lzma"
tuple CONF = ReadFile(os.path.join(TMPETC,"Confauto.prc"))
tuple DIR = OPTIONS["dir"]
tuple EGG2BAM = os.path.join(PANDA,"bin","egg2bam.exe")

Compile all py files, convert all egg files.

We do this as a sanity check, even if the user hasn't requested that his files be compiled.

tuple ICON = os.path.join(DIR, "icon.ico")
string INSTALLDIR = 'C:\\'
Initial value:
00001 """
00002 Package: BASENAME
00003 Version: VERSION
00004 Section: games
00005 Priority: optional
00006 Architecture: ARCH
00007 Essential: no
00008 Depends: PYTHONV
00009 Provides: BASENAME
00010 Description: NAME
00011 Maintainer: Unknown
00012 """

Now make the installer.

Yay!

Initial value:
00001 """
00002 Summary: NAME
00003 Name: BASENAME
00004 Version: VERSION
00005 Release: 1
00006 Group: Amusement/Games
00007 License: See license file
00008 BuildRoot: TMPDIR
00009 BuildRequires: PYTHONV
00010 %description
00011 NAME
00012 %files
00013 %defattr(-,root,root)
00014 /usr/bin/BASENAME
00015 /usr/lib/games/BASENAME
00016 /usr/share/games/BASENAME
00017 """
tuple LICENSE = os.path.join(DIR, "license.txt")
tuple MYDIR = os.path.abspath(os.getcwd())
NAME = OPTIONS["name"]
tuple NSIS = os.path.abspath(os.path.join(PANDA,"..","thirdparty","win-nsis"))
list OPTIONLIST
Initial value:
00001 [
00002 ("dir",       1, "Name of directory containing game"),
00003 ("name",      1, "Human-readable name of the game"),
00004 ("version",   1, "Version number to add to game name"),
00005 ("rmdir",     2, "Delete all directories with given name"),
00006 ("rmext",     2, "Delete all files with given extension"),
00007 ("fast",      0, "Use fast compression instead of good compression"),
00008 ("bam",       0, "Generate BAM files, change default-model-extension to BAM"),
00009 ("pyc",       0, "Generate PYC files"),
00010 ]
tuple OPTIONS = ParseOptions(sys.argv[1:])
tuple OUTFILE = os.path.basename(DIR)
tuple PANDA = None

Locate the relevant trees.

string PPICON = "bin\\ppython.exe"
PSOURCE = os.path.abspath(os.path.join(PANDA,".."))
string PYTHONV = "python"
dictionary rmdir = {}
string RUN_SCRIPT
Initial value:
00001 """
00002 #!/bin/sh
00003 cd /usr/share/games/BASENAME/game
00004 PYTHONPATH=/usr/lib/games/BASENAME:/usr/share/games/BASENAME
00005 LD_LIBRARY_PATH=/usr/lib/games/BASENAME
00006 PYTHONV MAIN
00007 """
tuple TMPETC = os.path.join(TMPDIR,"etc")
tuple TMPGAME = os.path.join(TMPDIR,"game")
tuple txt = RUN_SCRIPT[1:]
list VER = OPTIONS["version"]

Identify the main parts of the game: DIR, NAME, MAIN, ICON, BITMAP, etc.

 All Classes Namespaces Functions Variables Properties