Results 1 to 2 of 2

Thread: Python delimiter help

  1. #1
    Administrator Kavoir's Avatar
    Join Date
    Dec 2009
    Posts
    183

    Python delimiter help

    Has anyone been able to get sub-directories to work in cloud files using python? I've created a directory structure without using the marker files which lists out as so with container.list_objects():

    ['et/jpg/ET_Island_LR.jpg', 'et/jpg/beltrack.jpg', 'et/jpg/drawer.jpg', 'et/tif/belt_rack.tif', 'et/tif/drawer.tif']

    If I call list_objects like container.list_objects(delimiter='/') I get:
    ['et/']

    If I call list objects with container.list_objects(path='et/jpg', delimiter='/') I can see the files in the jpg folder like:

    ['et/jpg/ET_Island_LR.jpg', 'et/jpg/beltrack.jpg', 'et/jpg/drawer.jpg']

    The issue I'm seeing is if I try to get the subfolders like: container.list_objects(path='et/', delimiter='/'), this returns an empty array. I've tried this with just 'et' as well. I would expect to get back ['et/jpg','et/tif'] but I can't figure out a way to accomplish that.

    Any ideas? Cyberduck seems to see the folder structure perfectly so they must be either parsing it themselves or have it working.
    The road goes ever on and on.

  2. #2
    Administrator Kavoir's Avatar
    Join Date
    Dec 2009
    Posts
    183
    Replying to myself. It appears the 'prefix' parameter works better than the 'path' one.

    So this returns nothing:

    list_objects(path='et/', delimiter='/')

    and this works:

    list_objects(prefix='et/', delimiter='/')
    The road goes ever on and on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •