From 367c79a4adb7bf5dec9cd501a0d772b6d95591ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sun, 25 May 2008 16:37:34 +0000 Subject: Create grammar pickle files on installation; remove them on uninstallation. --- Tools/msi/msi.py | 6 ++++++ Tools/msi/msilib.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/Tools/msi/msi.py b/Tools/msi/msi.py index 032d662..d152f75 100644 --- a/Tools/msi/msi.py +++ b/Tools/msi/msi.py @@ -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): diff --git a/Tools/msi/msilib.py b/Tools/msi/msilib.py index d65c997..98571ac 100644 --- a/Tools/msi/msilib.py +++ b/Tools/msi/msilib.py @@ -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): -- cgit v0.12