Skip to content

Commit

Permalink
A couple of scripts for working with git objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
hcayless committed Sep 18, 2013
1 parent c3e82d8 commit f41ff74
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pn-scripts/deflate
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/python

import sys
import zlib

def main():
input = sys.argv[1]
output = sys.argv[2]
fin = open(input, "rb")
data = fin.read()
zipped = zlib.compress(data, 1)
fin.close()
fout = open (output, "wb")
fout.write(zipped)
fout.close()

if __name__ == "__main__":
sys.exit(main())
18 changes: 18 additions & 0 deletions pn-scripts/inflate
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/python

import sys
import zlib

def main():
input = sys.argv[1]
output = sys.argv[2]
file = open(input, "rb")
data = file.read()
file.close()
unzipped = zlib.decompress(data)
fout = open(output, "wb")
fout.write(unzipped)
fout.close()

if __name__ == "__main__":
sys.exit(main())

0 comments on commit f41ff74

Please sign in to comment.