Back to looking at raw binary
This commit is contained in:
parent
d4be446cf5
commit
ef8fc4237e
@ -4,8 +4,8 @@ import tables
|
||||
|
||||
|
||||
class KeyValue(tables.IsDescription):
|
||||
key = tables.StringCol(itemsize=22, dflt=" ", pos=0)
|
||||
value = tables.StringCol(itemsize=22, dflt=" ", pos=0)
|
||||
key = tables.StringCol(itemsize=250, dflt=" ", pos=0)
|
||||
value = tables.VLStringAtom() # StringCol(itemsize=22, dflt=" ", pos=0)
|
||||
|
||||
|
||||
def make_notification():
|
||||
@ -23,7 +23,9 @@ fileh = tables.open_file("storeage.h5", mode = "w")
|
||||
root = fileh.root
|
||||
|
||||
notifications = fileh.create_group(root, "notifications")
|
||||
notification = fileh.create_table(notifications, "notification", KeyValue)
|
||||
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
|
||||
|
||||
|
@ -14,24 +14,33 @@
|
||||
# limitations under the License.
|
||||
|
||||
import datetime
|
||||
import struct
|
||||
|
||||
"""Binary data archiving library.
|
||||
|
||||
Data is written in the following format:
|
||||
|
||||
[HEADER]
|
||||
[PAYLOAD]
|
||||
[FOOTER]
|
||||
[ENTRY] =
|
||||
<START-OF-BLOCK> byte # 0x05
|
||||
<BLOCK-TYPE> long # new versions get new block-types
|
||||
<CRC> ulong
|
||||
<SIZE> long
|
||||
|
||||
where:
|
||||
[HEADER] =
|
||||
[START-OF-BLOCK]
|
||||
[BLOCK-TYPE]
|
||||
[SIZE]
|
||||
[PAYLOAD] =
|
||||
<START-OF-PAYLOAD> byte # 0x06
|
||||
<RECORD_COUNT> int
|
||||
[RECORD, RECORD, ...]
|
||||
|
||||
[FOOTER] =
|
||||
[CRC]
|
||||
[END-OF-BLOCK]
|
||||
[RECORD] =
|
||||
<SIZE> long
|
||||
<KEY> varstr (%s)
|
||||
<TYPE> int
|
||||
<UNION>
|
||||
<BOOLEAN>
|
||||
<INT>
|
||||
<FLOAT>
|
||||
<DATETIME>
|
||||
<STRING>
|
||||
|
||||
There are ArchiveReaders and ArchiveWriters which are managed
|
||||
by RollManager. The RollManager opens and closes Archivers as
|
||||
@ -162,6 +171,7 @@ class ArchiveWriter(Archive):
|
||||
self._handle = open(filename, "wb+")
|
||||
|
||||
def write(self, payload):
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user