Chromium support (#232)
* new: dev: chromium support * new: dev: path for windows and mac osx
This commit is contained in:
parent
2d037d00d7
commit
517ac6319d
14
buku.py
14
buku.py
@ -2052,6 +2052,7 @@ class BukuDb:
|
||||
|
||||
if sys.platform.startswith('linux'):
|
||||
GC_BM_DB_PATH = '~/.config/google-chrome/Default/Bookmarks'
|
||||
CB_BM_DB_PATH = '~/.config/chromium/Default/Bookmarks'
|
||||
|
||||
DEFAULT_FF_FOLDER = os.path.expanduser('~/.mozilla/firefox')
|
||||
profile = get_firefox_profile_name(DEFAULT_FF_FOLDER)
|
||||
@ -2059,6 +2060,7 @@ class BukuDb:
|
||||
FF_BM_DB_PATH = '~/.mozilla/firefox/{}/places.sqlite'.format(profile)
|
||||
elif sys.platform == 'darwin':
|
||||
GC_BM_DB_PATH = '~/Library/Application Support/Google/Chrome/Default/Bookmarks'
|
||||
CB_BM_DB_PATH = '~/Library/Application Support/Chromium/Default/Bookmarks'
|
||||
|
||||
DEFAULT_FF_FOLDER = os.path.expanduser('~/Library/Application Support/Firefox')
|
||||
profile = get_firefox_profile_name(DEFAULT_FF_FOLDER)
|
||||
@ -2067,6 +2069,7 @@ class BukuDb:
|
||||
elif sys.platform == 'win32':
|
||||
username = os.getlogin()
|
||||
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)
|
||||
|
||||
DEFAULT_FF_FOLDER = 'C:/Users/{}/AppData/Roaming/Mozilla/Firefox/'.format(username)
|
||||
profile = get_firefox_profile_name(DEFAULT_FF_FOLDER)
|
||||
@ -2097,6 +2100,17 @@ class BukuDb:
|
||||
except Exception:
|
||||
print('Could not import bookmarks from google-chrome')
|
||||
|
||||
try:
|
||||
if self.chatty:
|
||||
resp = input('Import bookmarks from chromium? (y/n): ')
|
||||
if resp == 'y':
|
||||
bookmarks_database = os.path.expanduser(CB_BM_DB_PATH)
|
||||
if not os.path.exists(bookmarks_database):
|
||||
raise FileNotFoundError
|
||||
self.load_chrome_database(bookmarks_database, newtag, add_parent_folder_as_tag)
|
||||
except Exception:
|
||||
print('Could not import bookmarks from chromium')
|
||||
|
||||
try:
|
||||
if self.chatty:
|
||||
resp = input('Import bookmarks from firefox? (y/n): ')
|
||||
|
Loading…
Reference in New Issue
Block a user