Mercurial > mozilla > hg > ProfileManager
comparison profilemanager/manager.py @ 15:543d08958b67
actually sample 8 random lowercase letters and numbers for the profile hash
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 06 May 2010 11:06:59 -0700 |
parents | c77e9bef78d6 |
children | c80d44e5ca41 |
comparison
equal
deleted
inserted
replaced
14:e846544b4d92 | 15:543d08958b67 |
---|---|
2 manage Mozilla/Firefox profiles | 2 manage Mozilla/Firefox profiles |
3 """ | 3 """ |
4 | 4 |
5 import os | 5 import os |
6 import shutil | 6 import shutil |
7 import string | |
7 import ConfigParser | 8 import ConfigParser |
9 from random import Random | |
8 from utils import format_tabular | 10 from utils import format_tabular |
9 from ConfigParser import SafeConfigParser as ConfigParser | 11 from ConfigParser import SafeConfigParser as ConfigParser |
10 | 12 |
11 # Changes to profiles.ini: | 13 # Changes to profiles.ini: |
12 # - add a ``backups`` field for each profile: | 14 # - add a ``backups`` field for each profile: |
162 | 164 |
163 def hash(self): | 165 def hash(self): |
164 """ | 166 """ |
165 generate a random hash for a new profile | 167 generate a random hash for a new profile |
166 """ | 168 """ |
167 # XXX right now this is completely fake | 169 population = string.lowercase + string.digits |
168 return 'FOO' | 170 return Random().sample(population, 8) |
169 | 171 |
170 | 172 |