Changeset 391 for python/trunk/Lib/msilib
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/msilib/__init__.py
r2 r391 174 174 175 175 def make_id(str): 176 #str = str.replace(".", "_") # colons are allowed 177 str = str.replace(" ", "_") 178 str = str.replace("-", "_") 179 if str[0] in string.digits: 180 str = "_"+str 176 identifier_chars = string.ascii_letters + string.digits + "._" 177 str = "".join([c if c in identifier_chars else "_" for c in str]) 178 if str[0] in (string.digits + "."): 179 str = "_" + str 181 180 assert re.match("^[A-Za-z_][A-Za-z0-9_.]*$", str), "FILE"+str 182 181 return str … … 286 285 287 286 def make_short(self, file): 287 oldfile = file 288 file = file.replace('+', '_') 289 file = ''.join(c for c in file if not c in ' "/\[]:;=,') 288 290 parts = file.split(".") 289 if len(parts)>1: 291 if len(parts) > 1: 292 prefix = "".join(parts[:-1]).upper() 290 293 suffix = parts[-1].upper() 291 else: 294 if not prefix: 295 prefix = suffix 296 suffix = None 297 else: 298 prefix = file.upper() 292 299 suffix = None 293 prefix = parts[0].upper()294 if len(prefix) <= 8 and (not suffix or len(suffix)<=3):300 if len(parts) < 3 and len(prefix) <= 8 and file == oldfile and ( 301 not suffix or len(suffix) <= 3): 295 302 if suffix: 296 303 file = prefix+"."+suffix 297 304 else: 298 305 file = prefix 299 assert file not in self.short_names 300 else: 306 else: 307 file = None 308 if file is None or file in self.short_names: 301 309 prefix = prefix[:6] 302 310 if suffix: … … 319 327 def add_file(self, file, src=None, version=None, language=None): 320 328 """Add a file to the current component of the directory, starting a new one 321 oneif there is no current component. By default, the file name in the source329 if there is no current component. By default, the file name in the source 322 330 and the file table will be identical. If the src file is specified, it is 323 331 interpreted relative to the current directory. Optionally, a version and a … … 331 339 absolute = os.path.join(self.absolute, src) 332 340 assert not re.search(r'[\?|><:/*]"', file) # restrictions on long names 333 if self.keyfiles.has_key(file):341 if file in self.keyfiles: 334 342 logical = self.keyfiles[file] 335 343 else: -
python/trunk/Lib/msilib/schema.py
r2 r391 959 959 (u'Shortcut',u'Name',u'N',None, None, None, None, u'Filename',None, u'The name of the shortcut to be created.',), 960 960 (u'Shortcut',u'Description',u'Y',None, None, None, None, u'Text',None, u'The description for the shortcut.',), 961 (u'Shortcut',u'Component_',u'N',None, None, u'Component',1,u'Identifier',None, u'Foreign key into the Component table denoting the component whose selection gates the theshortcut creation/deletion.',),961 (u'Shortcut',u'Component_',u'N',None, None, u'Component',1,u'Identifier',None, u'Foreign key into the Component table denoting the component whose selection gates the shortcut creation/deletion.',), 962 962 (u'Shortcut',u'Icon_',u'Y',None, None, u'Icon',1,u'Identifier',None, u'Foreign key into the File table denoting the external icon file for the shortcut.',), 963 963 (u'Shortcut',u'IconIndex',u'Y',-32767,32767,None, None, None, None, u'The icon index for the shortcut.',),
Note:
See TracChangeset
for help on using the changeset viewer.