diff options
author | Rob Austein <sra@hactrn.net> | 2016-04-27 22:28:36 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-04-27 22:28:36 +0000 |
commit | bdc3a6ef48a3ebbd44b4f51d274a21b24aac8eb9 (patch) | |
tree | 65024e21ccc4e6186a47e0a8404e6adadd08c579 /potpourri/ca-unpickle.py | |
parent | bf96f5f690cb418ed00f77a32f692015b03a4969 (diff) | |
parent | 319916e90e1b1f6328effbc7cd9acf74c38c1842 (diff) |
Pull ca-{pickle,unpickle}.py from trunk/.
svn path=/branches/tk705/; revision=6396
Diffstat (limited to 'potpourri/ca-unpickle.py')
-rwxr-xr-x | potpourri/ca-unpickle.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/potpourri/ca-unpickle.py b/potpourri/ca-unpickle.py new file mode 100755 index 00000000..dbbe3e8a --- /dev/null +++ b/potpourri/ca-unpickle.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# $Id$ + +""" +Unpickle CA state packaged by ca-pickle. + +This version is a stub, and exists only to test ca-pickle. +""" + +import sys +import cPickle +import argparse +import subprocess + +parser = argparse.ArgumentParser(description = __doc__) +parser.add_argument("input", help = "input file") +args = parser.parse_args() + +xzcat = subprocess.Popen(("xzcat", args.input), stdout = subprocess.PIPE) +world = cPickle.load(xzcat.stdout) +if xzcat.wait() != 0: + sys.exit("XZ unpickling failed with code {}".format(xz.returncode)) + +print "import datetime" +print "world =", repr(world) |