Index: trunk/utils/flowmon-pklviewer.py =================================================================== --- trunk/utils/flowmon-pklviewer.py (revision 3) +++ trunk/utils/flowmon-pklviewer.py (revision 3) @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# Copyright (C) 2008 Andreas Thienemann +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as published by +# the Free Software Foundation; version 2 only +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +import optparse +import os +import sys +import pprint +import pickle +import IPy +import traceback + +def main(): + global db, cursor + # CLI Options + usage = "usage: %prog [options] " + parser = optparse.OptionParser(usage) + parser.add_option("-d", "--loglevel=debug", + action="store_const", const="DEBUG", dest="loglevel", + help="DEBUG loglevel", default="INFO") + (options, args) = parser.parse_args() + + if args == []: + print "Filename is needed" + sys.exit(1) + + # Unpickle the file and display it nicely. + try: + data_file = open(args[0], 'rb') + data = pickle.load(data_file) + data_file.close() + except: + trace = traceback.format_exc() + print trace + sys.exit(1) + + pprint.pprint(data) + + +if __name__ == "__main__": + main() + +