Dolda2000 GitWeb
/
didex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e38ebde
)
Added a t_bool type.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 20 Mar 2018 22:47:49 +0000
(23:47 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 20 Mar 2018 22:47:49 +0000
(23:47 +0100)
didex/index.py
patch
|
blob
|
blame
|
history
diff --git
a/didex/index.py
b/didex/index.py
index
5b5a5bc
..
ff291b2
100644
(file)
--- a/
didex/index.py
+++ b/
didex/index.py
@@
-2,7
+2,7
@@
import struct, contextlib, math
from . import db, lib
from .db import bd, txnfun, dloopfun
from . import db, lib
from .db import bd, txnfun, dloopfun
-__all__ = ["maybe", "t_int", "t_uint", "t_dbid", "t_float", "t_str", "t_casestr", "ordered"]
+__all__ = ["maybe", "t_
bool", "t_
int", "t_uint", "t_dbid", "t_float", "t_str", "t_casestr", "ordered"]
deadlock = bd.DBLockDeadlockError
notfound = bd.DBNotFoundError
deadlock = bd.DBLockDeadlockError
notfound = bd.DBNotFoundError
@@
-140,6
+140,7
@@
def floatcmp(a, b):
else:
return 0
else:
return 0
+t_bool = simpletype((lambda ob: b"\x01" if ob else b"\x00"), (lambda dat: False if dat == b"x\00" else True))
t_int = simpletype.struct(">q")
t_uint = simpletype.struct(">Q")
t_dbid = t_uint
t_int = simpletype.struct(">q")
t_uint = simpletype.struct(">Q")
t_dbid = t_uint