remove pytables and look at bson

This commit is contained in:
Sandy Walsh 2014-05-12 00:57:06 +00:00
parent ef8fc4237e
commit 9c6dc549e0
2 changed files with 4 additions and 43 deletions

View File

@ -1,40 +0,0 @@
import random
import tables
class KeyValue(tables.IsDescription):
key = tables.StringCol(itemsize=250, dflt=" ", pos=0)
value = tables.VLStringAtom() # StringCol(itemsize=22, dflt=" ", pos=0)
def make_notification():
return [
("foo[0]", "thing"),
("foo[1]", "stuff"),
("foo[1].child", "ring"),
("foo[2].child[0]", "ding"),
("random", random.random()),
]
# open a file in "w"rite mode
fileh = tables.open_file("storeage.h5", mode = "w")
root = fileh.root
notifications = fileh.create_group(root, "notifications")
notification = fileh.create_table(notifications, "notification",
tables.StringCol(itemsize=250, dflt=" ", pos=0))
vlarray = fileh.createVLArray(notifications, 'vlarray8', tables.VLStringAtom(), "Variable Length String")
row = notification.row
for i in xrange(10):
for k, v in make_notification():
row['key'] = k
row['value'] = v
row.append()
notification.flush()
fileh.close()

View File

@ -3,8 +3,9 @@ envlist = py26,py27
[testenv]
deps =
nose
mock
coverage
nose
mock
coverage
pymongo
commands = nosetests -d --with-coverage --cover-inclusive --cover-package shoebox []