Skip to content

Commit

Permalink
Merge pull request AlessandroZ#282 from KiUserExceptionDispatcher/pat…
Browse files Browse the repository at this point in the history
…ch-1

Relative profiles in Mozilla
  • Loading branch information
AlessandroZ authored Sep 19, 2018
2 parents 7c3122f + d896816 commit 8c0f2be
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Windows/lazagne/softwares/browsers/mozilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,20 @@ def get_firefox_profiles(self, directory):
cp.read(os.path.join(directory, 'profiles.ini'))
for section in cp.sections():
if section.startswith('Profile') and cp.has_option(section, 'Path'):
profile_list.append(os.path.join(directory, cp.get(section, 'Path').strip()))
profile_path = None

if cp.has_option(section, 'IsRelative'):
if cp.get(section, 'IsRelative') == '1':
profile_path = os.path.join(directory, cp.get(section, 'Path').strip())
elif cp.get(section, 'IsRelative') == '0':
profile_path = cp.get(section, 'Path').strip()

else: # No "IsRelative" in profiles.ini
profile_path = os.path.join(directory, cp.get(section, 'Path').strip())

if profile_path:
profile_list.append(profile_path)

except Exception as e:
self.error(u'An error occurred while reading profiles.ini: {}'.format(e))
return profile_list
Expand Down

0 comments on commit 8c0f2be

Please sign in to comment.