Skip to content

Commit

Permalink
added helpers to unpack and package
Browse files Browse the repository at this point in the history
  • Loading branch information
nedjitef committed May 11, 2021
1 parent 82e68ea commit bd80d19
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bin/mkp-pack
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python3

from sys import argv
import mkp
import ast

# read info file
f_info = open("info", "r")
info = ast.literal_eval(f_info.read())
f_info.close()

mkp.pack_to_file(info, '.', "%s-%s.mkp" % (info['name'], info['version']))

17 changes: 17 additions & 0 deletions bin/mkp-unpack
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python3

from sys import argv
import mkp
import pprint

package = mkp.load_file(argv[1])
pp = pprint.PrettyPrinter(indent=2)
#print(package.info)
package.extract_files('.')

# write info file
f_info = open("info", "w")
pprint.pprint(package.info, stream=f_info)
#f_info.write(pprint.saferepr(package.info))
f_info.close()

0 comments on commit bd80d19

Please sign in to comment.