Commit 2848c632 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6ba3593d
...@@ -39,7 +39,7 @@ import ( ...@@ -39,7 +39,7 @@ import (
// ZBigFile mimics ZBigFile from python. // ZBigFile mimics ZBigFile from python.
type ZBigFile struct { type ZBigFile struct {
pyobj *pyObject *pyObject
blksize int64 blksize int64
blktab *ZBTree // LOBtree{} blk -> ZBlk*(blkdata) blktab *ZBTree // LOBtree{} blk -> ZBlk*(blkdata)
...@@ -101,7 +101,7 @@ func (bf *ZBigFile) PDeactivate() { ...@@ -101,7 +101,7 @@ func (bf *ZBigFile) PDeactivate() {
bf.blksize = -1 bf.blksize = -1
bf.blktab = nil bf.blktab = nil
bf.pyobj.PDeactivate() bf.pyObject.PDeactivate()
} }
...@@ -111,7 +111,7 @@ func (bf *ZBigFile) PActivate(ctx context.Context) (err error) { ...@@ -111,7 +111,7 @@ func (bf *ZBigFile) PActivate(ctx context.Context) (err error) {
return nil return nil
} }
err = bf.pyobj.PActivate(ctx) err = bf.pyObject.PActivate(ctx)
if err != nil { if err != nil {
return err return err
} }
...@@ -123,7 +123,7 @@ func (bf *ZBigFile) PActivate(ctx context.Context) (err error) { ...@@ -123,7 +123,7 @@ func (bf *ZBigFile) PActivate(ctx context.Context) (err error) {
}() }()
// decode pystate // decode pystate
t, ok := bf.pyobj.pystate.(pickle.Tuple) t, ok := bf.pyObject.pystate.(pickle.Tuple)
if !ok || len(t) != 2 { if !ok || len(t) != 2 {
// XXX expected (.blksize, blktab) // XXX expected (.blksize, blktab)
} }
...@@ -160,3 +160,13 @@ func (bf *ZBigFile) PActivate(ctx context.Context) (err error) { ...@@ -160,3 +160,13 @@ func (bf *ZBigFile) PActivate(ctx context.Context) (err error) {
} }
*/ */
// ----------------------------------------
func zbigfileNew(pyobj *pyObject) PyObject {
return &ZBigFile{pyObject: pyobj}
}
func init() {
registerClass(zwendelin + ".ZBigFile", zbigfileNew)
}
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