Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.

Commit

Permalink
have tested for depth
Browse files Browse the repository at this point in the history
  • Loading branch information
tulvgengenr committed Feb 28, 2023
1 parent 5f9b874 commit 54acef1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion filequeue.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __add_file_to_queue(self, sourcepath, subpath, depth, maxdepth):
if os.path.isfile(sourcepath):
self.file_queue.put(EntityFile(False, subpath, depth))
else:
if depth <= maxdepth:
if depth < maxdepth:
self.file_queue.put(EntityFile(True, subpath, depth))
for file in os.listdir(sourcepath):
self.__add_file_to_queue(
Expand Down
6 changes: 3 additions & 3 deletions scowsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __transfer_file(self, filepath):
with Popen(cmd, stdout=PIPE, universal_newlines=True, shell=True) as popen:
while popen.poll() is None:
line = popen.stdout.readline()
print(f'transfering file: {filepath} {line.strip()}')
# print(f'transfering file: {filepath} {line.strip()}')
return

# transfer directory
Expand All @@ -67,7 +67,7 @@ def __transfer_dir(self, dirpath):
with Popen(cmd, stdout=PIPE, universal_newlines=True, shell=True) as popen:
while popen.poll() is None:
line = popen.stdout.readline()
print(f'transfering dir: {dirpath} {line.strip()}')
# print(f'transfering dir: {dirpath} {line.strip()}')

def transfer_files(self):
'''
Expand All @@ -83,7 +83,7 @@ def transfer_files(self):
while not self.file_queue.empty():
entity_file: EntityFile = self.file_queue.get()
if entity_file.isdir:
if entity_file.depth <= self.max_depth:
if entity_file.depth < self.max_depth:
ssh = SSH(self.address, self.user, self.sshpassword)
string_cmd = f'mkdir -p \
{os.path.join(self.destinationpath, entity_file.subpath)}'
Expand Down

0 comments on commit 54acef1

Please sign in to comment.