diff --git a/hackertray/chrome.py b/hackertray/chrome.py index cda5131..e08d9a4 100644 --- a/hackertray/chrome.py +++ b/hackertray/chrome.py @@ -5,11 +5,12 @@ import os import sys class Chrome: + HISTORY_TMP_LOCATION = '/tmp/hackertray.chrome' @staticmethod def search(urls, config_folder_path): Chrome.setup(config_folder_path) - conn = sqlite3.connect('/tmp/hackertray.chrome') - db = conn.cursor() + conn = sqlite3.connect(Chrome.HISTORY_TMP_LOCATION) + db = conn.cursor() result = [] for url in urls: db_result = db.execute('SELECT url from urls WHERE url=:url',{"url":url}) @@ -17,7 +18,7 @@ class Chrome: result.append(False) else: result.append(True) - os.remove('/tmp/hackertray.chrome') + os.remove(Chrome.HISTORY_TMP_LOCATION) return result @staticmethod def setup(config_folder_path): @@ -25,4 +26,4 @@ class Chrome: if not os.path.isfile(file_name): print("ERROR: ", "Could not find Chrome history file", file=sys.stderr) sys.exit(1) - shutil.copyfile(file_name, '/tmp/hackertray.chrome') \ No newline at end of file + shutil.copyfile(file_name, Chrome.HISTORY_TMP_LOCATION)