Commit e9a36412 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent badb3fee
......@@ -30,9 +30,12 @@ from golang import func, defer
# XXX
# XXX +packtime
def zodbpack(stor):
def zodbpack(stor, gc):
t = time.time()
stor.pack(t, ZODB.serialize.referencesf)
kw = {}
if gc is not None:
kw['gc'] = gc
stor.pack(t, ZODB.serialize.referencesf, **kw)
# ----------------------------------------
......@@ -51,11 +54,14 @@ XXX
Options:
--gc perform garbage-collection as well
-h --help show this help
""", file=out)
@func
def main(argv):
gc = False
try:
optv, argv = getopt.getopt(argv[1:], "h", ["help"])
except getopt.GetoptError as e:
......@@ -67,6 +73,8 @@ def main(argv):
if opt in ("-h", "--help"):
usage(sys.stdout)
sys.exit(0)
if opt in ("--gc"):
gc = True
try:
storurl = argv[0]
......@@ -77,4 +85,4 @@ def main(argv):
stor = storageFromURL(storurl)
defer(stor.close)
zodbpack(stor)
zodbpack(stor, gc)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment