Fixing import paths of memap.py when excuted as a script

pull/7673/head
Brian Daniels 2018-08-01 13:59:19 -05:00
parent f15dbf2c3d
commit b5a187ddb3
1 changed files with 11 additions and 6 deletions

View File

@ -4,10 +4,15 @@
from __future__ import print_function, division, absolute_import from __future__ import print_function, division, absolute_import
from abc import abstractmethod, ABCMeta from abc import abstractmethod, ABCMeta
from sys import stdout, exit, argv from sys import stdout, exit, argv, path
from os import sep, rename, remove from os import sep, rename, remove
from os.path import (basename, dirname, join, relpath, abspath, commonprefix, from os.path import (basename, dirname, join, relpath, abspath, commonprefix,
splitext, exists) splitext, exists)
# Be sure that the tools directory is in the search path
ROOT = abspath(join(dirname(__file__), ".."))
path.insert(0, ROOT)
import re import re
import csv import csv
import json import json
@ -18,9 +23,9 @@ from prettytable import PrettyTable
from jinja2 import FileSystemLoader, StrictUndefined from jinja2 import FileSystemLoader, StrictUndefined
from jinja2.environment import Environment from jinja2.environment import Environment
from .utils import (argparse_filestring_type, argparse_lowercase_hyphen_type, from tools.utils import (argparse_filestring_type, argparse_lowercase_hyphen_type,
argparse_uppercase_type) argparse_uppercase_type)
from .settings import COMPARE_FIXED from tools.settings import COMPARE_FIXED
class _Parser(object): class _Parser(object):