-
-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[jarun#791] added support for absolute paths in Firefox autoimport #792
Conversation
profiles = firefox_profile or get_firefox_profile_names(default_ff_folder) | ||
if profiles: | ||
ff_bm_db_paths = {s: '~/.mozilla/firefox/{}/places.sqlite'.format(s) | ||
for s in profiles} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got moved into a separate function, since it's exactly the same processing other than the prefix.
(Also it's easier to test for correctness this way.)
self.load_chrome_database(bookmarks_database, newtag, add_parent_folder_as_tag) | ||
except Exception as e: | ||
LOGERR(e) | ||
print(f'Could not import bookmarks from {name}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 3 blocks were identical, sans the browser name and the DB path
@@ -3612,7 +3569,7 @@ def get_firefox_profile_names(path): | |||
from configparser import ConfigParser, NoOptionError | |||
|
|||
profiles = [] | |||
profile_path = os.path.join(path, 'profiles.ini') | |||
profile_path = os.path.expanduser(os.path.join(path, 'profiles.ini')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the expansion is necessary either way, it's more reliable to just do it within the function, instead of relying on it be done by the invoking code.
StartWithLastProfile=1 | ||
Version=2 | ||
'''), ['/path/to/removable/drive/ABCD', 'zsq8tck1.default-release']), | ||
('', []), (None, []), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Paths from Install
s, paths from Profile
s, empty file, no file.
'/bar/baz': os.path.join('/bar/baz', 'places.sqlite'), | ||
}), | ||
(['foo', '/bar/baz'], 'qux', {'qux': os.path.join('~/profiles', 'qux', 'places.sqlite')}), | ||
([], '/grue/xyzzy', {'/grue/xyzzy': os.path.join('/grue/xyzzy', 'places.sqlite')}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No custom profile path, directory name, absolute path.
Thank you! |
fixes #791:
profiles.ini
or supplied withFIREFOX_PROFILE=
)Also cleaned up some duplicate code in
.auto_import_from_browser()
.