minor bugs fixed and ignore the files .tmp
parent
9d83b9582c
commit
5667c5e2c8
|
@ -6,6 +6,7 @@ import json
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import sys
|
import sys
|
||||||
|
import shutil
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from random import randint
|
from random import randint
|
||||||
|
@ -84,7 +85,7 @@ class MunyalClient(Icon):
|
||||||
# name="listener",
|
# name="listener",
|
||||||
# daemon=True)
|
# daemon=True)
|
||||||
thread_uploader.start()
|
thread_uploader.start()
|
||||||
thread_downloader.start()
|
# thread_downloader.start()
|
||||||
# thread_listener.start()
|
# thread_listener.start()
|
||||||
|
|
||||||
self.run(self.__run)
|
self.run(self.__run)
|
||||||
|
@ -123,6 +124,7 @@ class MunyalClient(Icon):
|
||||||
if data["name"] in self.ignored:
|
if data["name"] in self.ignored:
|
||||||
self.ignored.remove(data["name"])
|
self.ignored.remove(data["name"])
|
||||||
self.stack.pop(0)
|
self.stack.pop(0)
|
||||||
|
continue
|
||||||
if data["is_file"] and data["action"] == "add":
|
if data["is_file"] and data["action"] == "add":
|
||||||
full_path = os.path.join(folder, data["name"])
|
full_path = os.path.join(folder, data["name"])
|
||||||
data["file"] = base64.b85encode(
|
data["file"] = base64.b85encode(
|
||||||
|
@ -170,7 +172,8 @@ class MunyalClient(Icon):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def downloader(self, data):
|
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)
|
full_path = os.path.join(self.config["folder"], name)
|
||||||
if data["is_file"]:
|
if data["is_file"]:
|
||||||
if data["action"] == "add":
|
if data["action"] == "add":
|
||||||
|
|
|
@ -22,7 +22,7 @@ def get_json(path):
|
||||||
items = os.listdir(path)
|
items = os.listdir(path)
|
||||||
try:
|
try:
|
||||||
for item in items:
|
for item in items:
|
||||||
if item[0] != ".":
|
if item[0] != "." and not item.endswith("tmp"):
|
||||||
item_json = {"name": item}
|
item_json = {"name": item}
|
||||||
route = os.path.join(path, item)
|
route = os.path.join(path, item)
|
||||||
if os.path.isdir(route):
|
if os.path.isdir(route):
|
||||||
|
|
Loading…
Reference in New Issue