Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added python requirements for pip #578

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions acd_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def create_dl_jobs(node_id: str, local_path: str, preserve_mtime: bool,
return 0

if node.is_folder:
return traverse_dl_folder(node_id, local_path, preserve_mtime, exclude, jobs)
return traverse_dl_folder(node, local_path, preserve_mtime, exclude, jobs)

loc_name = node.name

Expand All @@ -500,15 +500,13 @@ def create_dl_jobs(node_id: str, local_path: str, preserve_mtime: bool,
return 0


def traverse_dl_folder(node_id: str, local_path: str, preserve_mtime: bool,
def traverse_dl_folder(node: 'Node', local_path: str, preserve_mtime: bool,
exclude: 'List[re._pattern_type', jobs: list) -> int:
"""Duplicates remote folder structure."""

if not local_path:
local_path = os.getcwd()

node = cache.get_node(node_id)

if node.name is None:
curr_path = os.path.join(local_path, 'acd')
else:
Expand All @@ -521,9 +519,13 @@ def traverse_dl_folder(node_id: str, local_path: str, preserve_mtime: bool,
return ERR_CR_FOLDER

ret_val = 0
children = sorted(cache.list_children(node.id))
for child in children:
ret_val |= create_dl_jobs(child.id, curr_path, preserve_mtime, exclude, jobs)
folders, files = cache.list_children(node.id)
folders, files = sorted(folders), sorted(files)

for file in files:
ret_val |= create_dl_jobs(file.id, curr_path, preserve_mtime, exclude, jobs)
for folder in folders:
ret_val |= traverse_dl_folder(folder, curr_path, preserve_mtime, exclude, jobs)
return ret_val


Expand Down
3 changes: 3 additions & 0 deletions acdcli/cache/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def __init__(self, row):
except IndexError:
self.size = 0

def __lt__(self, other):
return self.name < other.name

def __hash__(self):
return hash(self.id)

Expand Down
13 changes: 13 additions & 0 deletions python-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
appdirs==1.4.3
certifi==2017.11.5
chardet==3.0.4
colorama==0.3.9
dateutils==0.6.6
idna==2.6
python-dateutil==2.6.1
pytz==2017.3
requests==2.18.4
requests-toolbelt==0.8.0
six==1.11.0
urllib3==1.22