Back to index

python3.2  3.2.2
Functions | Variables
build_tkinter Namespace Reference

Functions

def abspath
def have_args
def enter
def main
def nmake
def build

Variables

int TCL_MAJOR = 8
int TCL_MINOR = 5
int TCL_PATCH = 2
int TIX_MAJOR = 8
int TIX_MINOR = 4
int TIX_PATCH = 3
tuple TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH))
tuple TK_DIR = abspath("tk%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH))
tuple TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH))
tuple OUT_DIR = abspath("tcltk")
tuple here = os.path.abspath(os.path.dirname(__file__))
 par = os.path.pardir
string TCL = "tcl8.4.16"
string TK = "tk8.4.16"
string TIX = "tix-8.4.0"
tuple ROOT = os.path.abspath(os.path.join(here, par, par, par))
string NMAKE = "nmake /nologo /f %s COMPILERFLAGS=-DWINVER=0x0500 %s %s"

Detailed Description

Script to compile the dependencies of _tkinter

Copyright (c) 2007 by Christian Heimes <christian@cheimes.de>

Licensed to PSF under a Contributor Agreement.

Function Documentation

def build_tkinter.abspath (   name)

Definition at line 13 of file build_tkinter.py.

00013 
00014 def abspath(name):
00015     par = os.path.pardir
00016     return os.path.abspath(os.path.join(__file__, par, par, par, par, name))

def build_tkinter.build (   platform,
  clean 
)

Definition at line 35 of file build_tkinter.py.

00035 
00036 def build(platform, clean):
00037     if platform == "Win32":
00038         dest = os.path.join(ROOT, "tcltk")
00039         machine = "X86"
00040     elif platform == "x64":
00041         dest = os.path.join(ROOT, "tcltk64")
00042         machine = "X64"
00043     else:
00044         raise ValueError(platform)
00045 
00046     # TCL
00047     tcldir = os.path.join(ROOT, TCL)
00048     if 1:
00049         os.chdir(os.path.join(tcldir, "win"))
00050         if clean:
00051             nmake("makefile.vc", "clean")
00052         nmake("makefile.vc")
00053         nmake("makefile.vc", "install", INSTALLDIR=dest)
00054 
00055     # TK
00056     if 1:
00057         os.chdir(os.path.join(ROOT, TK, "win"))
00058         if clean:
00059             nmake("makefile.vc", "clean", TCLDIR=tcldir)
00060         nmake("makefile.vc", TCLDIR=tcldir)
00061         nmake("makefile.vc", "install", TCLDIR=tcldir, INSTALLDIR=dest)
00062 
00063     # TIX
00064     if 1:
00065         # python9.mak is available at http://svn.python.org
00066         os.chdir(os.path.join(ROOT, TIX, "win"))
00067         if clean:
00068             nmake("python9.mak", "clean")
00069         nmake("python9.mak", MACHINE=machine)
00070         nmake("python9.mak", "install")

Here is the call graph for this function:

def build_tkinter.enter (   dir)

Definition at line 25 of file build_tkinter.py.

00025 
00026 def enter(dir):
00027     os.chdir(os.path.join(dir, "win"))

Here is the caller graph for this function:

Definition at line 22 of file build_tkinter.py.

00022 
00023 def have_args(*a):
00024     return any(s in sys.argv[1:] for s in a)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 28 of file build_tkinter.py.

00028 
00029 def main():
00030     debug = have_args("-d", "--debug")
00031     clean = have_args("clean")
00032     install = have_args("install")
00033     tcl = have_args("tcl")
00034     tk = have_args("tk")
00035     tix = have_args("tix")
00036     if not(tcl) and not(tk) and not(tix):
00037         tcl = tk = tix = True
00038 
00039     def nmake(makefile, *a):
00040         args = ["nmake", "/nologo", "/f", makefile, "DEBUG=%d" % debug]
00041         args.extend(a)
00042         subprocess.check_call(args)
00043 
00044     if tcl:
00045         enter(TCL_DIR)
00046         def nmake_tcl(*a):
00047             nmake("makefile.vc", *a)
00048         if clean:
00049             nmake_tcl("clean")
00050         elif install:
00051             nmake_tcl("install", "INSTALLDIR=" + OUT_DIR)
00052         else:
00053             nmake_tcl()
00054 
00055     if tk:
00056         enter(TK_DIR)
00057         def nmake_tk(*a):
00058             nmake("makefile.vc", "TCLDIR=" + TCL_DIR, *a)
00059         if clean:
00060             nmake_tk("clean")
00061         elif install:
00062             nmake_tk("install", "INSTALLDIR=" + OUT_DIR)
00063         else:
00064             nmake_tk()
00065 
00066     if tix:
00067         enter(TIX_DIR)
00068         def nmake_tix(*a):
00069             nmake("python.mak",
00070                   "TCL_MAJOR=%d" % TCL_MAJOR,
00071                   "TCL_MINOR=%d" % TCL_MINOR,
00072                   "TCL_PATCH=%d" % TCL_PATCH,
00073                   "MACHINE=IX86", *a)
00074         if clean:
00075             nmake_tix("clean")
00076         elif install:
00077             nmake_tix("install", "INSTALL_DIR=" + OUT_DIR)
00078         else:
00079             nmake_tix()

Here is the call graph for this function:

Here is the caller graph for this function:

def build_tkinter.nmake (   makefile,
  command = "",
  kw 
)

Definition at line 28 of file build_tkinter.py.

00028 
00029 def nmake(makefile, command="", **kw):
00030     defines = ' '.join(k+'='+v for k, v in kw.items())
00031     cmd = NMAKE % (makefile, defines, command)
00032     print("\n\n"+cmd+"\n")
00033     if os.system(cmd) != 0:
00034         raise RuntimeError(cmd)

Here is the caller graph for this function:


Variable Documentation

tuple build_tkinter.here = os.path.abspath(os.path.dirname(__file__))

Definition at line 11 of file build_tkinter.py.

string build_tkinter.NMAKE = "nmake /nologo /f %s COMPILERFLAGS=-DWINVER=0x0500 %s %s"

Definition at line 26 of file build_tkinter.py.

tuple build_tkinter.OUT_DIR = abspath("tcltk")

Definition at line 20 of file build_tkinter.py.

build_tkinter.par = os.path.pardir

Definition at line 12 of file build_tkinter.py.

tuple build_tkinter.ROOT = os.path.abspath(os.path.join(here, par, par, par))

Definition at line 23 of file build_tkinter.py.

string build_tkinter.TCL = "tcl8.4.16"

Definition at line 15 of file build_tkinter.py.

tuple build_tkinter.TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH))

Definition at line 17 of file build_tkinter.py.

Definition at line 5 of file build_tkinter.py.

Definition at line 6 of file build_tkinter.py.

Definition at line 7 of file build_tkinter.py.

string build_tkinter.TIX = "tix-8.4.0"

Definition at line 17 of file build_tkinter.py.

tuple build_tkinter.TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH))

Definition at line 19 of file build_tkinter.py.

Definition at line 9 of file build_tkinter.py.

Definition at line 10 of file build_tkinter.py.

Definition at line 11 of file build_tkinter.py.

string build_tkinter.TK = "tk8.4.16"

Definition at line 16 of file build_tkinter.py.

tuple build_tkinter.TK_DIR = abspath("tk%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH))

Definition at line 18 of file build_tkinter.py.