revision 2
This commit is contained in:
parent
3131d3d3bc
commit
b6466b7410
@ -2,7 +2,7 @@
|
|||||||
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
|
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
|
||||||
|
|
||||||
# Copyright 2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
|
# Copyright 2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
|
||||||
# Copyright 2014-2017 Josefson Souza <josefson.br@gmail.com>
|
# Copyright 2017 Josefson Souza <josefson.br@gmail.com>
|
||||||
|
|
||||||
# This file is part of qutebrowser.
|
# This file is part of qutebrowser.
|
||||||
#
|
#
|
||||||
@ -32,17 +32,17 @@ import os
|
|||||||
def parse():
|
def parse():
|
||||||
"""Parse command line arguments."""
|
"""Parse command line arguments."""
|
||||||
description = ("This program is meant to extract browser history from your"
|
description = ("This program is meant to extract browser history from your"
|
||||||
"previous browser and import them into qutebrowser.")
|
" previous browser and import them into qutebrowser.")
|
||||||
epilog = ("Databases:\n\tQutebrowser: Is named 'history.sqlite' and can be"
|
epilog = ("Databases:\n\n\tqutebrowser: Is named 'history.sqlite' and can be"
|
||||||
" found at your --basedir. In order to find where your basedir"
|
" found at your --basedir. In order to find where your basedir"
|
||||||
" is you can run ':open qute:version' inside qutebrowser."
|
" is you can run ':open qute:version' inside qutebrowser."
|
||||||
"\n\tFirerox: Is named 'places.sqlite', and can be found at your"
|
"\n\n\tFirefox: Is named 'places.sqlite', and can be found at your"
|
||||||
"system\"s profile folder. Check this link for where it is locat"
|
" system's profile folder. Check this link for where it is "
|
||||||
"ed: http://kb.mozillazine.org/Profile_folder"
|
"located: http://kb.mozillazine.org/Profile_folder"
|
||||||
"\n\tChrome: Is named 'History', and can be found at the respec"
|
"\n\n\tChrome: Is named 'History', and can be found at the "
|
||||||
"tive User Data Directory. Check this link for where it is locat"
|
"respective User Data Directory. Check this link for where it is"
|
||||||
"ed: https://chromium.googlesource.com/chromium/src/+/master/"
|
"located: https://chromium.googlesource.com/chromium/src/+/"
|
||||||
"docs/user_data_dir.md\n\n"
|
"master/docs/user_data_dir.md\n\n"
|
||||||
"Example: hist_importer.py -b firefox -s /Firefox/Profile/"
|
"Example: hist_importer.py -b firefox -s /Firefox/Profile/"
|
||||||
"places.sqlite -d /qutebrowser/data/history.sqlite")
|
"places.sqlite -d /qutebrowser/data/history.sqlite")
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
@ -55,7 +55,7 @@ def parse():
|
|||||||
type=str, help='Source: Full path to the sqlite data'
|
type=str, help='Source: Full path to the sqlite data'
|
||||||
'base file from the source browser.')
|
'base file from the source browser.')
|
||||||
parser.add_argument('-d', '--dest', dest='dest', required=True, type=str,
|
parser.add_argument('-d', '--dest', dest='dest', required=True, type=str,
|
||||||
help='Destination: The full path to the qutebrowser '
|
help='\nDestination: Full path to the qutebrowser '
|
||||||
'sqlite database')
|
'sqlite database')
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
@ -66,10 +66,9 @@ def open_db(data_base):
|
|||||||
conn = sqlite3.connect(data_base)
|
conn = sqlite3.connect(data_base)
|
||||||
return conn
|
return conn
|
||||||
else:
|
else:
|
||||||
raise sys.exit('\nDataBaseNotFound: There was some error trying to to'
|
raise sys.exit('DataBaseNotFound: There was some error trying to to'
|
||||||
' connect with the [{}] database. Verify if the'
|
' connect with the [{}] database. Verify if the'
|
||||||
' filepath is correct or is being used.'
|
' given file path is correct.'.format(data_base))
|
||||||
.format(data_base))
|
|
||||||
|
|
||||||
|
|
||||||
def extract(source, query):
|
def extract(source, query):
|
||||||
@ -91,8 +90,7 @@ def extract(source, query):
|
|||||||
return history
|
return history
|
||||||
except sqlite3.OperationalError as op_e:
|
except sqlite3.OperationalError as op_e:
|
||||||
print('\nCould not perform queries into the source database: {}'
|
print('\nCould not perform queries into the source database: {}'
|
||||||
'\nBrowser version is not supported as it have a different sql'
|
.format(op_e))
|
||||||
' schema.'.format(op_e))
|
|
||||||
|
|
||||||
|
|
||||||
def clean(history):
|
def clean(history):
|
||||||
|
Loading…
Reference in New Issue
Block a user