diff options
author | Tommi Komulainen <tko@litl.com> | 2008-11-20 15:32:07 +0000 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2008-11-20 15:26:43 -0500 |
commit | dfbb6f7cdeb2b307678728801d466d207759372f (patch) | |
tree | a1a194612d372f35a8845ab0071c5864d667021d | |
parent | 8d049cccdaf2fa1d5710e3cc613c4cbcc3a31e45 (diff) |
Make firefox profile lookup more relaxed
Select the first profile with a Path entry, and in case of multiple
profiles use the one with Default=1
Fixes profile lookup with profiles.ini that looks like:
[General]
StartWithLastProfile=1
[Profile0]
Name=default
IsRelative=1
Path=t0ps3cr3t.default
-rwxr-xr-x | git-bz | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -441,7 +441,11 @@ def get_bugzilla_cookies(host): cp = RawConfigParser() cp.read(os.path.join(profiles_dir, "profiles.ini")) for section in cp.sections(): - if cp.has_option(section, "Default") and cp.get(section, "Default").strip() == "1": + if not cp.has_option(section, "Path"): + continue + + if profile_path is None or ( + cp.has_option(section, "Default") and cp.get(section, "Default").strip() == "1"): profile_path = os.path.join(profiles_dir, cp.get(section, "Path").strip()) if not profile_path: |