Commit e10a6f9a authored by Roland Haas's avatar Roland Haas
Browse files

retain ordering from globus in returned dict

parent bf1f939f
......@@ -14,6 +14,7 @@ import os
import errno
import globus_sdk
import json
from collections import OrderedDict
# endpoints determined by globus cli: globus endpoint search ncsa#bluewaters
# or from globus.org -> "Manage Endpoints" -> endpoint detail, UUID
......@@ -198,10 +199,12 @@ class GlobusTransferHelper:
depth - maximum depth to recurse when listing, 1 shows the content of
the given directory, "infinite" recurses without bounds
(default: 1)
Returns: a dict with information about the found objects as returned by
the underlying Globus operation_ls. The dictorany keys are the
path of the object relative to the starting point. Each entry
is dict with this content (see
Returns: an ordered dict with information about the found objects as
returned by the underlying Globus operation_ls. The dictorany
keys are the path of the object relative to the starting
point. Entries are intially sorted such that files in a
directory immediately follow the directory. Each entry is dict
with this content (see
https://docs.globus.org/api/transfer/file_operations/#list_directory_contents):
path - the absolute path of the object
name - the name of the object
......@@ -232,7 +235,7 @@ class GlobusTransferHelper:
the name being the full path relative to the the path argument
"""
entries = tclient.operation_ls(endpoint, path=path)
retval = dict()
retval = OrderedDict()
for entry in entries:
full_path = path + "/" + entry['name']
full_name = prefix + entry["name"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment