Commit 362dbf6e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent aee82981
...@@ -61,6 +61,7 @@ from zodbtools.util import ashex as h, fromhex ...@@ -61,6 +61,7 @@ from zodbtools.util import ashex as h, fromhex
from .internal import mm from .internal import mm
from .internal._wcfs import \ from .internal._wcfs import \
PyWCFS as _WCFS, \
PyWatchLink as WatchLink, \ PyWatchLink as WatchLink, \
PyPinReq as PinReq \ PyPinReq as PinReq \
...@@ -78,7 +79,7 @@ from six import reraise ...@@ -78,7 +79,7 @@ from six import reraise
# Raw files on wcfs can be accessed with ._path/._read/._stat/._open . # Raw files on wcfs can be accessed with ._path/._read/._stat/._open .
# #
# WCFS logically mirrors ZODB.DB . # WCFS logically mirrors ZODB.DB .
class WCFS(object): class WCFS(_WCFS):
# .mountpoint path to wcfs mountpoint # .mountpoint path to wcfs mountpoint
# ._fwcfs /.wcfs/zurl opened to keep the server from going away (at least cleanly) # ._fwcfs /.wcfs/zurl opened to keep the server from going away (at least cleanly)
# ._njoin this connection was returned for so many joins # ._njoin this connection was returned for so many joins
......
...@@ -46,21 +46,28 @@ ctypedef WatchLink *pWatchLink # https://github.com/cython/cython/issues/534 ...@@ -46,21 +46,28 @@ ctypedef WatchLink *pWatchLink # https://github.com/cython/cython/issues/534
cdef extern from "wcfs.h" nogil: cdef extern from "wcfs.h" nogil:
cppclass WCFS: cppclass WCFS:
string mountpoint
pair[pWatchLink, error] _openwatch() # XXX pair instead of tuple pair[pWatchLink, error] _openwatch() # XXX pair instead of tuple
from golang cimport topyexc from golang cimport topyexc
cdef class PyWCFS: cdef class PyWCFS:
cdef WCFS *wc cdef WCFS wc
property mountpoint:
def __get__(PyWCFS pywc):
return pywc.wc.mountpoint
def __set__(PyWCFS pywc, string v):
pywc.wc.mountpoint = v
cdef class PyWatchLink: cdef class PyWatchLink:
cdef WatchLink *wlink cdef WatchLink *wlink
def __init__(PyWatchLink pywlink, PyWCFS pywc): def __init__(PyWatchLink pywlink, PyWCFS pywc):
with nogil: with nogil:
_ = wcfs_openwatch_pyexc(pywc.wc) _ = wcfs_openwatch_pyexc(&pywc.wc)
pywlink.wlink = _.first pywlink.wlink = _.first
err = _.second err = _.second
......
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