Skip to content

Commit

Permalink
filter hidden files
Browse files Browse the repository at this point in the history
  • Loading branch information
darkobas2 committed Feb 28, 2023
1 parent f12ed8d commit 8a6e029
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion swarmsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def __repr__(self):
return json.dumps(self, ensure_ascii=False)

def init_paths(local):
global home,ALLFILES,TODO,ADDRESS,TAG,RESPONSES,RETRIEVABLE,RETRY
if local != True:
home=Path('.').resolve() / '.swarmsync'
ALLFILES=Path('.').resolve() / '.swarmsync/allfiles.json'
Expand Down Expand Up @@ -81,10 +82,12 @@ def init_paths(local):

def prepare():
global pin,stamp
global home,ALLFILES,TODO,ADDRESS,TAG,RESPONSES,RETRIEVABLE,RETRY
pin=args.pin
stamp=args.stamp

FILES=sorted(list(filter(lambda x: x.is_file(), Path(args.path).rglob(args.search))))
FILES=filter(lambda x: not any((part for part in x.parts if part.startswith("."))), FILES)
jsonList = []
for f in FILES:
jsonList.append({ "file": f.as_posix() })
Expand Down Expand Up @@ -227,7 +230,7 @@ async def aioupload(file: FileManager, url: str, session: aiohttp.ClientSession,
if MIME is None:
MIME = "application/octet-stream"

headers={"Content-Type": MIME, "swarm-deferred-upload": "true",
headers={"Content-Type": MIME, "swarm-deferred-upload": "false",
"swarm-postage-batch-id": stamp }
if tag:
ntag = await create_tag()
Expand Down

0 comments on commit 8a6e029

Please sign in to comment.