From 5667c5e2c8d8ac112023de76eaa96318cda7e8f5 Mon Sep 17 00:00:00 2001 From: kirbylife Date: Tue, 8 Dec 2020 21:03:13 -0600 Subject: [PATCH] minor bugs fixed and ignore the files .tmp --- client.py | 7 +++++-- dir_to_json.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client.py b/client.py index 490a8c2..82c3b4f 100755 --- a/client.py +++ b/client.py @@ -6,6 +6,7 @@ import json import os import pathlib import sys +import shutil from copy import deepcopy from datetime import datetime from random import randint @@ -84,7 +85,7 @@ class MunyalClient(Icon): # name="listener", # daemon=True) thread_uploader.start() - thread_downloader.start() + # thread_downloader.start() # thread_listener.start() self.run(self.__run) @@ -123,6 +124,7 @@ class MunyalClient(Icon): if data["name"] in self.ignored: self.ignored.remove(data["name"]) self.stack.pop(0) + continue if data["is_file"] and data["action"] == "add": full_path = os.path.join(folder, data["name"]) data["file"] = base64.b85encode( @@ -170,7 +172,8 @@ class MunyalClient(Icon): pass def downloader(self, data): - self.ignored.append(data["name"]) + name = data["name"] + self.ignored.append(name) full_path = os.path.join(self.config["folder"], name) if data["is_file"]: if data["action"] == "add": diff --git a/dir_to_json.py b/dir_to_json.py index 41cf6fd..b50e7a0 100644 --- a/dir_to_json.py +++ b/dir_to_json.py @@ -22,7 +22,7 @@ def get_json(path): items = os.listdir(path) try: for item in items: - if item[0] != ".": + if item[0] != "." and not item.endswith("tmp"): item_json = {"name": item} route = os.path.join(path, item) if os.path.isdir(route):