- change : 去掉了对 shelve 的使用,同时不再依赖于 bsddb。此时没有bsddb的Python3,应该可以使用。
This commit is contained in:
parent
45d4301110
commit
1e1ca13655
@ -1,6 +1,6 @@
|
|||||||
# encoding: UTF-8
|
# encoding: UTF-8
|
||||||
|
|
||||||
import shelve
|
# import shelve
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@ -311,19 +311,21 @@ class DataEngine(object):
|
|||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
def saveContracts(self):
|
def saveContracts(self):
|
||||||
"""保存所有合约对象到硬盘"""
|
"""保存所有合约对象到硬盘"""
|
||||||
f = shelve.open(self.contractFileName)
|
pass
|
||||||
f['data'] = self.contractDict
|
# f = shelve.open(self.contractFileName)
|
||||||
f.close()
|
# f['data'] = self.contractDict
|
||||||
|
# f.close()
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
def loadContracts(self):
|
def loadContracts(self):
|
||||||
"""从硬盘读取合约对象"""
|
"""从硬盘读取合约对象"""
|
||||||
f = shelve.open(self.contractFileName)
|
pass
|
||||||
if 'data' in f:
|
# f = shelve.open(self.contractFileName)
|
||||||
d = f['data']
|
# if 'data' in f:
|
||||||
for key, value in d.items():
|
# d = f['data']
|
||||||
self.contractDict[key] = value
|
# for key, value in d.items():
|
||||||
f.close()
|
# self.contractDict[key] = value
|
||||||
|
# f.close()
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
def updateOrder(self, event):
|
def updateOrder(self, event):
|
||||||
|
Loading…
Reference in New Issue
Block a user