Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(51)

Side by Side Diff: Lib/msilib/__init__.py

Issue 7639: bdist_msi fails on files with long names
Patch Set: Created 9 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Lib/test/test_msilib.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2005 Martin v. Löwis 1 # Copyright (C) 2005 Martin v. Löwis
2 # Licensed to PSF under a Contributor Agreement. 2 # Licensed to PSF under a Contributor Agreement.
3 from _msi import * 3 from _msi import *
4 import os, string, re, sys 4 import os, string, re, sys
5 5
6 AMD64 = "AMD64" in sys.version 6 AMD64 = "AMD64" in sys.version
7 Itanium = "Itanium" in sys.version 7 Itanium = "Itanium" in sys.version
8 Win64 = AMD64 or Itanium 8 Win64 = AMD64 or Itanium
9 9
10 # Partially taken from Wine 10 # Partially taken from Wine
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 ("Manufacturer", Manufacturer), 165 ("Manufacturer", Manufacturer),
166 ("ProductLanguage", "1033")]) 166 ("ProductLanguage", "1033")])
167 db.Commit() 167 db.Commit()
168 return db 168 return db
169 169
170 def add_tables(db, module): 170 def add_tables(db, module):
171 for table in module.tables: 171 for table in module.tables:
172 add_data(db, table, getattr(module, table)) 172 add_data(db, table, getattr(module, table))
173 173
174 def make_id(str): 174 def make_id(str):
175 #str = str.replace(".", "_") # colons are allowed 175 identifier_chars = string.ascii_letters + string.digits + "._"
176 for c in " -+~;": 176 str = "".join([c if c in identifier_chars else "_" for c in str])
177 str = str.replace(c, "_")
178 if str[0] in (string.digits + "."): 177 if str[0] in (string.digits + "."):
179 str = "_" + str 178 str = "_" + str
180 assert re.match("^[A-Za-z_][A-Za-z0-9_.]*$", str), "FILE"+str 179 assert re.match("^[A-Za-z_][A-Za-z0-9_.]*$", str), "FILE"+str
181 return str 180 return str
182 181
183 def gen_uuid(): 182 def gen_uuid():
184 return "{"+UuidCreate().upper()+"}" 183 return "{"+UuidCreate().upper()+"}"
185 184
186 class CAB: 185 class CAB:
187 def __init__(self, name): 186 def __init__(self, name):
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 return self.control(name, "PushButton", x, y, w, h, attr, None, text, ne xt, None) 465 return self.control(name, "PushButton", x, y, w, h, attr, None, text, ne xt, None)
467 466
468 def radiogroup(self, name, x, y, w, h, attr, prop, text, next): 467 def radiogroup(self, name, x, y, w, h, attr, prop, text, next):
469 add_data(self.db, "Control", 468 add_data(self.db, "Control",
470 [(self.name, name, "RadioButtonGroup", 469 [(self.name, name, "RadioButtonGroup",
471 x, y, w, h, attr, prop, text, next, None)]) 470 x, y, w, h, attr, prop, text, next, None)])
472 return RadioButtonGroup(self, name, prop) 471 return RadioButtonGroup(self, name, prop)
473 472
474 def checkbox(self, name, x, y, w, h, attr, prop, text, next): 473 def checkbox(self, name, x, y, w, h, attr, prop, text, next):
475 return self.control(name, "CheckBox", x, y, w, h, attr, prop, text, next , None) 474 return self.control(name, "CheckBox", x, y, w, h, attr, prop, text, next , None)
OLDNEW
« no previous file with comments | « no previous file | Lib/test/test_msilib.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+