Skip to content

Commit 26b8583

Browse files
author
martin.v.loewis
committed
Create grammar pickle files on installation; remove them on uninstallation.
git-svn-id: http://svn.python.org/projects/python/trunk@63638 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 2139e6f commit 26b8583

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

Tools/msi/msi.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ def add_ui(db):
382382
])
383383

384384
compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x bad_coding|badsyntax|site-packages|py3_ "[TARGETDIR]Lib"'
385+
lib2to3args = r'-c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"'
385386
# See "CustomAction Table"
386387
add_data(db, "CustomAction", [
387388
# msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty
@@ -395,6 +396,7 @@ def add_ui(db):
395396
# See "Custom Action Type 18"
396397
("CompilePyc", 18, "python.exe", compileargs),
397398
("CompilePyo", 18, "python.exe", "-O "+compileargs),
399+
("CompileGrammar", 18, "python.exe", lib2to3args),
398400
])
399401

400402
# UI Sequences, see "InstallUISequence Table", "Using a Sequence Table"
@@ -424,12 +426,14 @@ def add_ui(db):
424426
("UpdateEditIDLE", None, 1050),
425427
("CompilePyc", "COMPILEALL", 6800),
426428
("CompilePyo", "COMPILEALL", 6801),
429+
("CompileGrammar", "COMPILEALL", 6802),
427430
])
428431
add_data(db, "AdminExecuteSequence",
429432
[("InitialTargetDir", 'TARGETDIR=""', 750),
430433
("SetDLLDirToTarget", 'DLLDIR=""', 751),
431434
("CompilePyc", "COMPILEALL", 6800),
432435
("CompilePyo", "COMPILEALL", 6801),
436+
("CompileGrammar", "COMPILEALL", 6802),
433437
])
434438

435439
#####################################################################
@@ -999,6 +1003,8 @@ def add_files(db):
9991003
if dir=="setuptools":
10001004
lib.add_file("cli.exe")
10011005
lib.add_file("gui.exe")
1006+
if dir=="lib2to3":
1007+
lib.removefile("pickle", "*.pickle")
10021008
if dir=="data" and parent.physical=="test" and parent.basedir.physical=="email":
10031009
# This should contain all non-.svn files listed in subversion
10041010
for f in os.listdir(lib.absolute):

Tools/msi/msilib.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,11 @@ def remove_pyc(self):
571571
[(self.component+"c", self.component, "*.pyc", self.logical, 2),
572572
(self.component+"o", self.component, "*.pyo", self.logical, 2)])
573573

574+
def removefile(self, key, pattern):
575+
"Add a RemoveFile entry"
576+
add_data(self.db, "RemoveFile", [(self.component+key, self.component, pattern, self.logical, 2)])
577+
578+
574579
class Feature:
575580
def __init__(self, db, id, title, desc, display, level = 1,
576581
parent=None, directory = None, attributes=0):

0 commit comments

Comments
 (0)