Skip to content

Commit e8fb466

Browse files
committed
add nipype_display_pklz in bin
1 parent 8423e90 commit e8fb466

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

bin/nipype_display_pklz

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!python
2+
"""Prints the content of any .pklz file in your working directory.
3+
4+
Examples:
5+
6+
nipype_print_pklz _inputs.pklz
7+
nipype_print_pklz _node.pklz
8+
"""
9+
10+
def pprint_pklz_file(pklz_file):
11+
""" Print the content of the pklz_file. """
12+
from pprint import pprint
13+
from nipype.utils.filemanip import loadpkl
14+
15+
pkl_data = loadpkl(pklz_file)
16+
pprint(pkl_data)
17+
18+
19+
if __name__ == "__main__":
20+
21+
import sys
22+
from argparse import ArgumentParser, RawTextHelpFormatter
23+
24+
defstr = ' (default %(default)s)'
25+
parser = ArgumentParser(prog='nipype_print_pklz',
26+
description=__doc__,
27+
formatter_class=RawTextHelpFormatter)
28+
parser.add_argument('pklzfile', metavar='f', type=str,
29+
help='pklz file to display')
30+
31+
if len(sys.argv) == 1:
32+
parser.print_help()
33+
exit(0)
34+
35+
args = parser.parse_args()
36+
pprint_pklz_file(args.pklzfile)

0 commit comments

Comments
 (0)