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
9605b703
Commit
9605b703
authored
Jul 17, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a65f9492
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
wcfs/zodb.go
wcfs/zodb.go
+21
-6
No files found.
wcfs/zodb.go
View file @
9605b703
...
@@ -359,20 +359,35 @@ func (conn *Connection) newGhost(pyclass pickle.Class, oid zodb.Oid) PyObject {
...
@@ -359,20 +359,35 @@ func (conn *Connection) newGhost(pyclass pickle.Class, oid zodb.Oid) PyObject {
pyobj
:=
&
pyObject
{
pyobj
:=
&
pyObject
{
object
:
object
{
jar
:
conn
,
oid
:
oid
,
serial
:
0
},
object
:
object
{
jar
:
conn
,
oid
:
oid
,
serial
:
0
},
pyclass
:
pyclass
,
pyclass
:
pyclass
,
//instance: nil,
}
}
// switch on pyclass and transform e.g. "zodb.BTree.Bucket" -> *ZBucket
// switch on pyclass and transform e.g. "zodb.BTree.Bucket" -> *ZBucket
classNew
:=
classTab
[
pyclass
.
Module
+
"."
+
pyclass
.
Name
]
classNew
:=
classTab
[
pyclass
.
Module
+
"."
+
pyclass
.
Name
]
if
classNew
==
nil
{
var
instance
PyObject
return
pyobj
// XXX or return error here?
if
classNew
!=
nil
{
instance
=
classNew
(
pyobj
)
}
else
{
instance
=
&
dummyPyInstance
{
pyObject
:
pyobj
}
}
}
obj
:=
classNew
(
pyobj
)
pyobj
.
instance
=
instance
pyobj
.
instance
=
obj
return
instance
return
obj
}
// dummyPyInstance is used for python classes that were not registered.
type
dummyPyInstance
struct
{
*
pyObject
pystate
interface
{}
}
}
func
(
d
*
dummyPyInstance
)
DropState
()
{
d
.
pystate
=
nil
}
func
(
d
*
dummyPyInstance
)
PySetState
(
pystate
interface
{})
error
{
d
.
pystate
=
pystate
return
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