comparison profilemanager/manager.py @ 18:8e651dd8e9ad

fix two things about hash() usage
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 06 May 2010 12:02:14 -0700
parents c80d44e5ca41
children 4a1815f8d146
comparison
equal deleted inserted replaced
17:d7d051611425 18:8e651dd8e9ad
40 """ 40 """
41 41
42 # path to the profile directory 42 # path to the profile directory
43 dirname = name 43 dirname = name
44 if hash: 44 if hash:
45 dirname = '%s.%s' % self.hash() 45 dirname = '%s.%s' % (self.hash(), dirname)
46 if not directory: 46 if not directory:
47 directory = self.profile_dir 47 directory = self.profile_dir
48 dirname = os.path.join(directory, dirname) 48 dirname = os.path.join(directory, dirname)
49 49
50 # create directory 50 # create directory
181 def hash(self): 181 def hash(self):
182 """ 182 """
183 generate a random hash for a new profile 183 generate a random hash for a new profile
184 """ 184 """
185 population = string.lowercase + string.digits 185 population = string.lowercase + string.digits
186 return Random().sample(population, 8) 186 return ''.join(Random().sample(population, 8))
187 187
188 188