Create grammar pickle files on installation; remove them on uninstallation.

This commit is contained in:
Martin v. Löwis 2008-05-25 16:37:34 +00:00
parent f2e23d039c
commit 367c79a4ad
2 changed files with 11 additions and 0 deletions

View File

@ -382,6 +382,7 @@ def add_ui(db):
])
compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x bad_coding|badsyntax|site-packages|py3_ "[TARGETDIR]Lib"'
lib2to3args = r'-c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"'
# See "CustomAction Table"
add_data(db, "CustomAction", [
# msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty
@ -395,6 +396,7 @@ def add_ui(db):
# See "Custom Action Type 18"
("CompilePyc", 18, "python.exe", compileargs),
("CompilePyo", 18, "python.exe", "-O "+compileargs),
("CompileGrammar", 18, "python.exe", lib2to3args),
])
# UI Sequences, see "InstallUISequence Table", "Using a Sequence Table"
@ -424,12 +426,14 @@ def add_ui(db):
("UpdateEditIDLE", None, 1050),
("CompilePyc", "COMPILEALL", 6800),
("CompilePyo", "COMPILEALL", 6801),
("CompileGrammar", "COMPILEALL", 6802),
])
add_data(db, "AdminExecuteSequence",
[("InitialTargetDir", 'TARGETDIR=""', 750),
("SetDLLDirToTarget", 'DLLDIR=""', 751),
("CompilePyc", "COMPILEALL", 6800),
("CompilePyo", "COMPILEALL", 6801),
("CompileGrammar", "COMPILEALL", 6802),
])
#####################################################################
@ -999,6 +1003,8 @@ def add_files(db):
if dir=="setuptools":
lib.add_file("cli.exe")
lib.add_file("gui.exe")
if dir=="lib2to3":
lib.removefile("pickle", "*.pickle")
if dir=="data" and parent.physical=="test" and parent.basedir.physical=="email":
# This should contain all non-.svn files listed in subversion
for f in os.listdir(lib.absolute):

View File

@ -571,6 +571,11 @@ class Directory:
[(self.component+"c", self.component, "*.pyc", self.logical, 2),
(self.component+"o", self.component, "*.pyo", self.logical, 2)])
def removefile(self, key, pattern):
"Add a RemoveFile entry"
add_data(self.db, "RemoveFile", [(self.component+key, self.component, pattern, self.logical, 2)])
class Feature:
def __init__(self, db, id, title, desc, display, level = 1,
parent=None, directory = None, attributes=0):