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

browsing refactor #7

Open
anwarnunez opened this issue Jun 11, 2016 · 0 comments
Open

browsing refactor #7

anwarnunez opened this issue Jun 11, 2016 · 0 comments

Comments

@anwarnunez
Copy link
Contributor

anwarnunez commented Jun 11, 2016

At the moment, we're overloading __dir__ and __attr__ in order to return python objects that allow tab completion. Unfortunately, this causes issues when the s3 object name created starts with a number. (Python only allows object names to begin with a letter or an underscore, and we need to create objects to browse).

At the moment, we will avoid the problem by pre-pending NUM_. The full actual s3 object name is always accessible under _fullpath in a browser object.

In the future, we should use this: https://github.com/h5py/h5py/blob/master/h5py/ipy_completer.py

>>> import cottoncandy as cc
>>> cci = cc.get_interface('my_bucket')
>>> cci.ls('/myfold<TAB>')
myfolder1    myfolder3 
myfolder2    myfolder4
>>> cci.ls('/myfolder2/file<TAB>')
file1    file3 
file2    file4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant