Commit e26524df authored by Kirill Smelkov's avatar Kirill Smelkov

X wcfs, lib/zodb: DemoStorage support

parent e3aef24b
# -*- coding: utf-8 -*-
# Wendelin.bigfile | common ZODB-related helpers
# Copyright (C) 2014-2021 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
......@@ -21,6 +22,7 @@
import ZODB
from ZODB.FileStorage import FileStorage
from ZODB.DemoStorage import DemoStorage
from ZODB import DB
from ZODB import POSException
from ZODB.utils import p64, u64
......@@ -306,6 +308,10 @@ def zstor_2zurl(zstor):
if isinstance(zstor, FileStorage):
return "file://%s" % (zstor._file_name,)
if isinstance(zstor, DemoStorage):
# demo:(base_zurl)/(δ_zurl)
return "demo:(%s)/(%s)" % (zstor_2zurl(zstor.base), zstor_2zurl(zstor.changes))
ztype = type(zstor).__module__ + "." + type(zstor).__name__
# ZEO
......
......@@ -10,7 +10,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.0
lab.nexedi.com/kirr/go123 v0.0.0-20210302025843-863c4602a230
lab.nexedi.com/kirr/neo/go v0.0.0-20210322184934-2888bbbcbe4b
lab.nexedi.com/kirr/neo/go v0.0.0-20210326102715-dc35035cdc18
)
// we use kirr/go-fuse@y/nodefs-cancel
......
......@@ -189,3 +189,5 @@ lab.nexedi.com/kirr/go123 v0.0.0-20210302025843-863c4602a230 h1:Ca6y0vXtxL2ncrg6
lab.nexedi.com/kirr/go123 v0.0.0-20210302025843-863c4602a230/go.mod h1:pwDpdCuvtz0QxisDzV/z9eUb9zc/rMQec520h4i8VWQ=
lab.nexedi.com/kirr/neo/go v0.0.0-20210322184934-2888bbbcbe4b h1:JmC5mk3Mts39k6llztsx28tSAOarUoghcpCgNleBGro=
lab.nexedi.com/kirr/neo/go v0.0.0-20210322184934-2888bbbcbe4b/go.mod h1:llI3hcJJMACe+rYuXUfS5dljjwIrlBMfJ1ZeRcey96A=
lab.nexedi.com/kirr/neo/go v0.0.0-20210326102715-dc35035cdc18 h1:ysqIq6WqSMhCPbSRt3RnI1geV+chVkneXV7Wxn9zsEc=
lab.nexedi.com/kirr/neo/go v0.0.0-20210326102715-dc35035cdc18/go.mod h1:llI3hcJJMACe+rYuXUfS5dljjwIrlBMfJ1ZeRcey96A=
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