debuggers.hg

annotate tools/misc/sxp-pretty @ 22848:6341fe0f4e5a

Added tag 4.1.0-rc2 for changeset 9dca60d88c63
author Keir Fraser <keir@xen.org>
date Tue Jan 25 14:06:55 2011 +0000 (2011-01-25)
parents 0e24e9674ded
children
rev   line source
ewan@14187 1 #!/usr/bin/env python
ewan@14187 2 # -*- mode: python; -*-
ewan@14187 3 #============================================================================
ewan@14187 4 # This library is free software; you can redistribute it and/or
ewan@14187 5 # modify it under the terms of version 2.1 of the GNU Lesser General Public
ewan@14187 6 # License as published by the Free Software Foundation.
ewan@14187 7 #
ewan@14187 8 # This library is distributed in the hope that it will be useful,
ewan@14187 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
ewan@14187 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
ewan@14187 11 # Lesser General Public License for more details.
ewan@14187 12 #
ewan@14187 13 # You should have received a copy of the GNU Lesser General Public
ewan@14187 14 # License along with this library; if not, write to the Free Software
ewan@14187 15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
ewan@14187 16 #============================================================================
ewan@14187 17 # Copyright (c) 2007 XenSource Inc.
ewan@14187 18 #============================================================================
ewan@14187 19
ewan@14187 20
ewan@14187 21 import commands
ewan@14187 22 import os.path
ewan@14187 23 import pprint
ewan@14187 24 import sys
ewan@14187 25
ewan@14187 26 import xen.xend.sxp as sxp
ewan@14187 27
ewan@14187 28 def main():
ewan@14187 29 if len(sys.argv) == 1 or sys.argv[1] in ['', '-']:
ewan@14187 30 s = sxp.parse(sys.stdin)
ewan@14187 31 else:
ewan@14187 32 s = sxp.parse(open(sys.argv[1]))
ewan@14187 33
ewan@14187 34 pprint.pprint(s)
ewan@14187 35
ewan@14187 36 if __name__ == '__main__':
ewan@14187 37 sys.exit(main())