add argument to enable to create a bucket

also fo t.py
This commit is contained in:
2025-05-21 09:59:12 +02:00
parent dd571fc3ea
commit 7225dcbe19
2 changed files with 4 additions and 4 deletions

View File

@ -21,10 +21,10 @@ Usage:
""" """
def main(dbname=None): def main(dbname=None, access='write'):
# egen = EventStream(ScanReply(), ScanStream(), n=NicosStream('localhost:14002')) # egen = EventStream(ScanReply(), ScanStream(), n=NicosStream('localhost:14002'))
egen = EventStream(ScanReply(), ScanStream()) egen = EventStream(ScanReply(), ScanStream())
db = SEHistory(dbname, access='write') db = SEHistory(dbname, access=access)
db.enable_write_access() db.enable_write_access()
host = socket.gethostname().split('.')[0] host = socket.gethostname().split('.')[0]

4
t.py
View File

@ -12,7 +12,7 @@ ETERNITY = 1e10
# token = "zqDbTcMv9UizfdTj15Fx_6vBetkM5mXN56EE9CiDaFsh7O2FFWZ2X4VwAAmdyqZr3HbpIr5ixRju07-oQmxpXw==" # token = "zqDbTcMv9UizfdTj15Fx_6vBetkM5mXN56EE9CiDaFsh7O2FFWZ2X4VwAAmdyqZr3HbpIr5ixRju07-oQmxpXw=="
db = SEHistory(access='write') db = SEHistory(*sys.argv[1:]) # arguments: database, access
print(""" print("""
qry([start], [stop], [interval=...,] [last=True,] [columns=[...],] [<tag>=<value>, ] ...) qry([start], [stop], [interval=...,] [last=True,] [columns=[...],] [<tag>=<value>, ] ...)
@ -24,7 +24,7 @@ now = int(time.time())
result = {} result = {}
def prt(maxpoints=7, maxcurves=7): def prt(maxpoints=7, maxcurves=50):
for i, (key, curve) in enumerate(result.items()): for i, (key, curve) in enumerate(result.items()):
if i > maxcurves: if i > maxcurves:
print('--- ...') print('--- ...')