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

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

Issue 1128: msilib.Directory.make_short only handles file names with a single dot in them
Patch Set: Created 9 years, 4 months 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # -*- coding: iso-8859-1 -*- 1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2005 Martin v. Löwis 2 # Copyright (C) 2005 Martin v. Löwis
3 # Licensed to PSF under a Contributor Agreement. 3 # Licensed to PSF under a Contributor Agreement.
4 from _msi import * 4 from _msi import *
5 import os, string, re 5 import os, string, re
6 6
7 Win64=0 7 Win64=0
8 8
9 # Partially taken from Wine 9 # Partially taken from Wine
10 datasizemask= 0x00ff 10 datasizemask= 0x00ff
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 else: 274 else:
275 keyid = None 275 keyid = None
276 add_data(self.db, "Component", 276 add_data(self.db, "Component",
277 [(component, uuid, self.logical, flags, None, keyid)]) 277 [(component, uuid, self.logical, flags, None, keyid)])
278 if feature is None: 278 if feature is None:
279 feature = current_feature 279 feature = current_feature
280 add_data(self.db, "FeatureComponents", 280 add_data(self.db, "FeatureComponents",
281 [(feature.id, component)]) 281 [(feature.id, component)])
282 282
283 def make_short(self, file): 283 def make_short(self, file):
284 parts = file.split(".") 284 # return a tuple with the name of file and its extension
285 if len(parts)>1: 285 parts = os.path.splitext(file)
286 suffix = parts[-1].upper() 286 if parts[1]: # if the file don't has a extension, parts[1] = ''
287 suffix = parts[1].upper()
287 else: 288 else:
288 suffix = None 289 suffix = None
289 prefix = parts[0].upper() 290 prefix = parts[0].upper()
290 if len(prefix) <= 8 and (not suffix or len(suffix)<=3): 291 if len(prefix) <= 8 and (not suffix or len(suffix)<=3):
291 if suffix: 292 if suffix:
292 file = prefix+"."+suffix 293 file = prefix+"."+suffix
293 else: 294 else:
294 file = prefix 295 file = prefix
295 assert file not in self.short_names 296 assert file not in self.short_names
296 else: 297 else:
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 return self.control(name, "PushButton", x, y, w, h, attr, None, text, ne xt, None) 455 return self.control(name, "PushButton", x, y, w, h, attr, None, text, ne xt, None)
455 456
456 def radiogroup(self, name, x, y, w, h, attr, prop, text, next): 457 def radiogroup(self, name, x, y, w, h, attr, prop, text, next):
457 add_data(self.db, "Control", 458 add_data(self.db, "Control",
458 [(self.name, name, "RadioButtonGroup", 459 [(self.name, name, "RadioButtonGroup",
459 x, y, w, h, attr, prop, text, next, None)]) 460 x, y, w, h, attr, prop, text, next, None)])
460 return RadioButtonGroup(self, name, prop) 461 return RadioButtonGroup(self, name, prop)
461 462
462 def checkbox(self, name, x, y, w, h, attr, prop, text, next): 463 def checkbox(self, name, x, y, w, h, attr, prop, text, next):
463 return self.control(name, "CheckBox", x, y, w, h, attr, prop, text, next , None) 464 return self.control(name, "CheckBox", x, y, w, h, attr, prop, text, next , None)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

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