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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
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
Hide 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 {
pyobj
:=
&
pyObject
{
object
:
object
{
jar
:
conn
,
oid
:
oid
,
serial
:
0
},
pyclass
:
pyclass
,
//instance: nil,
}
// switch on pyclass and transform e.g. "zodb.BTree.Bucket" -> *ZBucket
classNew
:=
classTab
[
pyclass
.
Module
+
"."
+
pyclass
.
Name
]
if
classNew
==
nil
{
return
pyobj
// XXX or return error here?
var
instance
PyObject
if
classNew
!=
nil
{
instance
=
classNew
(
pyobj
)
}
else
{
instance
=
&
dummyPyInstance
{
pyObject
:
pyobj
}
}
obj
:=
classNew
(
pyobj
)
pyobj
.
instance
=
obj
return
obj
pyobj
.
instance
=
instance
return
instance
}
// 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