Created
January 8, 2015 20:33
-
-
Save cgwalters/ea5723e06ecfda3ecc32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run like this: $ python ~/tmp/foo.py '(a(s(taya{sv}))a{sv})' /srv/rhel-atomic-host/repo/summary | |
#!/usr/bin/env python | |
import os,sys | |
from gi.repository import GLib | |
typestr = GLib.VariantType.new(sys.argv[1]) | |
data = open(sys.argv[2]).read() | |
bytedata = GLib.Bytes.new(data) | |
d = GLib.Variant.new_from_bytes(typestr, bytedata, False) | |
print d | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment