Kaydet (Commit) 367c79a4 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

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

üst f2e23d03
...@@ -382,6 +382,7 @@ def add_ui(db): ...@@ -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"' 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" # See "CustomAction Table"
add_data(db, "CustomAction", [ add_data(db, "CustomAction", [
# msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty # msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty
...@@ -395,6 +396,7 @@ def add_ui(db): ...@@ -395,6 +396,7 @@ def add_ui(db):
# See "Custom Action Type 18" # See "Custom Action Type 18"
("CompilePyc", 18, "python.exe", compileargs), ("CompilePyc", 18, "python.exe", compileargs),
("CompilePyo", 18, "python.exe", "-O "+compileargs), ("CompilePyo", 18, "python.exe", "-O "+compileargs),
("CompileGrammar", 18, "python.exe", lib2to3args),
]) ])
# UI Sequences, see "InstallUISequence Table", "Using a Sequence Table" # UI Sequences, see "InstallUISequence Table", "Using a Sequence Table"
...@@ -424,12 +426,14 @@ def add_ui(db): ...@@ -424,12 +426,14 @@ def add_ui(db):
("UpdateEditIDLE", None, 1050), ("UpdateEditIDLE", None, 1050),
("CompilePyc", "COMPILEALL", 6800), ("CompilePyc", "COMPILEALL", 6800),
("CompilePyo", "COMPILEALL", 6801), ("CompilePyo", "COMPILEALL", 6801),
("CompileGrammar", "COMPILEALL", 6802),
]) ])
add_data(db, "AdminExecuteSequence", add_data(db, "AdminExecuteSequence",
[("InitialTargetDir", 'TARGETDIR=""', 750), [("InitialTargetDir", 'TARGETDIR=""', 750),
("SetDLLDirToTarget", 'DLLDIR=""', 751), ("SetDLLDirToTarget", 'DLLDIR=""', 751),
("CompilePyc", "COMPILEALL", 6800), ("CompilePyc", "COMPILEALL", 6800),
("CompilePyo", "COMPILEALL", 6801), ("CompilePyo", "COMPILEALL", 6801),
("CompileGrammar", "COMPILEALL", 6802),
]) ])
##################################################################### #####################################################################
...@@ -999,6 +1003,8 @@ def add_files(db): ...@@ -999,6 +1003,8 @@ def add_files(db):
if dir=="setuptools": if dir=="setuptools":
lib.add_file("cli.exe") lib.add_file("cli.exe")
lib.add_file("gui.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": if dir=="data" and parent.physical=="test" and parent.basedir.physical=="email":
# This should contain all non-.svn files listed in subversion # This should contain all non-.svn files listed in subversion
for f in os.listdir(lib.absolute): for f in os.listdir(lib.absolute):
......
...@@ -571,6 +571,11 @@ class Directory: ...@@ -571,6 +571,11 @@ class Directory:
[(self.component+"c", self.component, "*.pyc", self.logical, 2), [(self.component+"c", self.component, "*.pyc", self.logical, 2),
(self.component+"o", self.component, "*.pyo", 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: class Feature:
def __init__(self, db, id, title, desc, display, level = 1, def __init__(self, db, id, title, desc, display, level = 1,
parent=None, directory = None, attributes=0): parent=None, directory = None, attributes=0):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment