Honor --tacit in auto-import
This commit is contained in:
parent
944aa06ae1
commit
7454bdf5ea
24
buku.py
24
buku.py
@ -1824,7 +1824,7 @@ class BukuDb:
|
|||||||
except Exception:
|
except Exception:
|
||||||
print('Error here')
|
print('Error here')
|
||||||
|
|
||||||
def import_from_browser(self):
|
def auto_import_from_browser(self):
|
||||||
'''Import bookmarks from a browser default database file.
|
'''Import bookmarks from a browser default database file.
|
||||||
Supports Firefox and Google Chrome.
|
Supports Firefox and Google Chrome.
|
||||||
|
|
||||||
@ -1871,17 +1871,25 @@ class BukuDb:
|
|||||||
logerr('Buku does not support {} yet'.format(sys.platform))
|
logerr('Buku does not support {} yet'.format(sys.platform))
|
||||||
self.close_quit(1)
|
self.close_quit(1)
|
||||||
|
|
||||||
|
resp = 'y'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
webbrowser.get('google-chrome')
|
if self.chatty:
|
||||||
bookmarks_database = os.path.expanduser(GC_BM_DB_PATH)
|
resp = input('Import bookmarks from google chrome? (y/n): ')
|
||||||
walk(self.load_chrome_database(bookmarks_database))
|
if resp == 'y':
|
||||||
|
webbrowser.get('google-chrome')
|
||||||
|
bookmarks_database = os.path.expanduser(GC_BM_DB_PATH)
|
||||||
|
walk(self.load_chrome_database(bookmarks_database))
|
||||||
except Exception:
|
except Exception:
|
||||||
logerr('Could not import from google-chrome')
|
logerr('Could not import from google-chrome')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
webbrowser.get('firefox')
|
if self.chatty:
|
||||||
bookmarks_database = os.path.expanduser(FF_BM_DB_PATH)
|
resp = input('Import bookmarks from firefox? (y/n): ')
|
||||||
self.load_firefox_database(bookmarks_database)
|
if resp == 'y':
|
||||||
|
webbrowser.get('firefox')
|
||||||
|
bookmarks_database = os.path.expanduser(FF_BM_DB_PATH)
|
||||||
|
self.load_firefox_database(bookmarks_database)
|
||||||
except Exception:
|
except Exception:
|
||||||
logerr('Could not import from firefox')
|
logerr('Could not import from firefox')
|
||||||
|
|
||||||
@ -3573,7 +3581,7 @@ POSITIONAL ARGUMENTS:
|
|||||||
|
|
||||||
# Import bookmarks from browser
|
# Import bookmarks from browser
|
||||||
if args.ib:
|
if args.ib:
|
||||||
bdb.import_from_browser()
|
bdb.auto_import_from_browser()
|
||||||
|
|
||||||
# Merge a database file and exit
|
# Merge a database file and exit
|
||||||
if args.merge is not None:
|
if args.merge is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user