tm20 utf-8 [ready for rene]
This commit is contained in:
parent
1fa1146df5
commit
21f709c707
@ -5,7 +5,7 @@ EXP = "selection/"
|
|||||||
sel = os.path.join(EXP, "tm-selection.js")
|
sel = os.path.join(EXP, "tm-selection.js")
|
||||||
sel_dump = os.path.join(EXP, "tm-selection-dump.js")
|
sel_dump = os.path.join(EXP, "tm-selection-dump.js")
|
||||||
|
|
||||||
with open(sel) as f:
|
with open(sel, encoding='utf-8') as f:
|
||||||
d = json.load(f)
|
d = json.load(f)
|
||||||
|
|
||||||
def lists():
|
def lists():
|
||||||
@ -28,7 +28,7 @@ def find(li, url):
|
|||||||
dir_files = [f for f in glob.glob(os.path.join(d, "*.json"))]
|
dir_files = [f for f in glob.glob(os.path.join(d, "*.json"))]
|
||||||
|
|
||||||
for f in dir_files:
|
for f in dir_files:
|
||||||
with open(f) as fp:
|
with open(f, encoding='utf-8') as fp:
|
||||||
dj = json.load(fp)
|
dj = json.load(fp)
|
||||||
for t in dj['threads']:
|
for t in dj['threads']:
|
||||||
if t['url'] == url: # one level..... not recursive
|
if t['url'] == url: # one level..... not recursive
|
||||||
@ -67,7 +67,7 @@ def commit_dump(li, url, tag):
|
|||||||
m = find(li, url) # <--- time
|
m = find(li, url) # <--- time
|
||||||
if m is not None:
|
if m is not None:
|
||||||
|
|
||||||
with open(sel_dump) as f:
|
with open(sel_dump, encoding='utf-8') as f:
|
||||||
dump = json.load(f)
|
dump = json.load(f)
|
||||||
|
|
||||||
if tag not in list(dump.keys()):
|
if tag not in list(dump.keys()):
|
||||||
@ -87,7 +87,7 @@ def commit_dump(li, url, tag):
|
|||||||
def commit_from_selection():
|
def commit_from_selection():
|
||||||
|
|
||||||
dump = {}
|
dump = {}
|
||||||
with open(sel) as f:
|
with open(sel, encoding='utf-8') as f:
|
||||||
d = json.load(f)
|
d = json.load(f)
|
||||||
|
|
||||||
for k, v in d.items():
|
for k, v in d.items():
|
||||||
@ -132,7 +132,7 @@ def recursive_format(msg):
|
|||||||
|
|
||||||
def format_selection():
|
def format_selection():
|
||||||
|
|
||||||
with open(sel_dump) as f:
|
with open(sel_dump, encoding='utf-8') as f:
|
||||||
d = json.load(f)
|
d = json.load(f)
|
||||||
|
|
||||||
for k, v in d.items():
|
for k, v in d.items():
|
||||||
@ -148,7 +148,7 @@ def recursive_hashmap(msg, tag, hm):
|
|||||||
recursive_hashmap(i, tag, hm)
|
recursive_hashmap(i, tag, hm)
|
||||||
|
|
||||||
def hashmap():
|
def hashmap():
|
||||||
with open(sel_dump) as f:
|
with open(sel_dump, encoding='utf-8') as f:
|
||||||
d = json.load(f)
|
d = json.load(f)
|
||||||
hm = {}
|
hm = {}
|
||||||
for k, v in d.items():
|
for k, v in d.items():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user