pkl2php is a script that reads in a python pickle file and spits out the
[monitor.git] / pkl2php.py
1 #!/usr/bin/python
2
3 import soltesz
4 from config import config
5 from optparse import OptionParser
6 parser = OptionParser()
7 parser.set_defaults(filename=None)
8 parser.add_option("-f", "--dbname", dest="dbname", metavar="FILE", 
9                                         help="Provide the input file to convert")
10 config = config(parser)
11 config.parse_args()
12
13 if config.dbname is None:
14         print "please provide a pickle file to convert"
15         import sys
16         sys.exit(1)
17
18 data = soltesz.dbLoad(config.dbname)
19 soltesz.dbDump(config.dbname, data, 'php')