Skip to content

Commit 692544e

Browse files
author
cmuraru
committed
Use newer pyyaml
1 parent d0f84da commit 692544e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

hierarchical_yaml/main.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class ConfigRunner(object):
1919
def run(self, args):
2020
parser = self.get_parser()
2121
opts = parser.parse_args(args)
22+
self.do_run(opts)
23+
24+
def do_run(self, opts):
2225
cwd = opts.cwd if opts.cwd else os.getcwd()
2326
filters = opts.filter if opts.filter else ()
2427
excluded_keys = opts.exclude if opts.exclude else ()
@@ -31,11 +34,15 @@ def run(self, args):
3134
opts.skip_interpolation_validation)
3235

3336
@staticmethod
34-
def get_parser():
35-
parser = argparse.ArgumentParser()
36-
parser.add_argument('path', type=str, help='The config directory')
37+
def get_parser(parser=None):
38+
if not parser:
39+
parser = argparse.ArgumentParser()
40+
parser.add_argument('path', type=str, help='The config directory')
41+
3742
parser.add_argument('--output-file', dest='output_file', type=str,
3843
help='output file location')
44+
parser.add_argument('--print-data', action='store_true',
45+
help='print generated data on screen')
3946
parser.add_argument('--format', dest='output_format', type=str, default="yaml",
4047
help='output file format')
4148
parser.add_argument('--filter', dest='filter', action='append',

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ lru_cache>=0.2.3
33
backports.functools_lru_cache>=1.5
44
pathlib2>=2.3.4
55
boto3>=1.9.110
6-
pyyaml
6+
pyyaml>=5.1

0 commit comments

Comments
 (0)