debuggers.hg

view tools/misc/sxp-pretty @ 22906:700ac6445812

Now add KDB to the non-kdb tree
author Mukesh Rathor
date Thu Feb 03 15:42:41 2011 -0800 (2011-02-03)
parents 0e24e9674ded
children
line source
1 #!/usr/bin/env python
2 # -*- mode: python; -*-
3 #============================================================================
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of version 2.1 of the GNU Lesser General Public
6 # License as published by the Free Software Foundation.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 #============================================================================
17 # Copyright (c) 2007 XenSource Inc.
18 #============================================================================
21 import commands
22 import os.path
23 import pprint
24 import sys
26 import xen.xend.sxp as sxp
28 def main():
29 if len(sys.argv) == 1 or sys.argv[1] in ['', '-']:
30 s = sxp.parse(sys.stdin)
31 else:
32 s = sxp.parse(open(sys.argv[1]))
34 pprint.pprint(s)
36 if __name__ == '__main__':
37 sys.exit(main())