jsonify and random seed
parent
02dce9fa67
commit
5c5f09fc3d
|
|
@ -3,6 +3,7 @@ import time
|
||||||
|
|
||||||
class Bucket:
|
class Bucket:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
random.seed(time.time())
|
||||||
self.name = Bucket.ms_to_bucket(Bucket.now_ms())
|
self.name = Bucket.ms_to_bucket(Bucket.now_ms())
|
||||||
self.content = []
|
self.content = []
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import time
|
import time
|
||||||
|
import json
|
||||||
|
|
||||||
class Writer:
|
class Writer:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
@ -17,7 +18,7 @@ class Line:
|
||||||
self.v = v
|
self.v = v
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'@{self.t} | {self.v}'
|
return json.dumps({"t":self.t, "v": self.v})
|
||||||
|
|
||||||
def choose(a, b):
|
def choose(a, b):
|
||||||
if not a:
|
if not a:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue