Commit fa8e3fdf authored by Florestan Biaux's avatar Florestan Biaux 💬
Browse files

optimisation getter

parent f2491e94
......@@ -20,7 +20,7 @@ def getfile(name):
path = os.getcwd() + "/messages/inbox/"
os.chdir(path)
oslist = os.listdir()
r = re.compile(name)
r = re.compile(getname(name))
conv = list(filter(r.match, oslist))
conv = conv.__getitem__(0)
os.chdir(path + "/" + conv)
......@@ -29,3 +29,4 @@ def getfile(name):
data_str = json.dumps(data)
print(data_str)
os.chdir(originpath)
......@@ -6,5 +6,4 @@ if __name__ == "__main__":
# demander le nom de la conv à analyser
name = str(input("Quel est le nom de la conversation à analyser ?"))
# give regex of conversation name
conv = get.getname(name)
get.getfile(conv)
get.getfile(name)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment