Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
94e71512
Commit
94e71512
authored
Jul 27, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
1cdfff35
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
go/zodb/connection.go
go/zodb/connection.go
+3
-3
go/zodb/zodbpy.go
go/zodb/zodbpy.go
+5
-4
No files found.
go/zodb/connection.go
View file @
94e71512
...
@@ -23,7 +23,7 @@ import (
...
@@ -23,7 +23,7 @@ import (
"lab.nexedi.com/kirr/neo/go/zodb/internal/weak"
"lab.nexedi.com/kirr/neo/go/zodb/internal/weak"
)
)
// Connection represents a view of ZODB database.
// Connection represents a view of ZODB database.
XXX + live application objects.
//
//
// The view is representing state of ZODB objects as of `at` transaction.
// The view is representing state of ZODB objects as of `at` transaction.
//
//
...
@@ -245,12 +245,12 @@ func (conn *Connection) Get(ctx context.Context, oid Oid) (IPersistent, error) {
...
@@ -245,12 +245,12 @@ func (conn *Connection) Get(ctx context.Context, oid Oid) (IPersistent, error) {
// object is not there in objtab - raw load it, get its class -> get(pyclass, oid)
// object is not there in objtab - raw load it, get its class -> get(pyclass, oid)
// XXX py hardcoded
// XXX py hardcoded
py
class
,
pystate
,
serial
,
err
:=
conn
.
loadpy
(
ctx
,
oid
)
class
,
pystate
,
serial
,
err
:=
conn
.
loadpy
(
ctx
,
oid
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
// XXX errctx
return
nil
,
err
// XXX errctx
}
}
obj
,
err
:=
conn
.
get
(
pyclass
.
Module
+
"."
+
pyclass
.
Name
,
oid
)
obj
,
err
:=
conn
.
get
(
class
,
oid
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
go/zodb/zodbpy.go
View file @
94e71512
...
@@ -148,18 +148,19 @@ func (d *dummyPyInstance) PySetState(pystate interface{}) error {
...
@@ -148,18 +148,19 @@ func (d *dummyPyInstance) PySetState(pystate interface{}) error {
//
//
// loadpy does not create any in-RAM object associated with Connection.
// loadpy does not create any in-RAM object associated with Connection.
// It only returns decoded database data.
// It only returns decoded database data.
func
(
conn
*
Connection
)
loadpy
(
ctx
context
.
Context
,
oid
Oid
)
(
pyclass
pickle
.
Class
,
pystate
interface
{},
serial
Tid
,
_
error
)
{
func
(
conn
*
Connection
)
loadpy
(
ctx
context
.
Context
,
oid
Oid
)
(
class
string
,
pystate
interface
{},
serial
Tid
,
_
error
)
{
buf
,
serial
,
err
:=
conn
.
stor
.
Load
(
ctx
,
Xid
{
Oid
:
oid
,
At
:
conn
.
at
})
buf
,
serial
,
err
:=
conn
.
stor
.
Load
(
ctx
,
Xid
{
Oid
:
oid
,
At
:
conn
.
at
})
if
err
!=
nil
{
if
err
!=
nil
{
return
pickle
.
Class
{}
,
nil
,
0
,
err
return
""
,
nil
,
0
,
err
}
}
defer
buf
.
Release
()
defer
buf
.
Release
()
pyclass
,
pystate
,
err
=
PyData
(
buf
.
Data
)
.
Decode
()
pyclass
,
pystate
,
err
=
PyData
(
buf
.
Data
)
.
Decode
()
if
err
!=
nil
{
if
err
!=
nil
{
return
pickle
.
Class
{}
,
nil
,
0
,
err
// XXX err ctx
return
""
,
nil
,
0
,
err
// XXX err ctx
}
}
return
pyclass
,
pystate
,
serial
,
nil
class
:=
pyclass
.
Module
+
"."
+
pyclass
.
Name
// full pyclass path
return
class
,
pystate
,
serial
,
nil
}
}
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