From 582fe9dcdb6e7057e5e8e1f1aa729772fe25a321 Mon Sep 17 00:00:00 2001 From: Stephen Soltesz Date: Fri, 2 Nov 2007 16:34:28 +0000 Subject: [PATCH] pkl2php is a script that reads in a python pickle file and spits out the equivalent as a php serialize file, for data sharing between python and php. --- pkl2php.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 pkl2php.py diff --git a/pkl2php.py b/pkl2php.py new file mode 100755 index 0000000..9602525 --- /dev/null +++ b/pkl2php.py @@ -0,0 +1,19 @@ +#!/usr/bin/python + +import soltesz +from config import config +from optparse import OptionParser +parser = OptionParser() +parser.set_defaults(filename=None) +parser.add_option("-f", "--dbname", dest="dbname", metavar="FILE", + help="Provide the input file to convert") +config = config(parser) +config.parse_args() + +if config.dbname is None: + print "please provide a pickle file to convert" + import sys + sys.exit(1) + +data = soltesz.dbLoad(config.dbname) +soltesz.dbDump(config.dbname, data, 'php') -- 2.47.0