From 52ebc9fc46338950b925edf84105cc1d499c4374 Mon Sep 17 00:00:00 2001 From: Al Date: Wed, 24 Feb 2016 13:10:44 -0500 Subject: [PATCH] [fix] Paths relative to the current file in address_dictionaries.py so it can be run from anywhere --- scripts/geodata/address_expansions/address_dictionaries.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/geodata/address_expansions/address_dictionaries.py b/scripts/geodata/address_expansions/address_dictionaries.py index 4107d523..cf810f4f 100644 --- a/scripts/geodata/address_expansions/address_dictionaries.py +++ b/scripts/geodata/address_expansions/address_dictionaries.py @@ -4,15 +4,15 @@ import sys from collections import defaultdict this_dir = os.path.realpath(os.path.dirname(__file__)) -sys.path.append(os.path.realpath(os.path.join(os.pardir, os.pardir))) +sys.path.append(os.path.realpath(os.path.join(this_dir, os.pardir, os.pardir))) from geodata.encoding import safe_encode, safe_decode ADDRESS_EXPANSIONS_DIR = os.path.join(this_dir, os.pardir, os.pardir, os.pardir, 'resources', 'dictionaries') -ADDRESS_HEADER_FILE = os.path.join(os.pardir, os.pardir, os.pardir, 'src', 'address_expansion_rule.h') -ADDRESS_DATA_FILE = os.path.join(os.pardir, os.pardir, os.pardir, 'src', 'address_expansion_data.c') +ADDRESS_HEADER_FILE = os.path.join(this_dir, os.pardir, os.pardir, os.pardir, 'src', 'address_expansion_rule.h') +ADDRESS_DATA_FILE = os.path.join(this_dir, os.pardir, os.pardir, os.pardir, 'src', 'address_expansion_data.c') address_language_index_template = u'{{{language}, {index}, {length}}}' address_expansion_rule_template = u'{{{phrase}, {num_dictionaries}, {{{dictionaries}}}, {canonical_index}}}'