Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
769b8f4c
Commit
769b8f4c
authored
Dec 12, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
fdc76cf4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
3 deletions
+41
-3
lib/zodb.py
lib/zodb.py
+1
-0
wcfs/internal/_wcfs.pyx
wcfs/internal/_wcfs.pyx
+40
-3
No files found.
lib/zodb.py
View file @
769b8f4c
...
@@ -115,6 +115,7 @@ def _deactivate_bucket(bucket):
...
@@ -115,6 +115,7 @@ def _deactivate_bucket(bucket):
# zconn_at returns tid as of which ZODB connection is viewing the database.
# zconn_at returns tid as of which ZODB connection is viewing the database.
def
zconn_at
(
zconn
):
# -> tid
def
zconn_at
(
zconn
):
# -> tid
assert
isinstance
(
zconn
,
ZODB
.
Connection
.
Connection
)
assert
isinstance
(
zconn
,
ZODB
.
Connection
.
Connection
)
# XXX assert zconn is opened
# ZODB5 uses MVCC uniformly
# ZODB5 uses MVCC uniformly
if
zmajor
>=
5
:
if
zmajor
>=
5
:
...
...
wcfs/internal/_wcfs.pyx
View file @
769b8f4c
...
@@ -93,12 +93,23 @@ cdef extern from "wcfs.h" namespace "wcfs" nogil:
...
@@ -93,12 +93,23 @@ cdef extern from "wcfs.h" namespace "wcfs" nogil:
pair
[
Conn
,
error
]
connect
(
Tid
at
)
pair
[
Conn
,
error
]
connect
(
Tid
at
)
cppclass
_Conn
:
cppclass
_Conn
:
pair
[
FileH
,
error
]
open
(
Oid
foid
)
error
close
()
error
close
()
cppclass
Conn
(
refptr
[
_Conn
]):
cppclass
Conn
(
refptr
[
_Conn
]):
# Conn.X = Conn->X in C++
# Conn.X = Conn->X in C++
pair
[
FileH
,
error
]
open
"_ptr()->open"
(
Oid
foid
)
error
close
"_ptr()->close"
()
error
close
"_ptr()->close"
()
cppclass
_FileH
:
# XXX add mmap?
pass
cppclass
FileH
(
refptr
[
_FileH
]):
# FileH.X = FileH->X in C++
# XXX add mmap?
pass
cdef
class
PyWCFS
:
cdef
class
PyWCFS
:
cdef
WCFS
wc
cdef
WCFS
wc
...
@@ -132,12 +143,32 @@ cdef class PyConn:
...
@@ -132,12 +143,32 @@ cdef class PyConn:
def
close
(
PyConn
pywconn
):
def
close
(
PyConn
pywconn
):
with
nogil
:
with
nogil
:
err
=
pywconn
.
wconn
.
close
()
err
=
wconn_close_pyexc
(
pywconn
.
wconn
)
if
err
!=
nil
:
raise
pyerr
(
err
)
def
open
(
PyConn
pywconn
,
pyfoid
):
# -> FileH
cdef
Oid
foid
=
u64
(
pyfoid
)
with
nogil
:
_
=
wconn_open_pyexc
(
pywconn
.
wconn
,
foid
)
wfileh
=
_
.
first
err
=
_
.
second
if
err
!=
nil
:
if
err
!=
nil
:
raise
pyerr
(
err
)
raise
pyerr
(
err
)
cdef
PyFileH
pywfileh
=
PyFileH
.
__new__
(
PyFileH
)
pywfileh
.
wfileh
=
wfileh
return
pywfileh
# XXX resync
# XXX resync
cdef
class
PyFileH
:
cdef
FileH
wfileh
def
__dealloc__
(
PyFileH
pywfileh
):
pywfileh
.
wfileh
=
nil
# ----------------------------------------
cdef
class
PyWatchLink
:
cdef
class
PyWatchLink
:
cdef
WatchLink
wlink
cdef
WatchLink
wlink
...
@@ -267,6 +298,12 @@ cdef nogil:
...
@@ -267,6 +298,12 @@ cdef nogil:
pair
[
Conn
,
error
]
wcfs_connect_pyexc
(
WCFS
*
wcfs
,
Tid
at
)
except
+
topyexc
:
pair
[
Conn
,
error
]
wcfs_connect_pyexc
(
WCFS
*
wcfs
,
Tid
at
)
except
+
topyexc
:
return
wcfs
.
connect
(
at
)
return
wcfs
.
connect
(
at
)
error
wconn_close_pyexc
(
Conn
wconn
)
except
+
topyexc
:
return
wconn
.
close
()
pair
[
FileH
,
error
]
wconn_open_pyexc
(
Conn
wconn
,
Oid
foid
)
except
+
topyexc
:
return
wconn
.
open
(
foid
)
error
wlink_close_pyexc
(
WatchLink
wlink
)
except
+
topyexc
:
error
wlink_close_pyexc
(
WatchLink
wlink
)
except
+
topyexc
:
return
wlink
.
close
()
return
wlink
.
close
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment