From d1ce47142f764677ef18e488d19ad3fe6d1bcd6f Mon Sep 17 00:00:00 2001 From: jekyc Date: Wed, 30 Mar 2016 22:04:11 +0200 Subject: [PATCH] Cleaned the merge a bit and added some comments --- classes/fingerprints.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/classes/fingerprints.py b/classes/fingerprints.py index 76748de..5735d21 100644 --- a/classes/fingerprints.py +++ b/classes/fingerprints.py @@ -1,16 +1,17 @@ import json -import os import copy - +import os import os.path -datadir = os.path.dirname(os.path.abspath(__file__)) -datadir = datadir.rsplit('/', maxsplit=1)[0] -datadir += '/data' class Fingerprints(object): - def __init__(self): + def __init__(self, data_dir='data'): + # get the absolute location of this file + datadir = os.path.dirname(os.path.abspath(__file__)) + + # remove the 'classes' dir and add the 'data_dir' + datadir = os.path.join(datadir.rsplit('/', maxsplit=1)[0], data_dir) self.data = { 'cms': {