Skip to content

Commit 3f60ddc

Browse files
authored
Merge pull request #14 from suutari-ai/global-sanitizers-python-path
Add path of the config file to Python path
2 parents a3a6aad + c4a4ea2 commit 3f60ddc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

database_sanitizer/__main__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import unicode_literals
44

55
import argparse
6+
import os
67
import sys
78

89
from .config import Configuration
@@ -19,15 +20,13 @@ def main(args=None):
1920
parser.add_argument(
2021
"--config",
2122
"-c",
22-
nargs=1,
2323
type=str,
2424
dest="config",
2525
help="Path to the sanitizer configuration file.",
2626
)
2727
parser.add_argument(
2828
"--output",
2929
"-o",
30-
nargs=1,
3130
type=str,
3231
dest="output",
3332
help=(
@@ -45,9 +44,11 @@ def main(args=None):
4544
config = None
4645

4746
if args.config:
48-
config = Configuration.from_file(args.config[0])
47+
conf_dir = os.path.realpath(os.path.dirname(args.config))
48+
sys.path.insert(0, conf_dir)
49+
config = Configuration.from_file(args.config)
4950
if args.output:
50-
output = open(args.output[0], "w")
51+
output = open(args.output, "w")
5152

5253
try:
5354
run(

0 commit comments

Comments
 (0)