Skip to content

Commit

Permalink
Merge pull request #683 from dertuxmalwieder/patch-2
Browse files Browse the repository at this point in the history
Fixed Windows profile detection
  • Loading branch information
jarun authored Apr 18, 2023
2 parents 61f10d1 + cf96d6c commit 3164d08
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions buku
Original file line number Diff line number Diff line change
Expand Up @@ -2479,22 +2479,16 @@ class BukuDb:

me_bm_db_path = '~/Library/Application Support/Microsoft Edge/Default/Bookmarks'
elif sys.platform == 'win32':
username = os.getlogin()
gc_bm_db_path = os.path.expandvars('%LOCALAPPDATA%/Google/Chrome/User Data/Default/Bookmarks')
cb_bm_db_path = os.path.expandvars('%LOCALAPPDATA%/Chromium/User Data/Default/Bookmarks')
vi_bm_db_path = os.path.expandvars('%LOCALAPPDATA%/Vivaldi/User Data/Default/Bookmarks')

gc_bm_db_path = ('C:/Users/{}/AppData/Local/Google/Chrome/User Data/'
'Default/Bookmarks'.format(username))
cb_bm_db_path = ('C:/Users/{}/AppData/Local/Chromium/User Data/'
'Default/Bookmarks'.format(username))
vi_bm_db_path = ('C:/Users/{}/AppData/Local/Vivaldi/User Data/'
'Default/Bookmarks'.format(username))

default_ff_folder = 'C:/Users/{}/AppData/Roaming/Mozilla/Firefox/'.format(username)
default_ff_folder = os.path.expandvars('%APPDATA%/Mozilla/Firefox/')
profile = get_firefox_profile_name(default_ff_folder)
if profile:
ff_bm_db_path = os.path.join(default_ff_folder, '{}/places.sqlite'.format(profile))

me_bm_db_path = ('C:/Users/{}/AppData/Local/Microsoft/Edge/User Data/'
'Default/Bookmarks'.format(username))
me_bm_db_path = os.path.expandvars('%LOCALAPPDATA%/Microsoft/Edge/User Data/Default/Bookmarks')
else:
LOGERR('buku does not support {} yet'.format(sys.platform))
self.close_quit(1)
Expand Down

0 comments on commit 3164d08

Please sign in to comment.